标签:
查看当前磁盘分区情况
fdisk -l
磁盘分区
fdisk /dev/sdb
创建PV
pvcreate /dev/sdb1
pvcreate /dev/sdb2
确认PV
pvdisplay
pvdisplay /dev/sdb1
pvdisplay /dev/sdb2
创建VG
vgcreate myVG /dev/sdb1 /dev/sdb2
or
vgcreate myVG /dev/sdb1; vgextend myVG /dev/sdb2
确认VG
vgdisplay
创建LV
lvcreate -L 400 -n vol01 myVG
lvcreate -L 1000 -n vol02 myVG
# -L size, 400M, 1000M
# -n lv‘s name
确认LV
lvdisplay
创建Filesystem
mkfs.ext3 /dev/myVG/vol01
mkfs.ext3 /dev/myVG/vol02
挂载Mount Filesystem
mkdir -p /data1
mkdir -p /data2
mount /dev/myVG/vol01 /data1
mount /dev/myVG/vol02 /data2
编辑写入/etc/fstab
# file system|mount point|type|options|dump|pass
/dev/myVG/vol01 /data1 ext3 rw,noatime 0 0
/dev/myVG/vol02 /data2 ext3 rw,noatime 0 0
扩展LV
lvextend -L +800 /dev/myVG/vol01
# -L size 800M
重置FS大小(扩张此时才实际生效)
resize2fs /dev/myVG/vol01
删除LV
lvremove /dev/myVG/vol02
标签:
原文地址:http://www.cnblogs.com/goozgk/p/5658137.html