1826203 Members
2957 Online
109691 Solutions
New Discussion

Extending logical Volume

 
SOLVED
Go to solution
Hanwant Verma_1
Regular Advisor

Extending logical Volume

I have a one volume group named /usr2 in HP UX 11.11 whihc is 74% full. How can i extend this volumet group?
15 REPLIES 15
Alex Lavrov.
Honored Contributor

Re: Extending logical Volume

lvextend -L /dev/vgXX/lvolXX

fsadm -b /usr2

to modify FS online, you have OnlineJFS to be installed.


Alex.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Alan Meyer_4
Respected Contributor

Re: Extending logical Volume

without OnlineJFS, you'll need to unmount the filesystem to extend it.
" I may not be certified, but I am certifiable... "
Hanwant Verma_1
Regular Advisor

Re: Extending logical Volume

Can you tell me the exact process, step by step please.
Alan Meyer_4
Respected Contributor

Re: Extending logical Volume

# fuser /usr2

This will give you the processes which are accessing /usr2 and they will need to be shutdown.

Then
# bdf /usr2

Notice the first column which tells you the logical volume information

# umount /usr2

# lvextend -L /dev/vgXX/lvolXX

where /dev/vgXX/lvolXX matches the logical volume information retreived from the bdf.

# fsadm -b /usr2

# mount /dev/vgXX/lvolXX /usr2

Or if /usr2 is in the /etc/fstab file, you can issue a "mountall" command which will then do fsck on the new filesystem and also mount the filesystem with proper switches too.
" I may not be certified, but I am certifiable... "
Alex Lavrov.
Honored Contributor

Re: Extending logical Volume

Actually I did ....

If you want to do it without OnlineJFS:

lvextend -L /dev/vgXX/lvolXX
umount /usr2
extendfs /dev/vgXX/rlvolXX
mount /usr2


Done.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
john kingsley
Honored Contributor
Solution

Re: Extending logical Volume

identify the lvol associated with /usr2:
# bdf | grep usr2

Check to see how much free space there is in usr2's volume group:
# vgdisplay /dev/

extend logical volume:
# lvextend -L /dev//

Find out if you have OnlineJFS:
# swlist -l fileset | grep -i onlinejfs

With OnlineJFS:
# fsadm -b $((*1024)) /usr2

Without OnlineJFS:
- Stop all process accessing /usr2
# umount /usr2
# extendfs /dev//
# mount /usr2

Alan Meyer_4
Respected Contributor

Re: Extending logical Volume

oops my fsadm line should be;

extendfs /dev/vgXX/rlvolXX
" I may not be certified, but I am certifiable... "
Hanwant Verma_1
Regular Advisor

Re: Extending logical Volume

umount gives me the following error

umount: cannot unmount /usr2 : Device busy
john kingsley
Honored Contributor

Re: Extending logical Volume

You have to kill all of the process accessing /usr2.

Run:
fuser -cu /usr2

This will give you the list of processes using /usr2.
Helen French
Honored Contributor

Re: Extending logical Volume

If you have an active Database or files source/user data exists on this file systems, I wouldn't recommend unmounting the FS now. If there is no user interaction on this FS, you can safely unmount it. Also make sure that you are not in that directory (cd /).

I would also suggest having a fresh backup of the file system you are trying to change and make sure you have enough free PEs (vgdisplay -v vg_name) on the volume group. Btw, extending a volume group and logical volume is totally different. I guess you are talking about exteding your LV here.
Life is a promise, fulfill it!
Hanwant Verma_1
Regular Advisor

Re: Extending logical Volume

Can i restart the server in sigle user mode and then follow the process, to be at safer side?
john kingsley
Honored Contributor

Re: Extending logical Volume

If you have a lot of process running that use this filesystem, it would be a good idea to restart you system into single user mode to do this. That way, you're guarantee that everything comes down cleanly. In single user, your paths may not be set correctly, so you may have to run /sbin/extendfs
Alan Meyer_4
Respected Contributor

Re: Extending logical Volume

single user is always safer for these things...
" I may not be certified, but I am certifiable... "
Helen French
Honored Contributor

Re: Extending logical Volume

If you can reboot the server without any user interruptions, I would say that's the safe case. Once rebooted, you can mount the root volumes (mount -a) from vg00 and then try running the LV extend commands.
Life is a promise, fulfill it!
Hanwant Verma_1
Regular Advisor

Re: Extending logical Volume

Thanks everyone, i have extended the volume group in single user mode successfully.