LWN.net Logo

Online resizing of ext3 filesystems

One of the patches which slipped into 2.6.7-rc3-mm2 is one by Andreas Dilger and others which makes it possible to resize a running ext3 filesystem on the fly. This patch has been shipped with Fedora kernels for a little while, but has not seen a lot of wider use. That could change, of course, if the resize patch finds its way into the mainline.

The resize patch is conceptually quite simple. It simply adds one or more block groups which make use of extra space which, one hopes, is sitting there idle at the end of the existing filesystem. Once the block groups are hooked into the filesystem data structures, a simple ioctl() call or remount will make the space available. Behind this apparent simplicity, of course, is a significant amount of code which makes the resize operation happen on a modern, complex filesystem in a robust manner.

People wanting to try out resizing will need a few things:

  • A kernel (such as 2.6.7-rc3-mm2) with the online resize patch included.

  • A patch to e2fsprogs to make use of the resize capability; it is available from the ext2resize SourceForge download area.

  • Free disk space into which the filesystem can expand. Usually this means that the filesystem should live in a device mapper partition which can be expanded as well.

  • A very good backup of your filesystem.

This patch and its associated documentation (or lack thereof) still require some work before being ready for widespread deployment. Once they get there, however, life should get easier for system administrators who, throughout history, have routinely found out that all that "extra space" they figured into their filesystems is never enough.


(Log in to post comments)

Shrink too?

Posted Jun 18, 2004 7:41 UTC (Fri) by kbob (guest, #1770) [Link]

Does this code let you shrink filesystems on line, or just grow them? From the description, it sounds like it's growth only.

K<bob>

Online resizing of ext3 filesystems

Posted Jun 18, 2004 20:59 UTC (Fri) by sbergman27 (guest, #10767) [Link]

I believe you can shrink or grow unmounted filesystems without the kernel patch. With the patch I believe that you can grow (but not shrink) mounted filesystems.

Copyright © 2004, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds