:
Command (m for help): n
:
p primary partition (1-4) p
Partition number (1-4): 1
First cylinder (1-24321, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-24321, default 24321):
Using default value 24321
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
--- Volume group ---
VG Name vg-seagate1
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 298.09 GB
PE Size 4.00 MB
Total PE 76310
Alloc PE / Size 0 / 0
Free PE / Size 76310 / 298.09 GB
VG UUID XrrB58-E5zC-OFg0-e3Ch-lNsj-wr0n-LiyH33
指定特定空間大小 290G
lvcreate -L 290G -ndata01 vg-seagate1
mkfs -t ext3 /dev/vg-seagate1/data01
mount /dev/vg-seagate1/data01 /backup
由上面 vgdisplay 可以知道 vg-seagate1 的可用大小為 VG Size = 298.09
GB 如果想要擴增到 100% 可透過 lvextend 來加上剩下的 8.08G
1)
看執行的內容
[root@ibm-x206 ~]# lvextend -L +8.09G /dev/vg-seagate1/data01
Rounding up size to full physical extent 8.09 GB
Extending logical volume data01 to 298.09 GB
Insufficient free space: 2072 extents needed, but only 2070 available
[root@ibm-x206 ~]# lvdisplay
--- Logical volume ---
LV Name /dev/vg-seagate1/data01
VG Name vg-seagate1
LV UUID 1nFltd-kgtz-v8od-k1LK-y717-pOlp-piBcrE
LV Write Access read/write
LV Status available
# open 1
LV Size 290.00 GB
Current LE 74240
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:2
[root@ibm-x206 ~]# lvextend -L +8.08G /dev/vg-seagate1/data01
Rounding up size to full physical extent 8.08 GB
Extending logical volume data01 to 298.08 GB
Logical volume data01 successfully resized
[root@ibm-x206 ~]# lvdisplay
--- Logical volume ---
LV Name /dev/vg-seagate1/data01
VG Name vg-seagate1
LV UUID 1nFltd-kgtz-v8od-k1LK-y717-pOlp-piBcrE
LV Write Access read/write
LV Status available
# open 1
LV Size 298.08 GB
Current LE 76309
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:2
[root@ibm-x206 backup]# df -k
Filesystem 1K-區段 已用 可用 已用% 掛載點
/dev/mapper/VolGroup00-LogVol00
305346824 1237084 288599008 1% /
/dev/sda1 101086 19636 76231 21% /boot
none 517016 0 517016 0% /dev/shm
/dev/mapper/vg--seagate1-data01
299315840 98368 284013120 1% /backup
[root@ibm-x206 backup]# ext2online /dev/vg-seagate1/data01
ext2online v1.1.18 - 2001/03/18 for EXT2FS 0.5b
[root@ibm-x206 backup]# df -k
Filesystem 1K-區段 已用 可用 已用% 掛載點
/dev/mapper/VolGroup00-LogVol00
305346824 1237084 288599008 1% /
/dev/sda1 101086 19636 76231 21% /boot
none 517016 0 517016 0% /dev/shm
/dev/mapper/vg--seagate1-data01
307656824 98368 291930476 1% /backup