Operating System - HP-UX
1833788 Members
2589 Online
110063 Solutions
New Discussion

Re: HOWTO increase the size of a Logical Volume

 
Raperswil
Occasional Advisor

HOWTO increase the size of a Logical Volume

Guys,
I need to install some patches, hence I need to increase the size of /var and /tmp.

BACKGROUND:
I have a 9GB disk on 1st channel and a 140GB disk on 2nd. I created one VOLUME GROUP (vg00) out of both of these. Filesystem is vxfs and VOLUME MANAGEMENT is LVM. For some reason the installer created:
/var = 3.5 GB
/tmp = 1 GB
/home = 30MB (ha ha)

I need to install some patches, so I need to increase the size of /tmp where I will UNTAR the patches to 5GB. /var I want to increase to 10GB. /home by 10GB.

Now to find what logical volumes map to which mount points, I issued 'bdf'.
/var ---> /dev/vg00/lvol6

I issued the foll:
A.
lvextend -L 300 /dev/vg00/lvol6
|
\---------> ? Size in MB / KB ?
Anyway this command completed OK.

B.
Now I need to issue extendfs
umount /dev/vg00/lvol6

error: this is in use (or some such msg)

How can I extend these partitions? How can I unmount them?

Also please let me know
A.
lvextend -L extends by MB / KB OR extends to x MB/KB.
B.
extendfs -f vxfs /dev/vg00/lvol6
Does this merely sync the extension on the physical leve.
C.
Lastly, I got lvextend right and did not extendfs /var. And shutdown my system? Will I run into troubles?

Thanks for your replies in advance.
TK
7 REPLIES 7
Sandman!
Honored Contributor

Re: HOWTO increase the size of a Logical Volume

Look into purchasing the OnlineJFS product so you can extend lvols online w/o unmounting them (boot, root and swap being the exceptions). lvextend(1M) will expand an lvol by MB...see the man page. Your sequence of steps is incorrect. For the right sequence of expanding an lvol is given in the extendsfs_vxfs(1M) manpage.
Raperswil
Occasional Advisor

Re: HOWTO increase the size of a Logical Volume

"Look into purchasing the OnlineJFS product so you can extend lvols online w/o unmounting them (boot, root and swap being the exceptions)."

Thanks for the info, but I am a home user, I won't be able to spend an more money.


" lvextend(1M) will expand an lvol by MB...see the man page."
Thanks. I am following Marty's HP-UX sysadmin handbook and toolkit.

" Your sequence of steps is incorrect. For the right sequence of expanding an lvol is given in the extendsfs_vxfs(1M) manpage."
OK, I will see the man page. Thanks.

Meanwhile any suggestion to work with what I have will be appreciated. Thanks
Torsten.
Acclaimed Contributor

Re: HOWTO increase the size of a Logical Volume

To extend LVOLs containing file systems like /var /usr or /opt you need to boot to single user mode, if you don't have onlineJFS installed.
Doing this, the file systems will remain unmounted, not busy.
Now you can do your lvextend and extendfs.
man pages are worth being read - you will learn all the details.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Torsten.
Acclaimed Contributor

Re: HOWTO increase the size of a Logical Volume

Good point to start:

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

(Managing Systems and Workgroups: A Guide for HP-UX System Administrators
- Chapter 6 Administering a System: Managing Disks and Files)

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Sp4admin
Trusted Contributor

Re: HOWTO increase the size of a Logical Volume

After all that was said above. The other option is to use an ignite tape to extend the lvol size. of course this would cause a reboot.

sp,
Tim Nelson
Honored Contributor

Re: HOWTO increase the size of a Logical Volume

Here is what I used to do when I ran out of room in /var for patches and did not want to rebuild the system.

cleanup -c 1 ( this cleans up superceded patches )

If that was not enough. Create new filesystem for /var/adm/sw copy all patch files to new filesystem. Delete the old and mount the new.

Cleanup all the unneeded junk in /var/(mail|adm|sam|tmp|... )

Remove all those uneeded software packages that are not required ( this would free up /opt )
MarkSyder
Honored Contributor

Re: HOWTO increase the size of a Logical Volume

Tim has given you the answer I would have given, but just in case you're unsure how to go about it:

1. create a new filesystem; e.g. /var/adm/sw.new

2. cd /var/adm/sw

3. find . -xdev -depth -print|cpio -pmd /var/adm/sw.new

4. cd /etc

5. cp -p fstab fstab.safe

6. vi fstab and swap /var/adm/sw with /var/adm/sw.new

7. reboot. When the server comes back up, the new filesystem will now be called /var/adm/sw and you have all the space you need for your patches.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing