Operating System - HP-UX
1833757 Members
2829 Online
110063 Solutions
New Discussion

Increasing the size of /opt

 
SOLVED
Go to solution
Vinesh Dhevcharran
Occasional Advisor

Increasing the size of /opt

Hi,

We have root and opt on different logical volumes but both belong to vg00.

I want to install ignite but I do not have any more space in /opt. I have space to add to the opt logical volume but this is the problem!!!

My plan to do this is to comment the /opt from the fstab and reboot the machine to run level 1. This will result in the /opt file system not being mounted. I can then add additional space to the opt logical volume, and boot to the default run level.

Is my plan okay or do you have a better suggestion?

Many Thanks
Vinesh
8 REPLIES 8
Stefan Farrelly
Honored Contributor

Re: Increasing the size of /opt


As its only ignite your installing you could instead create a symlink in /opt called ignite pointing to another filesystem where you have space. Then you dont need to increase /opt. We do this ocassionally if we dont want a reboot and its only non critical software youre installing.

Your plan to increase opt above is fine as long as you have free space in vg00 and when you extendfs it you should reboot it after instead of changing run level (after uncommenting if from fstab).
Im from Palmerston North, New Zealand, but somehow ended up in London...
Chuck J
Valued Contributor

Re: Increasing the size of /opt

Yep, or if you still want to increase opt. There are two main ways depending on if you have onlineJFS or not:

Before you start do a:
# bdf
to check the space

A)
* If you have onlineJFS you can just go into SAM and increase /opt online without booting into single user mode.
* or via the command line:

# lvextend -L 800 /dev/vg00/lvolxx
(800 is the TOTAL size you want in mb)
# fsadm -F vxfs -b 900m /opt

B)
# shutdown -ry 0
When the system is coming up it will prompt you to boot into single user mode, so do this. Specify yes to interact with ISL.
# lvextend -L 800 /dev/vg00/lvolxx(800 is the TOTAL size you want in mb)
# extendfs /dev/vg00/lvolxx

Now you can go back into multi-user:

# init 3

Do a:
# bdf
to check space

Chuck J
Michael Tully
Honored Contributor

Re: Increasing the size of /opt

It can messy by having an additional logical volume mounted under /opt. If you have Online JFS this can be done on the fly. (extending /opt) If not why not wait until you get a maintenance window to do this. (Your choice)
Anyone for a Mutiny ?
John Bolene
Honored Contributor

Re: Increasing the size of /opt

Online JFS by all means, but it does cost some dinero.

A free, but it takes some outage time is to taje an ignite backup and restore it.

During the restore you can change the disk allocations.
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
T G Manikandan
Honored Contributor

Re: Increasing the size of /opt

you are right.

If you have space in vg00 and if you do not have the online jfs bundle installed you can boot through the single user mode and increase the file system.
make sure you mount your /usr file system so that the commands are available.

Else
if you have online jfs then

$ /usr/sbin/swlist -l product | grep -i jfs

you can just do
# lvextend -xxxxL /dev/vg00/lvol?
# fsadm -F vxfs -b xxxxxx /opt

Thanks
Shannon Petry
Honored Contributor
Solution

Re: Increasing the size of /opt

Boot into single user mode to increase /opt. Just note the lvol name and device file.

% reboot

Press space to interrupt the boot sequence.

at menu type,

boot pri

When asked it you wish to interact type,
y

at the ISL prompt type,
ISL> hpux -is

This will boot you into single user mode. Run lvextend. Note the #### after the -L option is for the new size in megabytes. Also use the raw lvol.

# lvextend -L #### /dev/vg00/rlvol#
or for 1024MB in /opt and lvol06

# lvextend -L 1024 /dev/vg00/rlvol6

Next, extend the filesystem and again use the raw device file.

# extendfs /dev/vg00/rlvol#
for lvol6
# extendfs /dev/vg00/rlvol6

Now run mountall and ensure that new space is there and available.

Reboot again and let system boot normally. Should be done.

Regards,
Shannon
Microsoft. When do you want a virus today?

Re: Increasing the size of /opt

Vinesh,

The best way is to use fsadm if you have Online JFS installed in the system. Otherwise, you can boot the system in single user mode. /opt does not get mounted when you boot the system in single user mode so there's no need to comment that out from /etc/fstab.

Once the system is in single user mode.

# mount /usr
# mount /tmp
# mount /var
# mount /var/tmp ( if /var/tmp is a separate fs )

Now you can extend the fs size for /opt.

-Venkat
Experience is the Best Teacher
Remote Systems Support
Occasional Advisor

Re: Increasing the size of /opt

A way to extend a file, like /opt, without having to go to single user mode, is to put the extendfs command in your /sbin/bcheckrc file.
Then, a simple reboot completes the job.

So:
With /opt mounted, do your lvextend.

Then vi /sbin/bcheckrc (after making a backup copy) and add the mount/umount/extend lines shown below the fi statement:

#*********************************************************************
# Activate LVM volume groups.
# Each logical volume will be activated according to its mirror
# consistency recovery policy.
#*********************************************************************

if [ -x /sbin/lvmrc ]
then
echo "Checking for LVM volume groups and Activating (if any exist)"
/sbin/lvmrc
fi

## ADD THESE LINES ##
/sbin/mount /dev/vg00/lvol6 /opt
/sbin/umount /opt
/sbin/extendfs /dev/vg00/rlvol6 >/extend.log 2>&1

After you reboot, remove the lines you added to the /sbin/bcheckrc file.
testing is for wimps.....