GNOME Bugzilla – Bug 685135
Partition size differs from filesystem size - not true?
Last modified: 2012-09-30 21:16:40 UTC
Created attachment 225416 [details] screenshot showing gparted partition info I've detected a problem with the new feature introduced with bug #499202 "gparted does not see the difference if partition size differs from filesystem", using an ext4 filesystem created manually with mkfs.ext4. While it's useful, it seems to wrongly report a problem when there is none (see attached screenshot). When I try to fix it as I'm told to do, resize2fs simply states that nothing has to be done. tune2fs -l /dev/sdb5: tune2fs 1.42.5 (29-Jul-2012) Filesystem volume name: <none> Last mounted on: /usr/portage Filesystem UUID: 3b67aeff-cfa0-43db-af1a-1e2373becd31 Filesystem magic number: 0xEF53 Filesystem revision #: 1 (dynamic) Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super huge_file uninit_bg dir_nlink extra_isize Filesystem flags: signed_directory_hash Default mount options: user_xattr acl Filesystem state: clean Errors behavior: Continue Filesystem OS type: Linux Inode count: 200192 Block count: 524288 Reserved block count: 0 Free blocks: 455382 Free inodes: 200181 First block: 1 Block size: 1024 Fragment size: 1024 Reserved GDT blocks: 256 Blocks per group: 8192 Fragments per group: 8192 Inodes per group: 3128 Inode blocks per group: 782 Flex block group size: 16 Filesystem created: Wed Sep 26 19:09:06 2012 Last mount time: Wed Sep 26 19:12:06 2012 Last write time: Wed Sep 26 19:12:48 2012 Mount count: 1 Maximum mount count: -1 Last checked: Wed Sep 26 19:11:24 2012 Check interval: 0 (<none>) Lifetime writes: 65 MB Reserved blocks uid: 0 (user root) Reserved blocks gid: 0 (group root) First inode: 11 Inode size: 256 Required extra isize: 28 Desired extra isize: 28 Journal inode: 8 Default directory hash: half_md4 Directory Hash Seed: 635c71d6-1ba2-41df-acf8-6f2cacedadbf Journal backup: inode blocks df: /dev/sdb5 474084 384749 89335 82% /usr/portage The command to create the filesystem was: mkfs.ext4 -b 1024 -N 200000 -m 0 /dev/sdb5 Steps to reproduce: 1) Create a partition, size = 512MiB. 2) mkfs.ext4 -N 200000 -b 1024 -m 0 /dev/sdx 3) Mount the partition, otherwise gparted doesn't report any error (another bug in my opinion). 4) Start gparted and look at the created and mounted partition, behold the error indicator. When looking at the df output and doing a bit of calculation, it seems that gparted only looks at the value provided there (474084)?? Maybe it should use the block count value from tune2fs? So to sum up: 1) gparted doesn't report any error when the filesystem is not mounted. You shouldn't have to mount a partition to see the partition size / filesystem size difference. If there is no common way to detect the size for all supported filesystems, then a filesystem-specific way should be found. 2) The filesystem size reported by gparted is wrong, and so is the hint to fix it. Fortunately, nothing bad will happen when following the instructions.
Thank you for reporting this problem. I suspect that the patch set in the following bug report might address the problem: Bug #683255 - ext2: statvfs differs from dumpe2fs (x MB unallocated space within the partition) Harald, would you be able to test out the above mentioned patch set to see if it addresses the problem you discovered?
Created attachment 225434 [details] screenshot showing correct gparted partition info I have backported the patch from attachment #224617 [details] to gparted-0.13.1 and confirm it solves the problem. The sizes shown seem to be correct now, and there are no warnings.
Thank you Harald for testing the patch and confirming that it resolves the issue. I will mark this report as a duplicate since the other report came first and contains the patch. *** This bug has been marked as a duplicate of bug 683255 ***
Hi, I have looked at the figures from your "tune2fs -l" output above. In particular: Blocks per group: 8192 Inode blocks per group: 782 This is exactly the same issue as bug 683255. -- Create an ext2/3/4 file system with higher than default inodes. File system uses more disk blocks to store the inode tables. When mounted the ext2/3/4 kernel code reports the size of the file system after subtracting this overhead and GParted thinks there is unallocated space. As you have seen the patch fixes the issue by reading the file system size from the on disk superblock. Thanks, Mike