1840255 Members
2755 Online
110162 Solutions
New Discussion

Increasing size of /opt

 
SOLVED
Go to solution
Vinayak
Occasional Advisor

Increasing size of /opt

I have no space left in /opt and want to increase the size.I have a unused HARD DISk .Can i use this to increase space in /opt without loosing the existing data in /opt?
Thanks in advance.
Vinay
8 REPLIES 8
Lasse Knudsen
Esteemed Contributor
Solution

Re: Increasing size of /opt

Yes you can do that.

Use sam for this

Extend your volume group (vg00) with the new disk, and then extend your /opt filesystem.

You need to kill all running processes making use of /opt if you do not have then "Online JFS" product.

Just do "fuser -c /opt" to obtain PID's
In a world without fences - who needs Gates ?
Andreas Voss
Honored Contributor

Re: Increasing size of /opt

Hi,

yes that is possible.
My suggestion:
Create LVM info to the unused disk: pvcreate -f /dev/rdsk/c?t?d0
Add the unused disk to vg00: vgextend vg00 /dev/dsk/c?t?d0
Move the extents to the new disk: pvmove -n /dev/vg00/lvol? /dev/dsk/c??t??d0 /dev/dsk/c?t?d0
(/dev/dsk/c??t??d0 is the existing disk at vg00 and /dev/dsk/c?t?d0 is the new disk)
Increase the logical volume: lvextend -L vg00 /dev/dsk/c?t?d0
Next is to unmount /opt. This can be difficult because no proccess has to be on this filesystem. check with fuser /dev/vg00/lvol?
Or boot into single user mode.
Umount /opt: umount /opt
Extend the filesystem: extendfs -F /dev/vg00/rlvol?
fs_typ can be either hfs or vxfs, check with:
fstyp /dev/vg00/lvol?
Remount /opt:
mount /opt

Of course you can also create a new vg with your unused disk but pvmove cannot move across vg's.

Regards
Vinayak
Occasional Advisor

Re: Increasing size of /opt

Hi,
Thanks for the answers.
Even I want to increase size of /usr,which has sam executable and pvmove . Can I increase the size of /usr also?
Regards
Vinay
James R. Ferguson
Acclaimed Contributor

Re: Increasing size of /opt

Hi:

In addition to the suggestions already given, divide and conquer. You could create a new mount point on your unused disk which represents some large subdirctory of /opt. /opt/perf can be a good choice if you are running and keeping large amounts of Glance/Measureware data.

To copy the data, do:

# cd /opt
# find . | cpio -pudlmv /opt/perf

...JRF...
Andreas Voss
Honored Contributor

Re: Increasing size of /opt

Hi,

for /usr i would do:
increase lvol: lvextend -L /dev/vg00/lvol? /dev/dsk/c?t?d0
Umount /usr OR boot into single user mode.
extendfs -F /dev/vg00/rlvol?
Remount /usr or boot into multiuser mode.
Then do: pvmove -n /dev/vg00/lvol? /dev/dsk/c??d??t0 /dev/dsk/c?d?t0
(you can use pvmove on the fly - no umount required).

Regards
Carlos Fernandez Riera
Honored Contributor

Re: Increasing size of /opt


/usr as / must be increased with reboot, and hpux -lm at ISL prompt, because there are some critical processes running.
unsupported
Vinayak
Occasional Advisor

Re: Increasing size of /opt

Hi,
Thanks for the answers.
Regards,
Vinayak
Vinay
Francesco_2
Occasional Contributor

Re: Increasing size of /opt

go in single user whit init 1
you can use fuser -kuc /opt, for kill all process of opt
then run SAM and increse size of opt
Francesco