[root@pgb lvm]# vgdisplay --- Volume group --- VG Name vg01_pgdata System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 2 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 1 Max PV 0 Cur PV 2 Act PV 2 VG Size 1.95 GB PE Size 4.00 MB Total PE 499 Alloc PE / Size 256 / 1.00 GB Free PE / Size 243 / 972.00 MB VG UUID B5pg8R-2AGm-6DEp-K7HK-TI1I-HC3h-gWx32m
[root@pgb lvm]# mkfs -t ext3 -c /dev/hdb2 mke2fs 1.39 (29-May-2006) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 137088 inodes, 274176 blocks 13708 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=281018368 9 block groups 32768 blocks per group, 32768 fragments per group 15232 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376 Checking for bad blocks (read-only test): done Writing inode tables: done Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 28 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
1.4 创建PV
1 2
[root@pgb lvm]# pvcreate /dev/hdb2 Physical volume"/dev/hdb2" successfully created
[root@pgb lvm]# vgdisplay --- Volume group --- VG Name vg01_pgdata System ID Format lvm2 Metadata Areas 3 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 1 Max PV 0 Cur PV 3 Act PV 3 VG Size 2.99 GB PE Size 4.00 MB Total PE 766 Alloc PE / Size 256 / 1.00 GB Free PE / Size 510 / 1.99 GB VG UUID B5pg8R-2AGm-6DEp-K7HK-TI1I-HC3h-gWx32m
[root@pgb lvm]# vgdisplay --- Volume group --- VG Name vg01_pgdata System ID Format lvm2 Metadata Areas 3 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 1 Max PV 0 Cur PV 3 Act PV 3 VG Size 2.99 GB PE Size 4.00 MB Total PE 766 Alloc PE / Size 256 / 1.00 GB Free PE / Size 510 / 1.99 GB VG UUID B5pg8R-2AGm-6DEp-K7HK-TI1I-HC3h-gWx32m
[root@pgb lvm]# resize2fs -f /dev/mapper/vg01_pgdata-lv_pgdata1 resize2fs 1.39 (29-May-2006) Filesystem at /dev/mapper/vg01_pgdata-lv_pgdata1 is mounted on /database/pgdata1; on-line resizing required Performing an on-line resize of /dev/mapper/vg01_pgdata-lv_pgdata1 to524288 (4k) blocks. The filesystem on /dev/mapper/vg01_pgdata-lv_pgdata1 is now 524288 blocks long.