LVM(扩展)========================
[root@aminglinux newdir]# fdisk -l /dev/sdb
磁盘 /dev/sdb:10.7 GB, 10737418240 字节,20971520 个扇区Units = 扇区 of 1 * 512 = 512 bytes扇区大小(逻辑/物理):512 字节 / 512 字节I/O 大小(最小/最佳):512 字节 / 512 字节磁盘标签类型:dos磁盘标识符:0x3326d135 设备 Boot Start End Blocks Id System/dev/sdb1 2048 2099199 1048576 83 Linux/dev/sdb2 2099200 4196351 1048576 83 Linux/dev/sdb3 4196352 6293503 1048576 83 Linux[root@aminglinux newdir]# fdisk -l /dev/sdb磁盘 /dev/sdb:10.7 GB, 10737418240 字节,20971520 个扇区Units = 扇区 of 1 * 512 = 512 bytes扇区大小(逻辑/物理):512 字节 / 512 字节I/O 大小(最小/最佳):512 字节 / 512 字节磁盘标签类型:dos磁盘标识符:0x3326d135 设备 Boot Start End Blocks Id System/dev/sdb1 2048 2099199 1048576 8e Linux LVM/dev/sdb2 2099200 4196351 1048576 8e Linux LVM/dev/sdb3 4196352 6293503 1048576 8e Linux LVM[root@aminglinux newdir]# partprobe[root@aminglinux ~]# pvcreate /dev/sdb1 Physical volume "/dev/sdb1" successfully created.[root@aminglinux ~]# pvcreate /dev/sdb2 Physical volume "/dev/sdb2" successfully created.[root@aminglinux ~]# pvs PV VG Fmt Attr PSize PFree /dev/sdb1 vg1 lvm2 a-- 1020.00m 1020.00m /dev/sdb2 vg1 lvm2 a-- 1020.00m 1020.00m /dev/sdb3 lvm2 --- 1.00g 1.00g[root@aminglinux ~]# vgcreate vg1 /dev/sdb1 /dev/sdb2 Volume group "vg1" successfully created[root@aminglinux ~]# vgs VG #PV #LV #SN Attr VSize VFree vg1 2 0 0 wz--n- 1.99g 1.99g[root@aminglinux ~]# lvcreate -L 100M -n lv1 vg1 Logical volume "lv1" created.[root@aminglinux ~]# mkfs.xfs /dev/vg1/lv1[root@aminglinux /]# mount /dev/vg1/lv1 /newdev[root@aminglinux /]# df -h |grep -v tmpfs文件系统 容量 已用 可用 已用% 挂载点/dev/sda3 17G 1.4G 15G 9% //dev/sda1 197M 94M 104M 48% /boot/dev/mapper/vg1-lv1 97M 5.2M 92M 6% /newdev[root@aminglinux /]# lvresize -L 300M /dev/vg1/lv1 Size of logical volume vg1/lv1 changed from 100.00 MiB (25 extents) to 300.00 MiB (75 extents). Logical volume vg1/lv1 successfully resized.[root@aminglinux /]# xfs_growfs /dev/vg1/lv1meta-data=/dev/mapper/vg1-lv1 isize=512 agcount=4, agsize=6400 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=0 spinodes=0data = bsize=4096 blocks=25600, imaxpct=25 = sunit=0 swidth=0 blksnaming =version 2 bsize=4096 ascii-ci=0 ftype=1log =internal bsize=4096 blocks=855, version=2 = sectsz=512 sunit=0 blks, lazy-count=1realtime =none extsz=4096 blocks=0, rtextents=0data blocks changed from 25600 to 76800[root@aminglinux /]# df -h |grep -v tmpfs文件系统 容量 已用 可用 已用% 挂载点/dev/sda3 17G 1.4G 15G 9% //dev/sda1 197M 94M 104M 48% /boot/dev/mapper/vg1-lv1 297M 5.5M 292M 2% /newdev[root@aminglinux ~]# pvcreate /dev/sdb3 Physical volume "/dev/sdb3" successfully created.[root@aminglinux /]# vgextend vg1 /dev/sdb3 Volume group "vg1" successfully extended[root@aminglinux /]# vgs VG #PV #LV #SN Attr VSize VFree vg1 3 1 0 wz--n- <2.99g <2.70g