xfs
[Top] [All Lists]

Re: xfs_shrinkfs ?

To: Derek Glidden <dglidden@xxxxxxxxxxxxxxx>
Subject: Re: xfs_shrinkfs ?
From: Steve Lord <lord@xxxxxxx>
Date: Thu, 01 Feb 2001 21:00:14 -0600
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: Message from Derek Glidden <dglidden@xxxxxxxxxxxxxxx> of "Thu, 01 Feb 2001 19:11:32 EST." <3A79FB34.7406CB7C@xxxxxxxxxxxxxxx>
Sender: owner-linux-xfs@xxxxxxxxxxx
> 
> First off, many kudos to the SGI folks et al for the amazing work at
> getting XFS ported and running so quickly and well on Linux!  Thanks!
> 
> Now the question: I've got a big XFS LVM volume on my file server and
> I'm just curious if there is a utility that can shrink an XFS
> filesystem, if I decide for whatever reason to shrink the LVM volume the
> filesystem happens to be on.  I'm busy backing up the partition right
> now to test this directly, but it'd be nice to hear for certain.
> 

Martin already answered this, there is unfortunately no such beast. Growing
the filesystem is easy, you just tag some space on the end and fix up some
counters, oh and because we do it live it is safe against crashes since we
journal it.

Shrinking is much harder, you almost certainly want the same journaling
protection, which means you need to do more than just migrate structures
around the disk, you need to cope with new ongoing activity. OK, you could
do the offline version with less work, but you need to find all the inodes,
directory blocks, data blocks, etc within the allocation groups to be
removed (we would have to do whole allocation groups I think). Doing this
would require a complete scan of all inodes in the filesystem to find
the ones affected. The allocator would need modification to be able to 
prevent new allocations into these areas. Then it is just a matter of 
moving all the files and directories one by one, the files part is easy,
the directories would be harder, but not impossible. It would not be
possible to keep inode numbers constant - since these encode a disk
location.

Probably about 3 months work for an expert - any volunteers?

Steve



<Prev in Thread] Current Thread [Next in Thread>