Wednesday, January 1, 2014

How do I resize the root partition (/) after installation on Red Hat Enterprise Linux 4?



Top of Form
Issue
  • How do I resize the root partition (/) after installation on Red Hat Enterprise Linux 4?
Note:
  • Resizing non-LVM root partitions is not covered in this document and is not supported by Red Hat Global Support Services.
Environment
  • Red Hat Enterprise Linux 4
  • The root partition is an LVM logical volume.
Resolution
Assumption:
  • Logical Volume Manager (LVM) is already configured on the system.
Steps to resize the root partition (/):
  • Verify on which LV device, the / is mounted:
Eg:
# df /
  • Check filesystem column in the output of above command. There would be something like /dev/mapper/Vol00-LogVol00.
Eg: "LogVol00" is the Logical Volume device on which / is mounted and "Vol00" is the volume group.
  • Verify the free Physical Extents (PE) in the volume group in which the Logical Volume is residing.
Eg:
# vgdisplay <volumegroup>
  • After confirming the free Physical Extents (PE), resize the Logical Volume.
Eg:
# lvextend -l +125 /dev/<volumegroup>/<logicalvolume>
OR
# lvextend -L +500M /dev/<volumegroup>/<logicalvolume>
  • Resize the mounted filesystem.
Eg:
# ext2online /dev/<volumegroup>/<logicalvolume>
Note: If you miss this step, no error will occur, however only the logical volume size will increase i.e. when you mount the filesystem it will still be the same size.

Extra Notes:
  • The ext2online command is in the e2fsprogs rpm which is installed by default in RHEL4 systems.
The resize2fs command in the e2fsprogs rpm could only be used on an unmounted filesystem in RHEL4 system, but after RHEL5, it could 

No comments:

Post a Comment