Operating System - HP-UX
1837847 Members
3088 Online
110121 Solutions
New Discussion

Decrease /opt and increase /usr

 
SOLVED
Go to solution
Sergej_5
Regular Advisor

Decrease /opt and increase /usr

Hi there!
Please help me to resolve the following problem:

#bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 4534272 3837400 691456 85% /
/dev/vg00/lvol1 295024 57816 207704 22% /stand
/dev/vg00/lvol4 3072000 1379240 1680920 45% /var
/dev/vg00/lvol7 1241088 1189024 51680 96% /usr
/dev/vg00/lvol6 7028736 4431000 2577472 63% /opt
/dev/vg00/lvol5 20480 2360 17984 12% /home

- I got OnlineJFS installed:
# swlist |grep -i jfs
B5118CA B.11.11 HP OnLineJFS
- I have defrag my /opt with:
# fsadm -F vxfs -D -E -d -e /opt

Succesfully!
Now when i want to reduce size of /opt for 1000MB it says:
# lvreduce -L 1000 /dev/vg00/lvol6
The Logical Volume has a mounted filesystem on it.
Logical volume "/dev/vg00/lvol6" is not reduced.

How can i make to reduce lvol name /opt for 1000MB and increase /usr with that 1000MB's?
Is there any way to do it in SAM ?

9 REPLIES 9
Leif Halvarsson_2
Honored Contributor

Re: Decrease /opt and increase /usr

Hi,

Increasing an filesystem online is OK but I doubt if there is an reliable way to reduce a filesystem without risk of loosing data.

The most reliable way, in your case, to change the allocation for vg00 is to use Ignite but, of course this needs some downtime.

You can also do temporary "workaround", moving some data from /usr to /opt and create links in /usr.
John Waller
Esteemed Contributor
Solution

Re: Decrease /opt and increase /usr

I am probably wrong but wouldn't you need to fsadm -b to specify a the new smaller size for the /opt filesystem. The -D -E -d -E only reports and defrags, I would have thought you would have to reduce the size of the filesyetem before you reduce the size of the lvol.
If you still have an issue with the filesystem mounted then you will need to do this in single user mode. with just the /usr filesystem mounted.
Borislav Perkov
Respected Contributor

Re: Decrease /opt and increase /usr

Hi,
Definitely you can do it with Ignite, especialy reducing the /usr. Make Ignite tape with -I option. Boot from tape, choose HP Installation, go to Filesystem tab and make appropriate change on /opt and /usr.
regards,
Borislav
Sergej_5
Regular Advisor

Re: Decrease /opt and increase /usr

I got a patch who wants to increase of /usr
I dont want to make symbolic links ...

Please do write only practicable solutions :)

I do got Ignite-UX server ... but how can i made above problem resolved?

Brgds,
Sergej
Leif Halvarsson_2
Honored Contributor

Re: Decrease /opt and increase /usr

Hi,
If you want to try reducing the filesystem/logical volume online you must first resize the filesystem using the "-b" option in fsadm, before trying to reduce the logical volume.
Steven E. Protter
Exalted Contributor

Re: Decrease /opt and increase /usr

Take a backup prior to reduction of a filesystem. You can not reduce the point where there is no usable free space, fsadm/OnlineJFS will simply refuse to do so.

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
Sergej_5
Regular Advisor

Re: Decrease /opt and increase /usr

I have found it to work! :)
Thnx to Leif Halvarsson!

Brgds,
Sergej
Jannik
Honored Contributor

Re: Decrease /opt and increase /usr

Backup everything on this lvol.

fsadm -b"new_size"M /dev/vgxx/xxxx
lvreduce -L "new_size"M /dev/vgxx/xxxx
jaton
Sergej_5
Regular Advisor

Re: Decrease /opt and increase /usr

Hi!
The right order was/is:

1) fsadm -F vxfs -b 6144m /opt
2) lvreduce -L 6144 /dev/vg00/lvol6
3) lvextend -L 1024M /dev/vg00/lvol7
4) fsadm -F vxfs -b 1024m /usr