This follows on from an earlier post ( written in 2010 about RHEL 5.5 )
I'd originally created a 30 GB VM using the 64-bit version of RHEL 6.3, and was using it to install IBM Connections 3.0.1.1 CR2.
Sadly I ran out of disk space during the final hurdle.
Thankfully, VMware Fusion 4.1.3 ( on Mac OS X) allows me to grow the virtual disk on the fly ( from 30 GB to 50 GB ).
However, I had to remind myself how to tell Linux that the disk had grown.
This is what I had to start with: -
$ df -kmh
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_rhel6-lv_root
26G 8.8G 16G 37% /
tmpfs 937M 0 937M 0% /dev/shm
/dev/sda1 485M 76M 384M 17% /boot
$ pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name vg_rhel6
PV Size 29.51 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 7554
Free PE 0
Allocated PE 7554
PV UUID ErZzgp-aefq-eHjk-njzR-Aoq1-mUGV-olNd76
PV Name /dev/sda2
VG Name vg_rhel6
PV Size 29.51 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 7554
Free PE 0
Allocated PE 7554
PV UUID ErZzgp-aefq-eHjk-njzR-Aoq1-mUGV-olNd76
$ vgdisplay
--- Volume group ---
VG Name vg_rhel6
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 29.51 GiB
PE Size 4.00 MiB
Total PE 7554
Alloc PE / Size 7554 / 29.51 GiB
Free PE / Size 0 / 0
VG UUID lqlIZU-UDiA-gz5A-Xqxn-TFL7-REo3-s0lDzm
VG Name vg_rhel6
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 29.51 GiB
PE Size 4.00 MiB
Total PE 7554
Alloc PE / Size 7554 / 29.51 GiB
Free PE / Size 0 / 0
VG UUID lqlIZU-UDiA-gz5A-Xqxn-TFL7-REo3-s0lDzm
$ lvdisplay
LV Path /dev/vg_rhel6/lv_root
LV Name lv_root
VG Name vg_rhel6
LV UUID 23aVS2-OAA6-B9yL-UjFf-0fhz-ycJm-vrK3r2
LV Write Access read/write
LV Creation host, time ,
LV Status available
# open 1
LV Size 25.57 GiB
Current LE 6546
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Path /dev/vg_rhel6/lv_swap
LV Name lv_swap
VG Name vg_rhel6
LV UUID eX02pG-wj73-Ydjx-0vmn-Q8b3-7m9f-kZZmWi
LV Write Access read/write
LV Creation host, time ,
LV Status available
# open 1
LV Size 3.94 GiB
Current LE 1008
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
This was easier than I'd expected - although my earlier blog post definitely helped: -
Create a new disk partition ( /dev/sda3 )
$ fdisk /dev/sda
Reboot to take effect
$ reboot
Create a new physical volume on the newly created partition
$ pvcreate /dev/sda3
Extend the volume group
$ vgextend vg_rhel6 /dev/sda3
Extend the logical volume
$ lvextend /dev/mapper/vg_rhel6-lv_root /dev/sda3
Resize the file system
$ resize2fs -p /dev/mapper/vg_rhel6-lv_root
Check the space
$ df -kmh
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_rhel6-lv_root
45G 21G 22G 49% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
/dev/sda1 485M 76M 384M 17% /boot
/dev/mapper/vg_rhel6-lv_root
45G 21G 22G 49% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
/dev/sda1 485M 76M 384M 17% /boot
To close the loop, here are the physical volume, volume group and logical volume statistics post the change: -
$ pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name vg_rhel6
PV Size 29.51 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 7554
Free PE 0
Allocated PE 7554
PV UUID ErZzgp-aefq-eHjk-njzR-Aoq1-mUGV-olNd76
--- Physical volume ---
PV Name /dev/sda3
VG Name vg_rhel6
PV Size 20.00 GiB / not usable 3.34 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 5119
Free PE 0
Allocated PE 5119
PV UUID ZhJrDi-tIPA-bzUe-vLJv-ifhf-UDWb-KT46Jo
PV Name /dev/sda2
VG Name vg_rhel6
PV Size 29.51 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 7554
Free PE 0
Allocated PE 7554
PV UUID ErZzgp-aefq-eHjk-njzR-Aoq1-mUGV-olNd76
--- Physical volume ---
PV Name /dev/sda3
VG Name vg_rhel6
PV Size 20.00 GiB / not usable 3.34 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 5119
Free PE 0
Allocated PE 5119
PV UUID ZhJrDi-tIPA-bzUe-vLJv-ifhf-UDWb-KT46Jo
$ vgdisplay
--- Volume group ---
VG Name vg_rhel6
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 5
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 49.50 GiB
PE Size 4.00 MiB
Total PE 12673
Alloc PE / Size 12673 / 49.50 GiB
Free PE / Size 0 / 0
VG UUID lqlIZU-UDiA-gz5A-Xqxn-TFL7-REo3-s0lDzm
$ lvdisplay
--- Logical volume ---
LV Path /dev/vg_rhel6/lv_root
LV Name lv_root
VG Name vg_rhel6
LV UUID 23aVS2-OAA6-B9yL-UjFf-0fhz-ycJm-vrK3r2
LV Write Access read/write
LV Creation host, time ,
LV Status available
# open 1
LV Size 45.57 GiB
Current LE 11665
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Path /dev/vg_rhel6/lv_swap
LV Name lv_swap
VG Name vg_rhel6
LV UUID eX02pG-wj73-Ydjx-0vmn-Q8b3-7m9f-kZZmWi
LV Write Access read/write
LV Creation host, time ,
LV Status available
# open 1
LV Size 3.94 GiB
Current LE 1008
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
LV Path /dev/vg_rhel6/lv_root
LV Name lv_root
VG Name vg_rhel6
LV UUID 23aVS2-OAA6-B9yL-UjFf-0fhz-ycJm-vrK3r2
LV Write Access read/write
LV Creation host, time ,
LV Status available
# open 1
LV Size 45.57 GiB
Current LE 11665
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Path /dev/vg_rhel6/lv_swap
LV Name lv_swap
VG Name vg_rhel6
LV UUID eX02pG-wj73-Ydjx-0vmn-Q8b3-7m9f-kZZmWi
LV Write Access read/write
LV Creation host, time ,
LV Status available
# open 1
LV Size 3.94 GiB
Current LE 1008
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
2 comments:
I just boot a gparted iso image and set it that way. Nice easy to use Graphical UI.
Cheers, Carl, but I'm an old skool command-line kinda guy, and I don't always get GUI access, especially to VMs :-)
Also, with a command-line, you can create an audit trail :-)
Post a Comment