Operating System - Linux
1752788 Members
6424 Online
108789 Solutions
New Discussion юеВ

RHEL AS 4 U 2. How to extend a file system online.

 
Amruth
Regular Advisor

RHEL AS 4 U 2. How to extend a file system online.

All,

I have a production database with a filesystem at 98%. I have another free 45Gb in the VG. I need to extend filesystem online without shutting down the instance.

VG Name prod01
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 12
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 11
Open LV 11
Max PV 0
Cur PV 1
Act PV 1
VG Size 135.67 GB
PE Size 4.00 MB
Total PE 34731
Alloc PE / Size 23040 / 90.00 GB
Free PE / Size 11691 / 45.67 GB
VG UUID ttztz1-AiM5-ofil-FOZl-fyPc-7yfO-A5xQWm

Any idea ?
If i am doing the same way you are doing to me then what is the difference between us.
7 REPLIES 7
Amruth
Regular Advisor

Re: RHEL AS 4 U 2. How to extend a file system online.

To make the question clear...i need extend a filesystem /tiger01 from 10 GB to 20GB.

Any help is appreciated.

Thanks!
If i am doing the same way you are doing to me then what is the difference between us.
Alpha977
Valued Contributor

Re: RHEL AS 4 U 2. How to extend a file system online.

Hello Amruth.

To resize the filesystem is necessary umount the filesystem.

I think is not possible to change the partition size without umount the fs.

Also you can create a new partition to the new disk and extend the tablespaces to the new partition.

Bye
Ivan Ferreira
Honored Contributor

Re: RHEL AS 4 U 2. How to extend a file system online.

You can do it online with the ext2online command. But I need the ouput of:

vgdisplay -v
df

You fist have to extend your logical volume that corresponds with the FS, for example

lvextend +2500 /dev/datavg/lvdata

This will increate the LV in 2500 Extends (2500*4M=10G).

The you need to resize the filesystem:

ext2online -d -v /mount_point_of_lvdata

Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Steven E. Protter
Exalted Contributor

Re: RHEL AS 4 U 2. How to extend a file system online.

Shalom,

Ivan's procedure is exactly how they teach it on the RHCE examination. It does work, so long as the lvextend succeeds.

This is one of the reasons why lvm is such a useful tool.

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
Pattabhi
Frequent Advisor

Re: RHEL AS 4 U 2. How to extend a file system online.

Probably this will help. Thi sis the exact procedure i followed.

[root@inlnx03 root]# vgdisplay
--- Volume group ---
VG Name datavg
VG Access read/write
VG Status available/resizable
VG # 0
MAX LV 256
Cur LV 1
Open LV 0
MAX LV Size 511.98 GB
Max PV 256
Cur PV 2
Act PV 2
VG Size 136.70 GB
PE Size 8 MB
Total PE 17498
Alloc PE / Size 12800 / 100 GB
Free PE / Size 4698 / 36.70 GB
VG UUID qY7jlS-Vcyl-6lvE-VRz2-fpsd-Q4NA-LmGXZl


[root@inlnx03 root]# e2fsadm -L101G /dev/datavg/datavol
e2fsck 1.32 (09-Nov-2002)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/datavg/datavol: 11/13107200 files (9.1% non-contiguous), 1658946/52428800 blocks
lvextend -- extending logical volume "/dev/datavg/datavol" to 101 GB
lvextend -- doing automatic backup of volume group "datavg"
lvextend -- logical volume "/dev/datavg/datavol" successfully extended

resize2fs 1.32 (09-Nov-2002)

Begin pass 1 (max = 6528)
Extending the inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Begin pass 2 (max = 204)
Relocating blocks XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Begin pass 3 (max = 6400)
Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Begin pass 5 (max = 6400)
Moving inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The filesystem on /dev/datavg/datavol is now 105906176 blocks long.

e2fsadm -- ext2fs in logical volume /dev/datavg/datavol successfully extended to 101 GB

phelixyrus
Occasional Advisor

Re: RHEL AS 4 U 2. How to extend a file system online.

Ivan's method will work. In fact, the file system must be mounted for the ext2online command to work. Additionally, ext2online can only be used to enlarge the file system (at this point anyway); it cannot shrink the file system.

Correct me if I'm wrong, but I believe that the e2fsadm command will only work when the file system is unmounted, and thus, will not work for the situation here. The e2fsadm command is basically a front-end for LVM and ext2 file system resizing commands (e.g. lvextend, lvreduce, resize2fs).
George Liu_4
Trusted Contributor

Re: RHEL AS 4 U 2. How to extend a file system online.

A typical lv/fsextend scenario, isn't it?