准备好磁盘空间,添加/dev/sda、/dev/sde 、 /dev/sdf,将磁盘分区,/dev/sda7、/dev/sde1,留一个磁盘、/dev/sdf;
创建逻辑卷
1、创建物理卷
# pvcreate /dev/sd{a7,e1}
#pvs
#pvdisplay
2、创建卷组
#vgcreate -s 16M vg0 /dev/sd{a7,e1}
#vgs
#vgdisplay
3、创建逻辑卷
#lvcreate -n lv0 -l 100% vg0
#lvs
#lvdisplay
#ll /dev/vg0/lv0
#ll /dev/mapper/vg0-lv0
4、配置文件
#vim /etc/fstab
5、创建文件夹
#mkdir /mnt/lv0
6、挂载逻辑卷
#mount /dev/vg0/lg0 /mnt/lv0
7、查看挂载点,是否已经挂载
#df -h
#lvdisplay
8、拷贝文件到逻辑卷上
#cp /etc/fstab /mnt/lv0
#cp /var/log/messages /mnt/lv0
9、查看文件
#cd /mnt/lv0
#cat /fstab
10、测速
dd if=/dev/zero of=/mnt/lv0/bigfile bs=1M count=1024
dd if=/mnt/lv0/bingfile of=/dev/null
创建完成;
扩展逻辑卷
1、扩展物理卷
#pvcreate /dev/sdf
#pvs
#pvdisplay
2、添加卷组
#vgcreate vg0 /dev/sdf
#vgdisplay
#vgs
#df -h
3、扩展逻辑卷
#lvextent -l +1000 /dev/vg0/lv0
#lvdisplay
#df -h
4、同步文件系统
#resize2fs /dev/vg0/lv0
#df -h
#lvdisplay
5、查看文件系统及逻辑卷大小,将剩余的空间全部使用
#lvextend -r -l +100%free /dev/vg0/lv0
#df -h
#lvdisplay



















网友评论