[root@Candy ~]# parted /dev/sdb
GNU Parted 2.1
使用 /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel
新的磁盘标签类型? gpt
(parted) mkpart
分区名称? []?
文件系统类型? [ext2]? ext4
起始点? 0T
结束点? 4T
(parted) p
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 4398GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name 标志
1 1049kB 4398GB 4398GB
(parted)set 1 lvm on
(parted)p
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 4398GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name 标志
1 1049kB 4398GB 4398GB lvm
(parted)q
[root@Candy ~]# ls /dev/sd*
/dev/sda /dev/sda1 /dev/sda2 /dev/sdb /dev/sdb1
[root@Candy ~]# vgdisplay
--- Volume group ---
VG Name vg_candy
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 4
Open LV 4
Max PV 0
Cur PV 2
Act PV 2
VG Size 4.02 TiB
PE Size 4.00 MiB
Total PE 1053569
Alloc PE / Size 4994 / 19.51 GiB
Free PE / Size 1048575 / 4.00 TiB
VG UUID Gcm5Ml-fc88-Xk5q-xuPC-Kj7Y-alfK-i770Gc
[root@Candy ~]# resize2fs /dev//mapper/vg_candy-root
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev//mapper/vg_candy-root is mounted on /; on-line resizing required old desc_blocks = 1, new_desc_blocks = 32
Performing an on-line resize of /dev//mapper/vg_candy-root to 133040128 (4k) blocks.
The filesystem on /dev//mapper/vg_candy-root is now 133040128 blocks long.
[root@Candy ~]# resize2fs /dev//mapper/vg_candy-usr
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev//mapper/vg_candy-usr is mounted on /usr; on-line resizing required old desc_blocks = 1, new_desc_blocks = 32
Performing an on-line resize of /dev//mapper/vg_candy-usr to 132120576 (4k) blocks.
The filesystem on /dev//mapper/vg_candy-usr is now 132120576 blocks long.
[root@Candy ~]# resize2fs /dev//mapper/vg_candy-var
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev//mapper/vg_candy-var is mounted on /var; on-line resizing required old desc_blocks = 1, new_desc_blocks = 32
Performing an on-line resize of /dev//mapper/vg_candy-var to 132120576 (4k) blocks.
The filesystem on /dev//mapper/vg_candy-var is now 132120576 blocks long.
[root@Candy ~]# resize2fs /dev//mapper/vg_candy-home
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev//mapper/vg_candy-home is mounted on /home; on-line resizing required old desc_blocks = 1, new_desc_blocks = 32
Performing an on-line resize of /dev//mapper/vg_candy-home to 132120576 (4k) blocks.
The filesystem on /dev//mapper/vg_candy-home is now 132120576 blocks long.
[root@Candy ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_candy-root 500G 245M 474G 1% /
tmpfs 1.9G 0 1.9G 0% /dev/shm
/dev/sda1 477M 30M 422M 7% /boot
/dev/mapper/vg_candy-home 496G 16M 471G 1% /home
/dev/mapper/vg_candy-usr 496G 390M 471G 1% /usr
/dev/mapper/vg_candy-var 496G 71M 471G 1% /var