I'm asking because, for example,


states that EXT3 can be shrunk online. But when I click on the reference:

"Offline growing/shrinking as well as online growing"

So what is the truth? Can someone post a small list of filesystems that currently be shrunk online?

  • 1
    This chart is confusing as it implicitly assumes there is a single file system per volume. This isn't true for ZFS volumes (zpools) that indeed cannot be shrink (yet?) but nevertheless ZFS file systems can be grown or shrink online. – jlliagre Nov 16 '11 at 8:33
  • 1
    Note from 2015: there is still no fs on linux which would be capable to do that. For ext2 there were some patches in the ancient times (yet before ext3). Reiserfs promised this, maybe if it gets the needed support it would be long ready now. – peterh - Reinstate Monica Sep 2 '15 at 20:07

Of the common filesystems used on Linux:

  • JFS and XFS cannot be shrunk at all. Nor can (AFAIK) FFS and UFS, even with Solaris or *BSD.
  • Ext2/ext3/ext4 and Reiserfs cannot shrink mounted filesystems.
  • Btrfs can shrink mounted filesystems.

ZFS somewhat demonstrated growing or shrinking a file system is pointless.

A ZFS File system can but isn't required to have a predefined size. In the latter case, there is no need to shrink the filesystem given the fact there is no wasted space, unlike most if not all other file systems.

Of course, the underlying physical devices have a capacity limit but there is no need to add arbitrary limits.

  • 2
    If it was really pointless: Suppose you have a LVM and you need to create another volume, but have no space for it. So you have to shrink the existing file system. You yould just do a lvresize - but what if there are data in the area you are cutting off from the volume? That's why you need to tell the file system to move it to somewhere safe, i.e. before the place you want to have the cut. That's exactly what shrinking does. For growing, you are right - theoretically, the FS could detect that the volume has more space than before and use it automatically. – glglgl Nov 16 '11 at 0:12
  • 1
    You postulate partitioning and reserving a fixed size of disk to file systems is mandatory. This is true for traditional file systems. However, ZFS shows it is an avoidable annoyance. Just like when you create a file, you do not reserve a fixed size of storage to it, ZFS datasets only use the space they need to store data. They do not preallocated free space unavailable to other filesystems (or volumes, snapshots, whatever). – jlliagre Nov 16 '11 at 8:23
  • 1
    Ok, but just to understand it: Step 1: add file of 4GB to a partition of 9GB, which gets put tu the start (let's say). Step 2: add another file of 4GB, being put to the end. Step 3: remove the first file. Step 4: shrink the file system to 5 GB. This Step 4 can only work if the data of the file are moved. Is there a tool which does this? Or does it happen automatically when removing the 1st file? I cannot imagine that... And this has nothing to do with preallocation or whatever. Data on disk have to be physically somewhere... – glglgl Nov 16 '11 at 8:51
  • 1
    I believe jlliagre is saying that space is already there. So once you remove the file its available for you to create another mountpoint with. So all the mountpoints in a pool share the total available space. In LVM terms think of a VG where new LV's always show the total space availble in the VG. So say 3 LV's in VG will all report the same space used. Adding a 4th LV will also show the same space used. – AndyM Nov 16 '11 at 9:04
  • 4
    @jlliagre I think you and glglgl are talking at cross-purposes. You're saying that you can have several ZFS volumes with flexible boundaries inside a given space. Sure, but that's not the question here. Suppose you have a 2TB disk, fully occupied by a more than half-empty ZFS filesystem. You suddenly realize that you need to split off 1TB of that disk to make an NTFS partition. Can you shrink the part of the disk that's allocated to ZFS? – Gilles 'SO- stop being evil' Nov 17 '11 at 2:00

I was able to shrink online rootfs on ReiserFS v3 using resize_reiserfs for testing. That was few years ago on some linux. But now I get "Can't shrink filesystem on-line.". I've heard, ext3 was shrinkable online in some cases with resize2fs, and it wasn't in other cases. I belive, this feature is very dangerous and unstable and can "accidently whole FS".


It should be noted for posterity that https://en.wikipedia.org/wiki/Comparison_of_file_systems#Resize_capabilities has since been updated to list a number of file systems that do support online shrinking.

On Linux, apparently Btrfs supports it. There do appear to be some caveats, cf. other questions on the network:

AIX JFS2 can do this, cf. How to decrease the size of a logical volume/fs aix? Curiously enough, a quick search finds me no obvious proof that the Linux JFS2 port can do the same.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.