Linux下PV与LV
1.新增PV扩展已存在的VG
查看信息
[root@oracle ~]# fdisk -l
Disk /dev/sda: 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: 0x0002fd0c
Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 287 2097152 82 Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3 287 2611 18668544 8e Linux LVM
Disk /dev/sdb: 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: 0x27b457fc
Device Boot Start End Blocks Id System
Disk /dev/mapper/vg_oracle-LogVol00: 19.1 GB, 19113443328 bytes
255 heads, 63 sectors/track, 2323 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
[root@oracle ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 vg_oracle lvm2 a--u 17.80g 0
[root@oracle ~]# vgs
VG #PV #LV #SN Attr VSize VFree
vg_oracle 1 1 0 wz--n- 17.80g 0
将PV加入已有VG
[root@oracle ~]# vgextend vg_oracle /dev/sdb
[root@oracle ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 vg_oracle lvm2 a—u 17.80g 0
/dev/sdb vg_oracle lvm2 a—u 20.00g 20.00g
[root@oracle ~]# vgs
VG #PV #LV #SN Attr VSize VFree
vg_oracle 2 1 0 wz--n- 37.80g 20.00g
虽然VG中已经可以看到扩容了,但是卷组可用仍然只有1.2G
[root@oracle ~]# df -hT