System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow root boot disk in Red Hat Linux 5.2.

SOLVED
Go to solution
Juan Gonzalez_2
Frequent Advisor

Grow root boot disk in Red Hat Linux 5.2.

My manager what me to try this. To see if it can be done. The server started off with 20G san boot lun. I shutdown the Linux server and the Storage team increased the size of the boot lun to 30G how can I increase the root volume group to bring in that extra 10G if it can be done at all?
4 REPLIES
Steven E. Protter
Exalted Contributor

Re: Grow root boot disk in Red Hat Linux 5.2.

Shalom,

If you used LVM, easy.

Add the additional 10G as an extra disk/LUN.

pvcreate
vgextend
lvextend
resize2fs the filesystems

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Matti_Kurkela
Honored Contributor
Solution

Re: Grow root boot disk in Red Hat Linux 5.2.

It probably can be done. If you're using LVM (since you mentioned "root volume group"), it might even be easy.

Method 1:

Because this is a boot LUN, it should include a normal PC-style partition table, which contains at least one traditional partition (usually /boot) and at least one other partition with type 8e (Linux LVM).

If the system was shutdown while the storage team made the change, the system should automatically detect the new size of the boot LUN when it is started. Verify this with "fdisk -l", "cat /proc/partitions" or whatever.

Use cfdisk, fdisk, parted or your favorite partitioning tool to make a new partition out of the extra 10G of unallocated space, and set its type to 8e (Linux LVM). Since the LUN contains the root filesystem, it will obviously be in use and the partitioning tool may tell you to reboot; but try running the command "partprobe" instead. If the new partition becomes visible in /proc/partitions after that, you don't even have to reboot.

When you see the new partition in /proc/partitions, run pvcreate on it, then use the vgextend command to add it to the root VG. Now you can use the new capacity to extend any existing LV in the root VG, or to create new LVs, using standard LVM procedures.

---------
Method 2: (simpler, but somewhat more risky and might not be applicable if you have more than 2 partitions on the LUN)

Use the partitioning tool to extend the partition containing the PV to fill the new space.

(If you use fdisk, you will have to delete the PV partition, then re-add the partition in a larger size. Make sure the starting point of the partition remains exactly the same as before, and remember to set the partition type correctly. Double-check before saving the new partition table.)

Run partprobe. If it does not do the job, re-check the partition table a third time, and fix any errors. Then reboot. (If you made a mistake, your boot LUN may be corrupted and the system might be unable to boot. Better to know it sooner than later.)

Once the PV partition has been resized, run pvresize on it to make the LVM aware of the new size. The root VG should now have extra 10G of unallocated space. Now you can use the new capacity to extend any existing LV in the root VG, or to create new LVs, using standard LVM procedures.

MK
MK
Juan Gonzalez_2
Frequent Advisor

Re: Grow root boot disk in Red Hat Linux 5.2.

Thanks a lot Matti Method 1 worked. I will also try method 2 just for my on the job training.
dirk dierickx
Honored Contributor

Re: Grow root boot disk in Red Hat Linux 5.2.

if i'm not mistaken, if you're on a SAN and the size of your assigned storage is increased you can simply use resize2fs as well.

(you are obviously using LVM, but just wanted to mention this fact)