Operating System - HP-UX
1851540 Members
3811 Online
104060 Solutions
New Discussion

fsadm to decrease the filesystem size fails with error...

 
Yashwanth
New Member

fsadm to decrease the filesystem size fails with error...

When I run fsadm to decrease the filesystem size, the command results in the following. This is on Series 700 system, running hp-ux 10.20.

# bdf /var
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol8 462848 94095 346975 21% /var
# fsadm -F vxfs -b 350000 /var
fsadm: cannot shrink /dev/vg00/rlvol8 - upgraded fs - inodes are currently in use.
5 REPLIES 5
Stefan Farrelly
Honored Contributor

Re: fsadm to decrease the filesystem size fails with error...


fsadm can only decrease an lvol if the part of the filesystem you are trying to reduce has no files on it. In your case it does, so it is unable to reduce it. You can try to defrag the filesystem, this may move the offending file(s) to the first part of the filesystem allowing the reduce to work (use fsadm -e -d).
If you use JFS 3.3 (for 11) fsadm will attempt to move the offending files out of the way first which works most of the time, a good imporvement.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Dan Hetzel
Honored Contributor

Re: fsadm to decrease the filesystem size fails with error...

Hi,

For fsadm to be able to shrink your disk, you should first defragment it with:
fsadm -F vxfs -d -e -s /var

The -s flag will provide you with a summary showing if some files couldn't be moved.

You have a few files open on /var, like /var/adm/syslog/syslog.log which could be quite large and need to be moved.
'fuser' will report all processes having a file open.

Once defragmented, you may shrink your filesystem using the same command you already tried.

Best regards,

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Insu Kim
Honored Contributor

Re: fsadm to decrease the filesystem size fails with error...

This problem is a known limitation of JFS.

Reducing the size of a file system will fail if there are file-system resources currently in use within the sectors to be removed from the file system regardless of whatever is done first.
Therefore, fsadm is behaving correctly.

Regards,
Never say "no" first.
Donald Kok
Respected Contributor

Re: fsadm to decrease the filesystem size fails with error...

indeed you can defrag with fsadm. defrag works straight forward over the volume from begin to the end.

On a working machine the file system can put files in the just freed area. fsadm doesnt prevend this. So at the end of the defrag action, there are new files in the area you want to reduce.

To prevend this go to single user mode first.
Gool luck
My systems are 100% Murphy Compliant. Guaranteed!!!
Madhu Sudhan_1
Respected Contributor

Re: fsadm to decrease the filesystem size fails with error...

Yashwanth !
If fsadm fails, only way is to backup(of course multiple copies) the filesystem with all the attributes and reduce the lv and recreate the filesystem and restore the data.

...Madhu
Think Positive