1834133 Members
2010 Online
110064 Solutions
New Discussion

How to reduce /usr

 
SOLVED
Go to solution
Tore_1
Regular Advisor

How to reduce /usr

Anyone know? Get error message about corrupt filesystem when I reduce /usr even though theres plenty of spares and the filesystem is fresh. Got online jfs installed.
Thanks.
7 REPLIES 7
Steve Steel
Honored Contributor

Re: How to reduce /usr

Hi

More detail please

OS
bdf
error messages

command used to reduce

Details of /usr


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Peter Scott
Advisor

Re: How to reduce /usr

You should never reduce the size of a filesystem using OnlineJFS. The reason for this is that you can't guarantee where the High Water Mark in the filesystem is, and reducing the filesystem can potentially damage data in the filesystem. This looks like whats happening to you.

The solution is to reboot the server into single user mode, backup the data in your /usr filesystem to a temporary filesystem, reduce the size of your lvol with lvreduce and then recreate the filesystem with newfs. Finally restore your data into the partition.

I know it's long winded, but this is tyhe only way you can do the job

Regards

Pete Scott
Life is a terminal sexually transmitted disease, but hey, who wants to be cured!
Sebastian Galeski_1
Trusted Contributor

Re: How to reduce /usr

Domenico_5
Respected Contributor

Re: How to reduce /usr

hi
peter have a good solution, but I have tested to reduce /usr and it have worked.

You must have installed jfs 3.3 and all work correctly.

regards.

Tore_1
Regular Advisor

Re: How to reduce /usr

Thanx Peter. I have reduced volumes before, but this time it didn't work. My reasoning is that because the filesystem is brand new of an installation, the data in /usr shouldnt be fragmented and thus reducing shouldnt jepoardize the data.
Stefan Farrelly
Honored Contributor
Solution

Re: How to reduce /usr


There are 2 different versions of JFS you need to consider;

1. JFS 3.3 This newer version allows you to successfully reduce an lvol becuase it will move out of the way any data which are on the extents you want to reduce. It will move them to other free extents. Works great although I have seen it fail if your lvol is 99 or 100% full as it needs some space to move the extents to first.

2. The older OnlineJFS offers no such guarantee. It cannot move out of the way extents you want to reduce. If any of the extents you want to reduce are in use the fsadm -b fails (but the lvreduce will work). What you could try instead was doing a defrag with JFS before you try the reduce (fsadm -D -E) as this could move the data off the extents you want to reduce, but in my experience it didnt help much.

3. Some people are using the new Veritas volume manager sofware which also allows you to successfully reduce lvols (like JFS 3.3).

So unless you are using JFS 3.3 (or VVM) you will have to use something like an ignite bootable recovery tape to restore vg00 and resize /usr to your new size.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Tore_1
Regular Advisor

Re: How to reduce /usr

Ive got jfs3.3, but still when I try to reduce the volume with lvreduce -L 1300 /dev/vg00/lvol7 I get the error message about corrupt filesystem.
Also, restoring the /usr from tape (my disk is so small I cant back it up on disk, thats why I wanted to reduce /usr in the first place) isnt trivial as most unix commands resides in /usr.