Public bug reported: With an ext4 filesystem, you can shrink and expand a filesystem until you run out of GDT blocks. After that the filesystem cannot be resized, neither shrunk nor expanded, even if unmounted.
Although this issue is most relevant in an LVM environment, here's some code to demonstrate the issue using a loopback device. The code needs to be run as root. dd if=/dev/zero of=ext4.img bs=1M count=10000 dev=$(losetup -vf ext4.img| cut -d" " -f4) mkfs.ext4 ${dev} 5M tune2fs -l ${dev} | grep -i gdt resize2fs ${dev} 3G tune2fs -l ${dev} | grep -i gdt resize2fs ${dev} 2G tune2fs -l ${dev} | grep -i gdt resize2fs ${dev} 3G tune2fs -l ${dev} | grep -i gdt resize2fs ${dev} 5G tune2fs -l ${dev} | grep -i gdt resize2fs ${dev} 3G At this point resize2fs returns an error: resize2fs: /dev/loop0: The combination of flex_bg and !resize_inode features is not supported by resize2fs. This means the filesystems is 5GB forever. It cannot be resized, expanded or shrunk. In contrast, ext3 does not have this issue. mkfs.ext3 ${dev} 5M tune2fs -l ${dev} | grep -i gdt resize2fs ${dev} 3G tune2fs -l ${dev} | grep -i gdt resize2fs ${dev} 2G tune2fs -l ${dev} | grep -i gdt resize2fs ${dev} 3G tune2fs -l ${dev} | grep -i gdt resize2fs ${dev} 5G tune2fs -l ${dev} | grep -i gdt resize2fs ${dev} 3G Workaround: when creating an ext4 filesystem, use the extended option resize=. For example: mkfs.ext4 -E resize=100000000000 ${dev} 5M tune2fs -l ${dev} | grep -i gdt resize2fs ${dev} 5G tune2fs -l ${dev} | grep -i gdt resize2fs ${dev} 3G This option can be added to /etc/mke2fs.conf. This is on Ubuntu Lucid 10.04 with the latest updates. # lsb_release -rd Description: Ubuntu 10.04.1 LTS Release: 10.04 # dpkg -l | awk '/e2fsprogs/ {print $2, $3}' e2fsprogs 1.41.11-1ubuntu2 # uname -rvmpio 2.6.32-25-generic #44-Ubuntu SMP Fri Sep 17 20:26:08 UTC 2010 i686 unknown unknown GNU/Linux # cat /proc/version_signature Ubuntu 2.6.32-25.44-generic 2.6.32.21+drm33.7 Regards, - Robert ** Affects: linux (Ubuntu) Importance: Undecided Status: New -- cannot resize ext4 once GDT blocks exhausted https://bugs.launchpad.net/bugs/656115 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs