Operating System - HP-UX
1834232 Members
2406 Online
110066 Solutions
New Discussion

How to extend a Logical Volume

 
amreek bansal
Frequent Advisor

How to extend a Logical Volume


Hi Guys, Can you help me omn this one please.

I'm trying to find the steps needed to extend a existing Logical Volume.

The full background is that we have a database HP-UX server, which currently has no free disks to expand the logical volume. As its connected to EMC SAN, we are allocating some disk space i.e 100gb to the server and hope to extend the logical volume.

Does the logical volume need to be unmounted to extend the logical volume?

Can someone explain the steps required to extend the LV ?

Thanks.
Amreek.
25 REPLIES 25
James R. Ferguson
Acclaimed Contributor

Re: How to extend a Logical Volume

Hi:

If you don't have any "free disks" and no remaining free disk extents in the volume group in which the logical volume resides, you will need to 'pvcreate' a new physical volume; then 'vgextend' it into the volume group; 'lvextend' the logical volume; and lastly 'fsadm' or 'extendfs' the filesystem.

If you have Online JFS you do not need to unmount the filesystem to enlarge it and you use 'fsadm' to do so. If you don't have Online JFS (doubtful, I hope) then you must unmount the _filesystem_ to enlarge it with 'extendfs'.

You might want to read/review:

http://docs.hp.com/en/B2355-90950/ch06.html

Regards!

...JRF...
Sunny123_1
Esteemed Contributor

Re: How to extend a Logical Volume

Hi

If you have onlineJFS installed then you can do it online

lvextend -L

fsadm -F vxfs -b M f/s name.

Regards
Sunny
amreek bansal
Frequent Advisor

Re: How to extend a Logical Volume


Sorry if this is a silly question, but how do I check if JFS Online is installed ? Thanks.
Suraj K Sankari
Honored Contributor

Re: How to extend a Logical Volume

Hi,
>>how do I check if JFS Online is installed.

swlist -l product | grep -i online

Suraj
amreek bansal
Frequent Advisor

Re: How to extend a Logical Volume

suraj, running that command returned no output, so i guess online JFS is not installed then ?
amreek bansal
Frequent Advisor

Re: How to extend a Logical Volume

Sorry, correction!, was running it incorrectly, it has showed onLineJFS01
Sunny123_1
Esteemed Contributor

Re: How to extend a Logical Volume

Hi

Then you can do that as told in previous forum.


Regards
Sunny
amreek bansal
Frequent Advisor

Re: How to extend a Logical Volume

ok will do, I understand the first 2 parts of "pvcreate" the new disks and adding them into volume group, could some one just clarify the commands for extending the logical volume part and using the "fsadm" commands please?

Thanks Alot
Sunny123_1
Esteemed Contributor

Re: How to extend a Logical Volume

Hi

lvextend -L

fsadm -F vxfs -b M f/s name.

Regards
Sunny
Aryan
Advisor

Re: How to extend a Logical Volume

Hi,

"fsadm" is a file system administration command...thats it... Sunny already explain abt the steps...

Regards,
Aaryan
subodhbagade
Regular Advisor

Re: How to extend a Logical Volume

Hi,


(A)

if online JFS install then no need to umount the FS, use cmd as
fsadm -F vxfs -b M f/s name

(B) If online JFS are not install then :--
stepas are

(1) Make sure no SAP or any other appliction running on the server which make device busy.
(2) fuser -cu /mount point
(3)fuser -ku /mount point
(3) if still device is busy then
kill the pid
(4)umount /dev/vgname/lvol
(5)lvextend -L final size in mb /dev/vgname/lvol

if your current lv size is of 512 and you have to add 512 mb then you have to specify
final size as 1024 mb.

(6)extendfs -F vxfs /dev/vg/rlvol

(7)mount /dev/vg/lvol /mount point

(8) check with bdf.

Regards,
Subodh.

amreek bansal
Frequent Advisor

