Operating System - Linux
1753758 Members
4738 Online
108799 Solutions
New Discussion

To resize the / partition in Redhat Linux 5.4

 
Sreer
Valued Contributor

To resize the / partition in Redhat Linux 5.4

Hello Gurus,

 

Is it possible to extend the / file system in Redhat Linux 5.4 as online?

 

fs type is ext3

 

rgds

Sree

 

 

3 REPLIES 3
Matti_Kurkela
Honored Contributor

Re: To resize the / partition in Redhat Linux 5.4

If /boot is a separate filesystem located on a traditional BIOS partition and / is located on a LVM logical volume, then the answer is "yes, just like any other ext3 filesystem".

 

If / is a traditional BIOS partition, then the answer is "you can certainly extend the filesystem, if you can extend the underlying partition first".

LVM logical volume can grow if there are free extents in any location on any PV of its VG; a traditional BIOS partition can only grow by adding more disk blocks to its tail end. If there is another partition located immediately after the partition you wish to extend and you cannot move or delete it, you cannot extend the partition and therefore cannot extend the filesystem either.

 

If / is on a LVM logical volume and there is no separate /boot filesystem, I'd really want to know which bootloader you're using and how it's configured before answering.

 

MK
Sreer
Valued Contributor

Re: To resize the / partition in Redhat Linux 5.4

Hi Mk & All,

 

Happy new year 2012!

 

MK ..thnaks for help..

 

Still iam new to Linux  so my querries may be bad :-(

 

I guess the /boot & /  are seperate partitios!

 

root @server1:~# df -h /
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/RootVol-LogVol00
                      6.0G  5.6G  105M  99% /


root @server1:~# df -h /boot
Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p1     124M   11M  107M  10% /boot
root @server1:~#


root @server1:~# fdisk -l

Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes
255 heads, 32 sectors/track, 35132 cylinders
Units = cylinders of 8160 * 512 = 4177920 bytes

           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d0p1   *           1          32      128488+  83  Linux
Partition 1 does not end on cylinder boundary.
/dev/cciss/c0d0p2              32       35131   143203410   8e  Linux LVM
root @server1:~#

 

So hope we can extend the file system?

 

Rgds

Sree

Matti_Kurkela
Honored Contributor

Re: To resize the / partition in Redhat Linux 5.4

Yes, according to your df -h outputs, they are separate partitions.

 

Now run "vgs" to see if the RootVol VG has any unallocated space (= VFree is not zero in the output). If it has, you can extend the / LV immediately.

 

If VFree is zero for the RootVol VG, then you'll need to add another PV to the VG first (pvcreate <new_disk>; vgextend RootVol <new_disk>).

 

Here are the commands you'll need for the actual resizing: just replace <new_size> with a sensible value.

 

lvextend -L <new_size> /dev/mapper/RootVol-LogVol00
resize2fs /dev/mapper/RootVol-LogVol00

 

MK