I'm running Oracle Enterprise Linux 5.6 as a virtual machine inside Virtualbox 4.0.12 on my mac. Initially I had allocated 8G of hard disk space and now I increased the virtual hard disk size to 30G.
After the reboot, although fdisk tells me there is 31.4G, the root logical volume is still showing the old disk space.
This is the output of fdisk.
[root@xyz ~]# fdisk -l
Disk /dev/sda: 31.4 GB, 31457280000 bytes
255 heads, 63 sectors/track, 3824 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1044 8281507+ 8e Linux LVM
Disk /dev/dm-0: 6341 MB, 6341787648 bytes
255 heads, 63 sectors/track, 771 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-0 doesn't contain a valid partition table
Disk /dev/dm-1: 2113 MB, 2113929216 bytes
255 heads, 63 sectors/track, 257 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-1 doesn't contain a valid partition table
This is the output of df -h
[root@xyz ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
5.8G 5.4G 40M 100% /
/dev/sda1 99M 61M 34M 65% /boot
tmpfs 2.9G 0 2.9G 0% /dev/shm
[root@xyz ~]#
Output of vgdisplay:
[root@xyz ~]# 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 7.88 GB
PE Size 32.00 MB
Total PE 252
Alloc PE / Size 252 / 7.88 GB
Free PE / Size 0 / 0
VG UUID k5viVC-eWvO-9wuG-146f-cGjk-RAHK-yDRJKz
output of pvscan:
[root@xyz ~]# pvscan
PV /dev/sda2 VG VolGroup00 lvm2 [7.88 GB / 0 free]
Total: 1 [7.88 GB] / in use: 1 [7.88 GB] / in no VG: 0 [0 ]
[root@xyz ~]#
I need help with resizing the LVM logical volume to 30G, Thanks!
Best Answer
Do the following:
This procedure should work without having to unmount the root disk if you are using a Linux 2.6 kernel.