Re: How to extend a Logical Volume


Guys, Can someone just clarify a point with the following commands


"lvextend -L

fsadm -F vxfs -b M f/s name."

The current filesystem is 1.5 TB and am extnding it with another 200Gb, so the commands above state , is this the total size or the extra size (i.e 200gb), as I would ideally like to put the 200gb into these commands, can someone please advise ?

Thanks ..
Vivek Bhatia
Trusted Contributor

Re: How to extend a Logical Volume

Hi Amreek,

"lvextend -L
YEs this is the total size

Regards,
Vivek Bhatia


Vivek Bhatia
Trusted Contributor

Re: How to extend a Logical Volume

Hi Amreek

Sorry forgot to mention this one.

fsadm -F vxfs -b M f/s name."
And this is also a total size.

Regards
Vivek

and always assign points to people who reply to your question.
amreek bansal
Frequent Advisor

Re: How to extend a Logical Volume


Ok, thanks. I just wondered if it could be done like this ??

i.e. fsadm -F vxfs -b +200G /app

It just would be easier with the numbers.



p.s I would assign points shortly aswell.
Ganesan R
Honored Contributor

Re: How to extend a Logical Volume

Hi Amreek,

You should specify the total size of the filesystem(Not the additional size being added) in MB with -b option like this.

fsadm -F vxfs -b 1253376M /app

(Your case is 1.5TB+200GB)
Best wishes,

Ganesh.
Ganesan R
Honored Contributor

Re: How to extend a Logical Volume

Hi,

Correction in the size. Total size in MB on your case (1.5TB+200GB) would be 1765376M.
Best wishes,

Ganesh.
Vivek Bhatia
Trusted Contributor

Re: How to extend a Logical Volume

Hi Amreek,

Have a look at the commands which you have to use.

#lvextend -L 1782579M

#fsadm -F vxfs -b 1782579M /mount_point

Regards,
Vivek
Sajjad Sahir
Honored Contributor

Re: How to extend a Logical Volume

Dear Amreek

u are asking how to extend the logical volume. u are saying there is no space in u volume group, so first u have to extend the volume group
vgextend /dev/vg03 c#t#d#

then extend the logical volume

lvextend -L 2048 /dev/vg03/lvname

once u extended the logical volume, u can extend the size of the file system

if u have online jfs u can extend without umount the mount point other wise u have to umount it

u can find out online jfs is installed or not by using the command

swlist -l product | grep -i jfs

where i is using for ignore the case

once u found online jfs is there

extend the file system by using fsadm

fsadm -b 2048*1024 /mnt1(mount point)

if online jfs is not there umount the file system first

then extend the file system by using
extendfs

thanks and regards

sajjad sahir
Taifur
Respected Contributor

Re: How to extend a Logical Volume

Hi Amreek,

If you have online jfs installed than you can do it by fsadm

check man pages of fsadm
also check #swlist -l fileset online

otherwise
#umount /mountpoint
#lvextend -L
#extendfs -F vxfs
#mount /mountpoint

Rgds//
Taifur
kapil wanjari
New Member

Re: How to extend a Logical Volume

Hi,

Some examples in this document may be help you out...

Regards,
Aaryan
amreek bansal
Frequent Advisor

Re: How to extend a Logical Volume


Thanks alot for all your help guys, appreciate it. I have completed the extension now, all looks akay, the filesystem has increased 200gb as expected. One thing was curious if any one had a though on, I thought extended a 1.5 TB filesystem would take hours ( lvextend amd fsdam) but these commands completed in a minute. Is this normal ?
Sunny123_1
Esteemed Contributor

Re: How to extend a Logical Volume

Hi

Of course it is normal.Check your logical volume is extended or not with bdf command.


Regards
Sunny
amreek bansal
Frequent Advisor

Re: How to extend a Logical Volume


yes its lv and filesyetm is extended as expected, just thought perhaps it would take longer running these commands on such a large filesystem.