1847872 Members
3098 Online
104021 Solutions
New Discussion

Re: extending /opt

 
SOLVED
Go to solution
amit mehta_2
Regular Advisor

extending /opt

Hi,

My /opt is almost full(92%),so i need to extend /opt and to do so i plan to go ahead with following steps:
1: First unmount /opt
$ umount /opt/

2: Add a physical volume to the vg00 VG.
$ pvcreate -f /dev/rdsk/

3:extend the VG(vg00)
$ vgextend /dev/vg00 /dev/dsk/

4:extend the logical volume
$ lvextend -L <10000> /dev/vg00/lvol6

5:extend the fs
$ extendfs -F vxfs /dev/vg00/rlvol6

6: mount the /opt back
mount /opt

But while trying to perform the first step(i.e. unmounting the /opt) i get the error message as:
umount: cannot unmount /dev/vg00/lvol6 : Device busy
umount: return error 1.

which means that some applications are using it.now to overcome this i've downloaded the lsof binaries and when i do lsof on /opt,i see that there are multiple processes which are using it."sshd", "pbx_excha" ,"cimserver" are to name a few.
root@pa1/var >/usr/local/bin/lsof /opt|wc -l
236

so how should i go about doing extending /opt ?

Thanks,
~amit
8 REPLIES 8
Pete Randall
Outstanding Contributor

Re: extending /opt

It's going to be quite difficult to terminate all the processes that are using /opt. Probably your best bet is to re-boot into single user mode, then mount /usr and then work on /opt.


Pete

Pete
Jeff_Traigle
Honored Contributor

Re: extending /opt

Since you don't have OnlineJFS, your best bet is to bring the system to single user mode. As you've discovered, there are lots of apps that run out of /opt when the system is in multiuser run levels.
--
Jeff Traigle
James R. Ferguson
Acclaimed Contributor
Solution

Re: extending /opt

Hi Amit:

If you have Online JFS (which I would hope) then you don't have to unmount the filesystem to modify its size.

That aside, the easiest way to handle your situation is to boot into single user mode. Since only '/' and '/stand' will be mounted, you can manually mount '/usr' or you can use the the commands in '/sbin' (e.g. '/sbin/extendfs') to perform your maintenance.

When done, reboot normally.

Regards!

...JRF...
DCE
Honored Contributor

Re: extending /opt



As Pete and Jefff stated, single user mode is your best bet for extending /opt.

Don't forget to add enough space for mirroring as well (if you have mirroring)

Ther is another way to extend /opt (and all of the other vg00 mount points) Take an ingnite image of the server, and do an interactive ignite restore. You will have a screen where you can resize any, or all of the mount points
Aussan
Respected Contributor

Re: extending /opt

if you don't have onlineJFS then you'll have to go to single user mode
but if you don't want to go to single user mode then you can try this

# fuser -cu /opt
to see what process are running

then you can do

# fuser -cuk /opt
to kill all users and process using /opt

then unmount ad do your steps

i would recommend going to single user mode, but if you have to extend and can't go to single user mode you can try the fuser to kill the process then unmount
The tongue weighs practically nothing, but so few people can hold it
Andrew Young_2
Honored Contributor

Re: extending /opt

Hi Aussan

I would NEVER recommend running fuser -cuk on /opt. Although there should be nothing critical running on that filesystem there are invariably monitoring and system management things running off that file system which may be corrupted in the process are cause problems with your system. Single user mode is much much safer.

Another option space allowing would be to create another larger lvol/filesystem on vg00. Copy everything in /opt accross using cp -p -r ,change your /etc/fstab to mount the new file system as /opt and then reboot. Then cleanup the old filesystem.

Regards

Andrew Y


Si hoc legere scis, nimis eruditionis habes
amit mehta_2
Regular Advisor

Re: extending /opt

Thanks a ton to all of you :)
amit mehta_2
Regular Advisor

Re: extending /opt

got the solution :) hence closing the thread.