1844022 Members
2616 Online
110226 Solutions
New Discussion

Re: Logical Volume Space

 
GBR
Regular Advisor

Logical Volume Space

Greetings,

I need some removing some space from one logical volume and adding it to another logical volume with my HP-UX box.

For example:
/dev/vg00/lvol3 is full
/dev/vg00/lvol4 is half full

Hence I need to extend the logical volume of lvol3 to share the remaining space in lvol4.

Can someone provide me the steps involved?

Thanks in advance,
GBR
7 REPLIES 7
Sandman!
Honored Contributor

Re: Logical Volume Space

You can't if the defaults were used for the VG00 lvols which would make lvol3 your "/" filesystem. The "/" fs needs contiguous allocation policy for its extents and so the only way to extend it would be thru Ignite. Basically boot, root and swap cannot be extended as they use the contiguous allocation policy i.e. their extents need to be contiguous and cannot be distributed arbitrarily throughout the VG.
Denver Osborn
Honored Contributor

Re: Logical Volume Space

You won't be able to do this if /dev/vg00/lvol3 is the root filesystem. Root has to be contiguous.

Ignite-UX can be used to resize the root filesystem. This will require downtime.

If you have root mirrored, it would be possible to resize and keep it contiguous... sorry, but I don't have enough time to put down the step by step process to do it. In a nutshell it would involve reducing lvol4 mirror from primary, reduce root mirr from alt. extend root, reduce lvol4 filesystem/lvol, then mirror them back.

depending on your confort level, ignite is the easy way to go.

hope this helps,
-denver
A. Clay Stephenson
Acclaimed Contributor

Re: Logical Volume Space

Unless you are at HP-UX 11.11 or up, don't even try it -- and you must have OnlineJFS.
Reducing the size of a filesystem before 11.11 was almost guaranteed to corrupt the filesystem.

1) Use fsadm -F nfs -b to specify a smaller size for the filesystem on lvol4.

2) Use lvreduce to reduce the size of lvol4.

3) Use lvextend to increase the size of lvol3.

4) Use fsadm -F nfs -b to specify a larger size for lvol3.

It would be wise to backup both filesystem first.

If you don't have OnlineJFS or at 11.0 or less then you must backup. Umount lvol4. lvremove lvol4. lvcreate lvol4 at a smaller size. Run newfs on lvol4; mount lvol4; and restore from backup. You can then umount lvol3; lvextend lvol3; extendfs lvol3; and mount lvol3.

All of these commands are documented in the man pages.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: Logical Volume Space

Oh, and by the way, if this is a typical HP-UX system then lvol3 is / and must be contiguous so the only supported way to increase / is to Ignite your system after doing a make_tape_recovery or a make_net_recovery. If this is / and you need to expand / then almost certainly, you are doing something wrong. Once the system has run for just a little while, the size of / should be all but static.
If it ain't broke, I can fix that.
GBR
Regular Advisor

Re: Logical Volume Space

Okay thanks.

lvol3 and lvol4 were hypothetical. Say I'm not working with the root directory.

It is safe to use the VERITAS Enterprise Manager GUI?

And how do I know if I have OnlineJFS?

You help is much appreciated, thanks,
GBR
Mridul Shrivastava
Honored Contributor

Re: Logical Volume Space

Execute the following command and it will show you OnlineJFS if it is installed:

swlist -l product |grep -i jfs

It is not safe to reduce the size of a logical volume online as you might lose data, however increasing the size online is perfectly ok.

If you have to decrease size of a LV then recoomended way is to take backup of LV then reduce and restore back after that...
Time has a wonderful way of weeding out the trivial
GBR
Regular Advisor

Re: Logical Volume Space

Thanks.