Disk /dev/xvda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00078f9c
Device Boot Start End Blocks Id System
/dev/xvda1 * 1 2611 20970496 83 Linux
Disk /dev/xvdb: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
3、创建物理卷
pvcreate /dev/xvdb1
4、创建卷组
vgcreate vg_bjcy /dev/xvdb1
5、查看物理卷信息
pvdisplay
6、创建逻辑卷(25599(Total PE)的数值是由上一步查询到的物理卷信息决定的)
lvcreate -l 25599 -n lv_bjcy vg_bjcy
7、格式化逻辑卷(可先lvdisplay确认 逻辑卷路径)
mkfs.ext4 /dev/vg_bjcy/lv_bjcy
8、挂载逻辑卷
mkdir /data && mount /dev/mapper/vg_bjcy-lv_bjcy /data
9、配置开机自动挂载(注意格式,最后不要直接复制)
vim /etc/fstab
/dev/mapper/vg_bjcy-lv_bjcy /data ext4 defaults 0 0
10.删除逻辑卷/逻辑卷组
lvremove /dev/vg_bjcy/lv_bjcy