[parted-devel] [PATCH] Detect Ext4 (Parted Alioth #188)

Jim Meyering jim at meyering.net
Fri Jan 9 14:28:14 UTC 2009


"Bryn M. Reeves" <bmr at redhat.com> wrote:

> Colin Watson wrote:
>> On Fri, Jan 09, 2009 at 12:41:21PM +0000, Colin Watson wrote:
>>> Here's a version of my patch merged with yours. Although I have not yet
>>> been able to test them extensively, the block count patches are
>>> particularly important; without them, parted will detect the wrong
>>> geometry for a >2TB ext4 filesystem.
>>
>> And of course it turns out to be rather hard to test these, because
>> ext3's maximum file size is 2TB and we need 2^32 4KB blocks (i.e. 16TB)
>> before needing to use the high longword of the block count, so it's
>> rather hard to create this situation with the sparse loopback file
>> approach that would work reasonably in parted's test suite. I can't even
>> create an ext4 filesystem and put a loopback file in that (not that that
>> would be viable in parted's test suite) because ext4's maximum file size
>> is 16TB. Any ideas?
>>
>
> How about using a sparse block device instead of a loopback device
> backed by a sparse file?

Or use a file on an xfs file system as the backing store.
Here's a 9MB file with apparent size of over 5 exabytes:

    $ dd if=/dev/zero of=big bs=1M count=1 seek=5T
    $ du -h --app big
    5.1E    big

Using file systems like ext4 and xfs is fine in parted's test
suite, as long as you're careful to diagnose "missing support"
failures as "skipped" (not failing) tests.

The advantage of doing it this way, if it works, is that the test
doesn't have to be run as root.



More information about the parted-devel mailing list