Operating System - HP-UX
1834178 Members
2766 Online
110064 Solutions
New Discussion

Steps to increase the file system space /opt , /usr without rebooting in HP-UX

 
HP-UX Increasing the ro
Occasional Contributor

Steps to increase the file system space /opt , /usr without rebooting in HP-UX

Hello Guys,,

i would to increase the space without rebooting and in single usermode. Please tell me the steps to increase the filesystem..

warm regards,
Arun
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: Steps to increase the file system space /opt , /usr without rebooting in HP-UX

Shalom Arun,

If you have OnlineJFs

find some disk space. use vgextend to add new disk space to the volume group of /usr and /opt

lvextend the logical volume
use fsadm to expand the size.

If you don't have OnlineJFS
lvextend the logical volumes
umount the filesystems and run extendfs.

The problem you run into is /usr is probably in heavy use and its going to be very difficult to do due to open processes on /usr

Its much easier under the circumstances to schedule a downtime and do the work quickly during that window.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jeeshan
Honored Contributor

Re: Steps to increase the file system space /opt , /usr without rebooting in HP-UX

only online JFS can help you to do this without reboot the system.

Which OS version you are talking about?
a warrior never quits
chandra Sekhar_7
Frequent Advisor

Re: Steps to increase the file system space /opt , /usr without rebooting in HP-UX

Hi Arun,

First you can check online jfs is installed or not. If in case installed you can extend file system online other wise u can unmount the opt & usr file system then extend.
You Check free space in the volume group
#vgdisplay
if u have free space u can extend file system
#lvextend -L size required /dev/dsk/lvol(opt)
#extendfs -F vxfs /dev/dsk/vol1
#mount the file system.

Regards
chandra
Sagar Sirdesai
Trusted Contributor

Re: Steps to increase the file system space /opt , /usr without rebooting in HP-UX

Hi Arun.
If you want to increase the root FS . The Bellow steps would help
a. Login as root.
b. Find out a free disk / un mirror the rootvg and make that disk free.
c. find out the next logical volume after lvol3(assumed lvol3 is root)
d. pvmove that logical volume onto the newly added disk
[ pvmove -n /dev/vg00/lvol4 /dev/dsk/CURRENT /dev/dsk/NEW]
e. now you should be able to increase root filesystem to an additional `size_of_the_lvol4`.
f. pvmove the lvol4 back to root vg ( vg00)


Regards

Sagar
Steve Post
Trusted Contributor

Re: Steps to increase the file system space /opt , /usr without rebooting in HP-UX

Maybe you DON'T? Instead of increasing the size of /opt, maybe you could decrease its usage?

I've used this trick to save space until the next reboot. (or forever).
Find software that is very static and NOT used. You want to get rid of it. But you believe something would bust if you threw it away.

Copy it to a big utility disk.
Make a link from /opt to this copy.
Then swap the two names.

here is an example:
Let's say you have /bigdisk filesystem, and you have unused /opt/perl_64 because everyone is using /opt/perl.

mkdir /bigdisk/alt_opt

cd /opt

find perl_64 -print | cpio -pdumvc /bigdisk/alt_opt

ln -s /bigdisk/alt_opt/perl_64 /opt/perl_64a

verify the permissions and sizes of /bigdisk, /bigdisk/alt_opt, and /bigdisk/alt_opt/perl64_a.

Make sure no one is using /opt/perl_64.

cd /opt

Run these two commands very quickly.
mv perl_64 perl_64_old ;mv perl_64a perl_64

Now, /opt/perl_64_old is not used. You can confirm that via ps and fuser commands. Once you are sure, you can delete this data.
rm -r /opt/perl_64_old

Verify /opt/perl_64 still works even though it is really on /bigdisk.

Because /opt/perl_64 has been moved, perhaps the space saved will be enough for you.

Be careful with this concept. You want to know what you are moving. You want to be sure it is not in use.


Now that I have written this, please let me know if my advice is a bad idea or not. Experience has shown me it works. But perhaps I am just lucky? Those point assignments help tell other people if the tips are useful or not.