1843858 Members
2427 Online
110225 Solutions
New Discussion

Re: Reduce file system?

 
SOLVED
Go to solution
Greg Stark_1
Frequent Advisor

Reduce file system?

Hi all,
I have a 1 Gig vxfs filesystem that I would like to reduce to 50 MB. I'm not sure how to do this, but I think I would do the following:

umount /mnt/bi
lvreduce -L 50 /dev/vg01/datalvol1
mount /dev/vg01/datalvol1 /mnt/bi

When I run the lvreduce command, it says I will corrupt the file system. Is this expected, or am I way off?

Thanks again,
Greg
13 REPLIES 13
harry d brown jr
Honored Contributor

Re: Reduce file system?

If you only need 50mb, I'm assuming you can easily backup anything on that LV. So back it up. Delete it, recreate it, then restore your data.


live free or die
harry
Live Free or Die
Uday_S_Ankolekar
Honored Contributor

Re: Reduce file system?

G. Vrijhoeven
Honored Contributor

Re: Reduce file system?

Hi,

i agree with harry. just backup and recreate.
Your problem might be caused by files that are in the file system. (bdf)

Gideon
James R. Ferguson
Acclaimed Contributor

Re: Reduce file system?

Hi:

Unless you have Online JFS, shrinking a filesystem requires that your reload its data after performing a 'newfs' on the filesystem following the 'lvreduce' of the logical volume.

If you have Online JFS, you *may* be able to shrink the filesystem without rebuilding it and reloading its data. Reduction will fail, however, if inuse blocks reside within the area to be returned. Defragmentation (via 'fsadm') sometimes moves and frees sufficient space and improves the success rate.

Regards!

...JRF...
Darrell Allen
Honored Contributor

Re: Reduce file system?

Hi Greg,

lvreduce will not maintain the integrity of a file system. Basically you are simply slicing off a chunk of disk space (quite a large chunk in your case) without regard for what was in the space that you are removing. With online JFS and using fsadm you have a chance for success but there's no guarantee it will work. You can forget about it working shrinking from 1GB to 50MB.

Always make a backup before adjusting the size of filesystems and logical volumes anyway, especially when shrinking. Simply reload it. No headaches!

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Deshpande Prashant
Honored Contributor

Re: Reduce file system?

HI
Since you want to reduce it so small, try considering removing and recreating the LV and File system.
Backup the file system.
umount /mnt/bi
lvremove /dev/vg01/datalvol1
lvcreate -L 50 /dev/vg01/datalvol1
mkfs -F vxfs /dev/vg01/data1vol1
mount /dev/vg01/datalvol1 /mnt/bi
Restore the data.

Take a look at following discussion, for using fsadm to reduce file system with online JFS .

http://forums.itrc.hp.com/cm/QuestionAnswer/1,11866,0x3b07c7af36b7d5118ff10090279cd0f9,00.html

Thanks.
Prashant.
Take it as it comes.
Bernie Vande Griend
Respected Contributor

Re: Reduce file system?

Unless you're using Online JFS, lvreduce will corrupt the data on the filesystem unless you are very likely. A reduction of this size will certainly mess up the data.
You must back up the data first and then either lvreduce it or do a lvremove/lvcreate again.
Ye who thinks he has a lot to say, probably shouldn't.
Greg Stark_1
Frequent Advisor

Re: Reduce file system?

Here's what I did:

# fsadm -F vxfs -d -D -e -E /mnt/db
# fsadm -F vxfs -b 51200 /mnt/db

but got the following error:

fsadm: cannot shrink /dev/vg01/rdatalvol1 - upgraded fs - inodes are currently
in use.

Not sure what it means, but ended up deleting/re-creating. Thanks for all your help.
Greg
Uday_S_Ankolekar
Honored Contributor

Re: Reduce file system?

Hi,

Umount the mount point first..did you..?
Good Luck..
Greg Stark_1
Frequent Advisor

Re: Reduce file system?

Yes, I tried it first without unmounting, then with, but got a different error, something about not a root inode.
James R. Ferguson
Acclaimed Contributor

Re: Reduce file system?

Hi Greg:

The failure to be able to dynamically reduce the VxFS filesystem has been commonly reported with Online JFS versions up to 3.3.

If you quiesce all utilization of the filesystem, and defragment first, then *sometimes* you can shrink. Online JFS version 3.3 is said to address the common failure to be able to shrink filesystems.

Regards!

...JRF...
Greg Stark_1
Frequent Advisor

Re: Reduce file system?

Any idea how to tell what version of Online JFS you are on? I have tried:
swlist -l product
swlist -l fileset
swlist -l bundle
but none seems to show what version.
James R. Ferguson
Acclaimed Contributor
Solution

Re: Reduce file system?

Hi Greg:

Online JFS 3.3 utilizes a runtime license mechanism.

The product number for JFS 3.3 is B3929CA for servers and B5118CA for workstations on 11.0. JFS 3.3 comes with 11i.

The product number for JFS 3.1 is B3929BA.

Regards!

...JRF...