On Fri, Oct 18, 2013 at 07:50:48PM +0100, Ben Harris wrote:
> 
> I have a system with only ext3 filesystems.  When I tried to resize the
> root filesystem using resize2fs I got a surprising error message:
> 
> wraith:/tmp# resize2fs -p /dev/wraith/root
> resize2fs 1.42.8 (20-Jun-2013)
> Filesystem at /dev/wraith/root is mounted on /; on-line resizing required
> old_desc_blocks = 34, new_desc_blocks = 65
> resize2fs: Filesystem does not support online resizing

The "Filesystem does not support online resizing" message is emitted
when the resize_inode feature is not set on the file system.  This can
happen because the file system was created without the resize_inode
present, which reserves block group descriptors which are needed so we
can resize the file system with out requiring moving the inode table
blocks (which is not something we can do for an online resize).  It
can also happen if the file system was originally very small, or was
created with an insufficient number of reserved desriptor blocks, and
the file system has been grown to the point where the reserved
descriptor blocks have been all used up.

> I poked it with strace and discovered:
> 
> access("/sys/fs/ext4/features/meta_bg_resize", R_OK) = -1 ENOENT (No such 
> file or directory)

This was caused by the resize2fs program checking to see if we are
running with a kernel which is new enough to support a new style of
online resizing --- but this is something which is only supported if
the file system was mounted using ext4.

So the fact that it was failing was not because we needed to have the
ext4 kernel module loading --- it was because the file system did not
have any reserved descriptor blocks which was needed for online
resizing.

> Running "modprobe ext4" caused resize2fs to be more willing to run
> (but it failed later):
> 
> wraith:/tmp# resize2fs -p /dev/wraith/root
> resize2fs 1.42.8 (20-Jun-2013)
> Filesystem at /dev/wraith/root is mounted on /; on-line resizing required
> old_desc_blocks = 34, new_desc_blocks = 65
> Performing an on-line resize of /dev/wraith/root to 16785408 (1k) blocks.
> resize2fs: Inappropriate ioctl for device While trying to add group #1088

That's because resize2fs doesn't wasn't checking to see if the file
system was mounted using ext3 or ext4; the presence of the file
/sys/fs/ext4/features/meta_bg_resize means that if the file system was
mounted with ext4, the online resizing would work.

So this is arguably a bug in resize2fs; it should have checked
/proc/mounts or /etc/mtab, and if it determined the file system in use
was not ext4, it should not have checked for the meta_bg_resize
feature flag, and just failed the the online resize unconditionally
once it determined that the file system didn't have the required
reserved descriptor blocks.

In other words, the first failure was correct; the second failure was
caused by resize2fs getting confused after you loaded the ext4 kernel
module.

Regards,

                                                - Ted


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to