This patch allows to shrink a read-only mounted filesystem which is useful for rootfs and others that cannot be unmounted. It completely disables online-resizing (because online shrinking is not implemented in the Linux kernel) After the resize you will need to do a hard reboot with reboot -f or echo b > /proc/sysrq-trigger Index: e2fsprogs-1.42.13/resize/main.c =================================================================== --- e2fsprogs-1.42.13.orig/resize/main.c +++ e2fsprogs-1.42.13/resize/main.c @@ -468,7 +468,7 @@ int main (int argc, char ** argv) blocksize / 1024); exit(0); } - if (mount_flags & EXT2_MF_MOUNTED) { + if (0) { bigalloc_check(fs, force); retval = online_resize_fs(fs, mtpt, &new_size, flags); } else { Index: e2fsprogs-1.42.13/lib/ext2fs/unix_io.c =================================================================== --- e2fsprogs-1.42.13.orig/lib/ext2fs/unix_io.c +++ e2fsprogs-1.42.13/lib/ext2fs/unix_io.c @@ -511,7 +511,7 @@ static errcode_t unix_open(const char *n open_flags = (flags & IO_FLAG_RW) ? O_RDWR : O_RDONLY; if (flags & IO_FLAG_EXCLUSIVE) - open_flags |= O_EXCL; + open_flags |= 0; #if defined(O_DIRECT) if (flags & IO_FLAG_DIRECT_IO) { open_flags |= O_DIRECT;