Using LVM to manage/partition under extended rhel5.9
Core steps:
Add SDB----->pvcreate----->vgextend----->lvextend----->RESIZE2FS
The file system information is as follows:
[Email protected] ~]# df-hfilesystem Size used Avail use% mounted on/dev/mapper/volgroup00-logvol01 18g< c3/>8.1g 8.3G 50%//dev/sda1 190M 13M 168M 8%/boottmpfs 500M 0 500M 0%/dev/shm
[[email protected] ~]# Vgdisplay ---Volume group--- VG Name VolGroup00 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 vg Access read/write VG Status Resizable MAX LV 0 Cur LV 2 Open LV 2 MAX PV 0 Cur PV 1 Act PV 1 VG size 19.78 GB -----------> at this time the size of the VG is 19.78GB pe size 32.00 MB Total PE 633 Alloc pe/size 633/19.78 GB free pe/size 0/0 VG UUID k9z3ze-taoj-tajp-iecn-ckrl-owxz -svnlsw
First turn off Rhel, add disk, and then start Rhel
[Email protected] ~]# fdisk-ldisk/dev/sda:21.4 GB, 21474836480 bytes255 heads, + sectors/track, 2610 cylindersunits = Cylinders of 16065 * 8225280 = bytes Device Boot Start End Blocks Id system/dev/sda1 * 1 200781 linux/dev/sda2 2610 20764012+ 8e Linux lvmdisk/dev/sdb:21.4 GB, 21474836480 bytes -----------> More sdb255 heads, sectors/track, 2610 cylindersunits = C Ylinders of 16065 * 8225280 = Bytesdisk/dev/sdb doesn ' t contain a valid partition table
[Email protected] ~]# Pvcreate/dev/sdb -----------> Establish PV Writing Physical volume data to disk "/dev/sdb" C20/>physical volume "/dev/sdb" successfully created
[Email protected] ~]# Pvdisplay
---physical volume---
PV Name/dev/sda2
VG Name VolGroup00
PV Size 19.80 gb/not usable 21.36 MB
Allocatable Yes (but full)
PE Size (KByte) 32768
Total PE 633
Free PE 0
Allocated PE 633
PV UUID Gcioar-yisf-ildp-8dnl-zgoq-qqmy-c2hhi0
"/dev/sdb" is a new physical volume of "20.00 GB"
---NEW physical volume---
PV Name/dev/sdb
VG Name
PV Size 20.00 GB
Allocatable NO
PE Size (KByte) 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID L9CTFB-JEAI-OWEJ-8D9I-BDLK-4RLP-ONEDCQ
[email protected] ~]# which vgextend/usr/sbin/vgextend[[email protected] ~]#/usr/sbin/vgextend Volgroup00/dev/sdb Volume Group "VolGroup00" successfully extended[[email protected] ~]# vgdisplay ---Volume group--- VG Name VolGroup00 System ID Format lvm2 Metadata areas 2 Metadata Sequence No 4 VG Access read/ Write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 MAX PV 0 Cur PV 2 Act PV 2 VG size 39.75 GB -----------> at this time the size of the VG is 39.75GB, much closer to 20GB pe Size 32.00 MB total PE 1272 Alloc pe/size 633/19.78 GB free pe/size
639/19.97 GB VG UUID K9Z3ZE-TAOJ-TAJP-IECN-CKRL-OWXZ-SVNLSW
[Email protected] ~]# lvextend-l 38500m/dev/mapper/volgroup00-logvol01 rounding up size to full physical extent 37. + GB extending logical Volume LOGVOL01 to 37.62 GB Logical Volume LOGVOL01 successfully resized note: The above command,-l 38500 The meaning of M is extended to 38500MB; if-l +38500m, it means that 38500MB is expanded.
[Email protected] ~]# Lvdisplay
---Logical volume---
LV name/dev/volgroup00/logvol01
VG Name VolGroup00
LV UUID Zhquli-llnj-lfmp-swux-u9ez-rkhc-gooqxd
LV Write Access Read/write
LV Status Available
# open 1
LV Size 37.62 GB-------------> at this time the LV has become larger.
Current LE 1204
Segments 2
Allocation inherit
Read ahead Sectors Auto
-Currently set to 256
Block Device 253:0
---Logical volume---
LV name/dev/volgroup00/logvol00
VG Name VolGroup00
LV UUID WQOTR5-KRDN-IVJA-HLOS-M1W7-32CH-QGAZMK
LV Write Access Read/write
LV Status Available
# open 1
LV Size 2.00 GB
Current LE 64
Segments 1
Allocation inherit
Read ahead Sectors Auto
-Currently set to 256
Block Device 253:1
[Email protected] ~]# df-hfilesystem Size used Avail use% mounted on/dev/mapper/volgroup00-logvol01 19g< c3/>8.1g 9.9G 45%/ ---------------> The file system space has not changed at this time. /DEV/SDA1 190M 13M 168M 8%/boottmpfs 500M 0 500M 0%/DEV/SHM
[[email protected] ~]# resize2fs/dev/mapper/volgroup00-logvol01resize2fs 1.39 (29-may-2006) Filesystem at/dev/mapper/ VOLGROUP00-LOGVOL01 is mounted on/; On-line resizing requiredperforming an on-line resize of/dev/mapper/volgroup00-logvol01 to 9863168 (4k) blocks. The filesystem on/dev/mapper/volgroup00-logvol01 is now 9863168 blocks long.
[Email protected] ~]# df-hfilesystem Size used Avail use% mounted ON/DEV/MAPPER/VOLGROUP00-LOGVOL01 37G 8.1G 27G 24%//dev/sda1 190M 13M 168M 8%/BOOTTMPFS 500M 0 500 M 0%/dev/shm[[email protected] ~]# vgdisplay---Volume group---VG Name VolGroup00 System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 6 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 MAX PV 0 Cur PV 2 Act PV 2 VG size 39.75 GB PE size 32.00 MB Total PE 1272 Alloc pe/size 1268/39.62 GB free pe/size 4/128.00 MB VG UUID K9z3ze-taoj-tajp-iecn-ckrl-owxz-svnlsw
Using LVM to manage/partition under extended rhel5.9