[ubuntu-us-mi] resizing mounted filesystem

Robert Citek robert.citek at gmail.com
Wed Oct 6 01:25:02 BST 2010


Forgot to post the error message at the resize step:

# resize2fs $(mount | grep ext4.loop | cut -d" " -f1)
resize2fs 1.41.11 (14-Mar-2010)
Filesystem at /dev/loop0 is mounted on /tmp/ext4/ext4.loop; on-line
resizing required
old desc_blocks = 1, new_desc_blocks = 40
Performing an on-line resize of /dev/loop0 to 10240000 (1k) blocks.
resize2fs: Operation not permitted While trying to add group #640

Regards,
- Robert

On Tue, Oct 5, 2010 at 9:20 PM, Robert Citek <robert.citek at gmail.com> wrote:
> I'm running into some kind of limit for expanding a mounted file
> system.  Does anyone know of a workaround that allows me to expand yet
> keep the filesystem mounted?
>
> In brief, I have a mounted filesystem that I want to make larger, e.g.
> from 5MB to 10GB.  However, resize2fs gets about half-way before
> stopping with an error.  Nothing on the filesystem seems to be broken,
> I just can't make it any larger.  If I unmount, fsck, resize, and
> mount again, that works just fine.  But I'd rather not unmount.  Or if
> I do need to unmount, only unmount to change some setting on the
> filesystem and not do a full fsck. (still googling to figure out what
> that setting might be.)
>
> Here's a simple script to replicate the issue I'm having.  It needs to
> be run as root.  So, if you are not comfortable with that, please do
> not run it.
>
> # code to demonstrate issue
> dd if=/dev/zero of=ext4.img bs=1M count=10000
> mkfs.ext4 -F ext4.img 5M
> mkdir -p ext4.loop
> mount -o loop ext4.img ext4.loop
> df -PhT ext4.loop
> resize2fs $(mount | grep ext4.loop | cut -d" " -f1)
> df -PhT ext4.loop
>
> # workaround to demonstrate filesystem can be resized, just not when mounted
> umount ext4.loop/
> e2fsck -fy ext4.img
> resize2fs ext4.img
> mount -o loop ext4.img ext4.loop
> df -PhT ext4.loop
>
> BTW, this was tested on Ubuntu Lucid 10.04.
>
> Regards,
> - Robert
>



More information about the ubuntu-us-mi mailing list