1855871 Members
11290 Online
104107 Solutions
New Discussion

Extending logical volume

 
SOLVED
Go to solution
Jagadesh
Frequent Advisor

Extending logical volume


Kindly help me out in extending the logcal volume (lvol2) under Volume group (vg00)
When i issue..
#vgdisplay

--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 3
Open LV 3
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 2500
VGDA 4
PE Size (Mbytes) 4
Total PE 2046
Alloc PE 803
Free PE 1243
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

I need to use all the free PE to extend lvol2 filesystem. How can i go about in doing the same.

Thanks in advance.
Jagadesh.S
6 REPLIES 6
Stefan Farrelly
Honored Contributor

Re: Extending logical volume

lvol2 in vg00 is primary swap. You wont be able to extend it easily as it must be contiguous disk space. Best thing to do is create a new lvol under vg00 (usually lvol9) and then add it in as secondary swap. Create the lvol, dont newfs it, simply add it to /etc/fstab;

/dev/vg00/lvol9 ... swap defaults 0 0

then issue the command; /usr/sbin/swapon -a

Now swapinfo will show the new swap area you have added.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Rajeev  Shukla
Honored Contributor

Re: Extending logical volume

Extending lvol1 and lvol2 is not possible online there are only 2 things you can do.
1. Either install secondary swap device instead on extending primary swap (lvol2)

2. Take a ignite backup and boot through the backup and change layout and choose different sizes of LV and restore the ignite.
Jeff Schussele
Honored Contributor

Re: Extending logical volume

Hi Jagadesh,

/dev/vg00/lvol2 is normally the primary swap/dump LV & as such it will not be able to be extended.
This is due to the fact that primary swap space needs to be contiguous. Since lvol3, lvol4, etc. were created after lvol2 creation, there will be no way to keep lvol2 contiguous upon extension.

If you need more swap space then you'll need to use another disk device & create a secondary swap area. This is acceptable & it's going to be the only way to increase swap space.

If you need more dump space same thing applies. Use another device & setup the extra dump space.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
aparna challagulla
Valued Contributor

Re: Extending logical volume

Hi Jagadesh,

If u have onlineJFS installed then you can extend lvol2 online else u will have to unmount the filesystem on lvol2 and then do an lvextend and extendfs to extend the lvol and the filesystem respectively and then mount the filesystem again.

sam -> Disks And File Systems -> Logical volumes

HTH
aparna

If you don't have time to do it right you must have time to do it over
aparna challagulla
Valued Contributor

Re: Extending logical volume

hi again,

sorry i messed up with my answer. from the time i said reply and then submit u already have the best advice available.( got delayed with my boss shouting at me and then i didnt read the question correctly)
sorry again.:(
still thinking about the scolding.
aparna

If you don't have time to do it right you must have time to do it over
Brian Lee_4
Regular Advisor
Solution

Re: Extending logical volume

You cannot increase /dev/vg00/lvol2 file system online.
Take the following procedure.

1) vi /etc/fstab and put "#" in front of /dev/vg00/lvol2 file system

2) reboot the server
3) remove swap file system
# lvremove /dev/vg00/lvol2
4) recreate new swap file system
# lvcreate -L xxxx -n lvol2 /dev/vg00

5) activate swap file system
# swapon /dev/vg00/lvol2

6) vi /etc/fstab and remove "#" in fron of /dev/vg00/lvol2
brian lee