2

I know that we can't reduce XFS file-system and it's not supported. However I would like to know the reason why xfs don't support shrink.

1 Answers1

6

Because nobody wrote that yet :-)

Some related links explaining what needs to be done:

And also:

The reason it hasn't been done is that there is basically no demand for shrinking large filesystems. Storage is -cheap-, and in most environments data sets and capacity only grow.

I personally don't 100 % agree with that but it makes sense. I guess the idea behind XFS wasn't to be used on workstations or generally situations where shrinking is necessary so it was written in a way that shrinking is harder (with transaction log in the middle of the filesystem etc.) and growing easier.

I think XFS developers are trying to say: If you want shrinkable filesystem, simply don't use XFS, but patches welcome :-)

Update: Support for shrinking is currently being worked on. xfsprogs 5.12 released in May already supports shrinking but it's still experimental -- you need unused space at the end of the filesystem and there isn't option to "defragment" the filesystem to make sure all unused space is at the end. But it's definitely moving forward and hopefully we can expect "full" support soon.

  • 3
    Might be more than that. An accepted shrink function would have to be supported indefinitely, including necessary changes as other filesystem functionality (and on-disk representation) evolved. A tax on the developers forever, of unknown size. For a feature for which they believe there is no demand. So they might not be inviting patches at all. – davidbak Nov 11 '20 at 18:20