1834935 Members
2286 Online
110071 Solutions
New Discussion

Re: Extending /opt

 
Don Spare
Regular Advisor

Extending /opt

I need to install Java on my HP-UX 11.0 system. The information on the download says I need 100MB of disk space in /opt/java1.4/jre. My /opt filesystem only has 104339 KB free so I'm thinking I need to extend that lv/filesystem. The volume group (vg00) has 5056MB unused that I could extend into. And that brings me to my question:

How painful is it to extend /opt? I've extended other fileystems before but I seem to recall there are some restrictions on extending some filesystems on vg00.

Should I be able to use SAM to just extend the logical volume and the filesytem without destroying anything on /opt?????
8 REPLIES 8
MarkSyder
Honored Contributor

Re: Extending /opt

Personally, I would set up a new filesystem under /opt in its own logical volume (as indeed I did when I was in the same position).

/opt/java would appear to be a logical name. If you already have a directory called /opt/java, move everything to a safe place before you delete the directory then move it into the new filesystem.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Steven E. Protter
Exalted Contributor

Re: Extending /opt

Sure.

Sam will do it.

What sam will do is:

lvextend -L /dev/vg00/lvol_of_opt
umount /opt
extendfs -F vxfs /dev/vg00/rlvol_of_opt

the only possible obstacle is whats running on /opt.

You may want to do this manually after killing all processes on opt.

fuser -cuk /opt

This command might disrupt your production.

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
Robert-Jan Goossens
Honored Contributor

Re: Extending /opt

Hi Don,

Depends a bit on what is installed/running in /opt and if you have OnlineJFS installed.

If you don't have OnlineJFS you need to umount /opt. You can check with lsof what is running on /opt and what you need to kill and restart after the filesystem extend.

# umount /opt
# lvextend -L size_MB /dev/vg00/lvolx
# extendfs /dev/vg00/rlvolx
# mount /opt
# bdf

HTH,
Robert-Jan
Jeff Schussele
Honored Contributor

Re: Extending /opt

Hi,

Since /opt doesn't have any contiguous requirements and if you have free space in vg00 then by all means you can extend it.
If you don't have any free space in vg00 then you'll have to add another PV to the vg00 VG to extend /opt.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Pete Randall
Outstanding Contributor

Re: Extending /opt

Don,

Your main problem will be the requirement to unmount /opt. Generally, the easiest thing to do is to boot into single user mode, run mount -a, then unmount /opt. From that point it's a trivial matter to run sam and increase the lvol/filesystem.


Pete

Pete
Marvin Strong
Honored Contributor

Re: Extending /opt

If /opt is vxfs and you have onlineJFS.

you can

lvextend -L newsize /dev/vg00/lvol4
fsadm -F vxfs -b new_fs_size /opt

Sanjay_6
Honored Contributor

Re: Extending /opt

Hi Don,

If you don't have onlineJFS, you need to reboot the system in single user mode to extend /opt unless you want to create an additional filesystem and mount it inder /opt/java or /opt/java1.4 depending on which version you are installing. Try this link below if you need to reboot and extend /opt.

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000072882493

The itrc doc id is KBRC00000204.

Hope this helps.

Regds
SS_6
Valued Contributor

Re: Extending /opt

You have around 5GB free in VG00 but make sure your both primary and mirror disks have equal free space which you need to extend /opt. With online JFS for example if you wish to increase /opt to new size of 3GB
#lvextend -L 3000 /dev/vg00/lvolxxx
#fsadm -F vxfs -b 3000M /opt

If you extend already mirrored filesystem, lvextend will take care of mirror copy extention automatically.
By providing solutions I am helping myself