Operating System - Linux
1754823 Members
4387 Online
108825 Solutions
New Discussion юеВ

Re: Need to extend file system Online

 
Sreer
Valued Contributor

Need to extend file system Online

Hi Gurus,

I need to extend my /loca/opt FS online.

am not sure about the fs extension in Linux .

Version is => Red Hat Enterprise Linux Client release 5.4

root @psp-adoc-01:/local/opt# cat /etc/*release
Red Hat Enterprise Linux Client release 5.4 (Tikanga)
root @psp-adoc-01:/local/opt# df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/DataVol-LogVol04
30G 26G 2.4G 92% /local/opt
root @psp-adoc-01:/local/opt#

root @psp-adoc-01:/local/opt# mount | grep -i /local/opt
/dev/mapper/DataVol-LogVol04 on /local/opt type ext3 (rw)
root @psp-adoc-01:/local/opt#


It is using ext3 .

I heard that we cant extend fs in Linux even though the FS is of ext3? Is it so?

Pls help me to proceed on this extension.
many thanks in advance.

Rgds
Sree
2 REPLIES 2
Matti_Kurkela
Honored Contributor

Re: Need to extend file system Online

You're using LVM, so extending the filesystem is very simple if the volume group has free space available.

Run "vgs" as root and look at the line for volume group DataVol. If the VFree column indicates there is free space, you can use lvextend to extend the LV, then resize2fs to extend the filesystem within the LV. This can be done on-line.

For example, to extend your filesystem by 10 gigabytes:

lvextend -L +10G /dev/mapper/DataVol-LogVol04
resize2fs /dev/mapper/DataVol-LogVol04

If "vgs" indicates there is no free space in the DataVol VG, you must first add a new disk/LUN to the system, then use pvcreate to make it a LVM physical volume, and add it to the DataVol VG using vgextend. Then you can use the procedure above to extend the filesystem.

For example, to add /dev/sdXX to your volume group:

pvcreate /dev/sdXX
vgextend DataVol /dev/sdXX

MK
MK
Alzhy
Honored Contributor

Re: Need to extend file system Online

Sree,

An alternative to Matti's if you'er uncomfy with Command Line is to use the GUI:

system-config-lvm


You need to have the Graphics NEnvironment up though or set up VNC or EXceed, REflection-X, etc.
Hakuna Matata.