Operating System - HP-UX
1834150 Members
2059 Online
110064 Solutions
New Discussion

How to extend an LV while its mounted?

 
Ihab Zaki
Advisor

How to extend an LV while its mounted?

Hello,

Is there a way to extend the size an LV while is mounted?
The VG is mirrored and Strict allocation policy is on.

Bob
8 REPLIES 8
Volker Borowski
Honored Contributor

Re: How to extend an LV while its mounted?

Hi,

well you can extend any lvol while it is mounted. If you have online JFS installed, you can even increase the filesystem in it while the filesystem ist mounted.

Instead of "extendfs" you have to use "fsadm" in this case.

To find out, if you have Online JFS installed, use "swlist".

Hope this helps
Volker
Ihab Zaki
Advisor

Re: How to extend an LV while its mounted?

Yes, I have online JFS installed.

Can I just use lvextend.

Thanks,
Bob
Robert-Jan Goossens
Honored Contributor

Re: How to extend an LV while its mounted?

Hi Bob,

If you have online jvs,

# lvextend -L xxx /dev/vgxx/lvolx
xxx = size in MB
# fsadm -F vxfs -b yyy /mountpoint
yyy = KB (xxx * 1024)

Hope this helps,
Robert-Jan
Marco Santerre
Honored Contributor

Re: How to extend an LV while its mounted?

Hi,

You can extend a logical volume any time you want as long as the Volume Group is active.

If you want to extend the file system while it is mounted, you need to have JFS Online installed. If you do, then you can use the fsadm command.

#lvextend -L nnnn /dev/vgname/lvname [/dev/dsk/diskname]
#fsadm -b nnnnnnnn /mountpoint
Cooperation is doing with a smile what you have to do anyhow.
Leif Halvarsson_2
Honored Contributor

Re: How to extend an LV while its mounted?

Hi,
The bad news is that Online JFS is not free, you need to buy one license for each host.
Ivan-Ho
Frequent Advisor

Re: How to extend an LV while its mounted?

Hi,

Use these command to extend mounted LV:

- umount /mount_point
(If cannot umount, use fuser -cu /mount_point

and then kill -9 PID)

- lvextend -L newsize /dev/vg##/lvol#

- extendfs -F type /dev/vg##/rlvol#

- mount /dev/vg##/lvol# /mountpoint

Goodluck.
hung_phanduc
Sunil Sharma_1
Honored Contributor

Re: How to extend an LV while its mounted?

Hi,

If you have Online JFS installed you can do it,

#lvextend
#fsadm

if you are using Veritas volume manager insted, you can use

#vxresize

with appropriate options

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***
Mark Grant
Honored Contributor

Re: How to extend an LV while its mounted?

Ummm, well, though you can generally increase the size of a logical volume online regardless of wether you have OnlineJFS or not, you may well not be able to do it when it is set to strict/contiguous as it seems you have.

When it is strict/contiguous, there must be free extents immediatley following those that belong to the logical volume in question. in most cases, this isn't possible.

If the logical volume doesn't actually need to be contiguous, you can change the police with "lvchange -C n" and then you should be able to extend it assuming you have free extends anywhere in the volume group (and assuming the mirror can extend and yet still be on a seperate disk).

If the logical volume needs to be contiguous and there is a logical volume straight after it, you will have to start moving logical volumes around to make space and this is goinf to give you significant trouble if doing it online.
Never preceed any demonstration with anything more predictive than "watch this"