Operating System - HP-UX
1847558 Members
3602 Online
110265 Solutions
New Discussion

Expanding /opt and /usr on HP-UX 11.0

 
Muhammed Abass
New Member

Expanding /opt and /usr on HP-UX 11.0

Hi ,
I have installed HP-UX 11.00 and assigned only .75 GB for /opt and /usr . We were not exepcting to install all these software . I am running out of space on both now , although I have unused space on my disk . The issue is that the OS wil not allow me to unmount either of them to expand . As they need to be re-mounted after the increase . I am using SAM . Thnak you in advance .
8 REPLIES 8
Kurtkarl
Frequent Advisor

Re: Expanding /opt and /usr on HP-UX 11.0

Hi, try this

1 Backup Your /opt & /usr on tape
2 Identify the lvol name of these filesystem
ex. /dev/vg00/lvol7 1303305 552504
620470 47% /usr
/dev/vg00/lvol8 1332405 692404
230470 49% /opt
3 Reboot to single user mode.
note: unmount /usr and /opt if possible
ex. umount /opt
umount /usr
4 Execute lvextend -L NNN /dev/vg00/lvoln
ex. lvextend -L 500 /dev/vg00/lvol7
note: -L 500 actual size in mb.
do the same for /lvol8
5 Execute extendfs -F vxfs /dev/vg00/rlvoln
ex. extenfs -F vxfs /dev/vg00/rlvol7
do the same for rlvol8
6 Mount /opt and /var
ex. mount /opt
mount /usr
7 Restore from tape (if necessary)
8 Execute reboot.
ex. shutdown -ry 0

Just starting to learn thru this forum
Patrick Wallek
Honored Contributor

Re: Expanding /opt and /usr on HP-UX 11.0

Are /opt and /usr JFS/VxFS filesystems? If so, do you have the OnLine JFS product? If you answer yes to both of these, then you can expand your filesystems on the fly.

If not, then your best bet is the previous answer.
Jitendra_1
Trusted Contributor

Re: Expanding /opt and /usr on HP-UX 11.0

Another way. Since this is a new install , you may want to reinstall the system with the correct sizes. Still better make a make_recovery tape and recover from it. While recovering interrupt the boot and increase the sizes of /opt and /usr.
Learning is the Key!
Rita C Workman
Honored Contributor

Re: Expanding /opt and /usr on HP-UX 11.0

You have a couple choices, depending on what you have. If you just installed 11.0 then you may not have all your software loaded...like Online JFS. So, if you have Online JFS, you can load that first and then expand your file systems using it on the fly..just do the lvextend on each filesystem like usual than do:
fsadm -F vxfs -b /filesystem
...OR...
And this is what I have done at times...
At this point I rebooted to strictly single user, since nothing is really mounted at that point and then I extend all the filesystems the way I wanted, mounted them to check that they looked good...even went in and edited the /etc/fstab...and then rebooted. At this point I could then loadup all the rest of software and patches, etc.

/rcw
John Robben
Advisor

Re: Expanding /opt and /usr on HP-UX 11.0

This procedure works for me. Your mileage may vary, of course.

-----

Determine volume group, logical volumes, and availability of free space:

grep /opt /etc/fstab
/dev/vg00/lvol4 /opt vxfs delaylog 0 2

grep /usr /etc/fstab
/dev/vg00/lvol6 /usr vxfs delaylog 0 2

vgdisplay -v vg00 | grep 'PE Size'
PE Size (Mbytes) 4

vgdisplay -v vg00 | grep 'Free PE'
Free PE 894

(894*4096=3,661,824 MB Free)

Procedure:

shutdown -ry 120
Interrupt boot process when prompted
enter bo
enter yes
ISL> hpux -lm
vgchange -a y vg00
lvextend -L /dev/vg00/lvol4
extendfs -F vxfs /dev/vg00/rlvol4
lvextend -L /dev/vg00/lvol6
extendfs -F vxfs /dev/vg00/rlvol6
reboot
Steve Post
Trusted Contributor

Re: Expanding /opt and /usr on HP-UX 11.0

Go to single user mode to unmount /opt and /usr. And when I say that, I mean turn off the power, interrupt the boot process, interact with the ISP, and boot to single user mode there. Only then you can unmount the filesystems to expand them. At least that's the only way I could do it, with hp support on the phone.

Re: Expanding /opt and /usr on HP-UX 11.0

Hi Abbas,

Use the following procedure :

# init 1

# fuser -k /dev/vg00/lvol?
# umount /usr
# fuser -k /dev/vg00/lvol?
#umount /opt
# lvextend -L /dev/vg00/lvol?
#lvextend -L < new size> /dev/vg00/lvol?
# mount -a
# init 4
Note: For checking the logical volume # of /usr and /opt use bdf command.

I hope it will works.

Thanks
Amir
Joseph C. Denman
Honored Contributor

Re: Expanding /opt and /usr on HP-UX 11.0

1. Determine how much space is available on vg00.
2. Determine the size you need for /usr and /opt. If size of vg00 is sufficient, Johns example will be fine. If not, you will need to put one or both filesystems in a different vg eg..vg01. The below example shows how to move /opt to vg01.

boot to single user mode
vgchange -a y vg00
vgchange -a y vg01
mount /usr
mount /opt
lvcreate -L (newsize_MB) -n lvol6 /dev/vg01
newfs /dev/vg01/rlvol6
mkdir /new_opt
mount /dev/vg01/lvol6 /new_opt
cd /opt
find . | cpio -pdmuxvl /new_opt
ensure all files are copied
umount /new_opt
rmdir /new_opt
modify /etc/fstab (make /opt point to the new vg and lv)
reboot

You can do this with /usr as well

Joe.....
If I had only read the instructions first??