Operating System - Linux
1828762 Members
3239 Online
109985 Solutions
New Discussion

How to extend VG and LVs in RHEL

 
SOLVED
Go to solution
Atul Gautam
Valued Contributor

How to extend VG and LVs in RHEL

Xperts,

Kindly help me......

"How can we extend VG and LVs in RHEL AS4 (Update3)".

I've tried "vgextend" and "lvextend". But this doesn't help me as I think I need to use "extendfs" as well. Please correct me and suggest me the steps as well.

Are there any complications in this and what parameters/steps do I need to keep in mind while doing that.



--
ATUL
8 REPLIES 8
Steven E. Protter
Exalted Contributor
Solution

Re: How to extend VG and LVs in RHEL

Shalom ATUL,

A volume group is extended onto a new disk.

I think examples will help here.

lets say i have a volume group that owns /dev/hdc1 the volume group is vg02

I want it to have a new disk I put in called /dev/hdd1

pvcreate /dev/dsk/hdd1
vgextend vg02 /dev/dsk/hdd1

Now I want to extend a filesystem called oradata form its current size 80 MB to 160 MB on the new disk

lvextend -L 160 /dev/vg02/oradata /dev/dsk/hdd1

Next extend the filesystem and we're done.

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
Ivan Ferreira
Honored Contributor

Re: How to extend VG and LVs in RHEL

The last step needed is resize the file system with ext2online or resize2fs:

umount /filesystem
resize2fs /filesystem
mount /filesystem


OR

ext2online -d -v /filesystem
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Morcos
Super Advisor

Re: How to extend VG and LVs in RHEL

Hi Atul,

After doing vgextend and lvextend, you have to run ext2online, for ex:
ext2online /dev/TestVG/TestLV

After I prefer to run e2fsck to Check the file system integrity after the resize.

Ziad
Atul Gautam
Valued Contributor

Re: How to extend VG and LVs in RHEL

So Xperts,

If I summarize all the points then ----

1) pvcreate /dev/dsk/hdd1
2) vgextend vg02 /dev/dsk/hdd1
3) lvextend -L 160 /dev/vg02/oradata /dev/dsk/hdd1
4) umount /filesystem
5) resize2fs /filesystem
6) mount /filesystem
OR
6) ext2online /dev/TestVG/TestLV


Kindly correct me if I'm wrong.


--
ATUL
Ivan Ferreira
Honored Contributor

Re: How to extend VG and LVs in RHEL

Correct!
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Atul Gautam
Valued Contributor

Re: How to extend VG and LVs in RHEL

Thanks Ivan....

I will first try these steps and then if I'll be successful in what I wanna do...then I'll close this thread.

But thanks a lot for the kind help that I will continue receiving from this grrreat forum.



--
Atul
Alexander Samad
Frequent Advisor

Re: How to extend VG and LVs in RHEL

With the newer kernels you do not need to unmount the ext3 filesystem to resize.
Atul Gautam
Valued Contributor

Re: How to extend VG and LVs in RHEL

Thanks Xperts for ur valuable help....




Atul