[parted-devel] File System Type Not Detected with 4096 byte Sector Size Device
Jim Meyering
jim at meyering.net
Wed Apr 28 08:22:55 UTC 2010
Curtis Gedak wrote:
> It appears that parted does not detect the file system type when used
> with a device with 4096 byte sector size. I performed my testing on
> the Ubuntu 10.04 beta2 distribution using the latest version (April
> 27, 2010) of parted from the git repository.
>
> Since I do not have a device with a 4096 byte sector size, I used the
> SCSI_DEBUG module to emulate such a device.
>
> The steps I used are as follows:
>
> 1) Create a device with a 4096 byte sector size.
>
> $ modprobe scsi_debug dev_size_mb=96 sector_size=4096
>
> NOTE: In my case this created device "/dev/sdc".
>
> 2) Create an msdos disk label on the device.
>
> $ parted -s /dev/sdc mklabel msdos
>
> 3) Create an ext2 partition that spans the device.
>
> $ parted -s /dev/sdc mkpart primary ext2 64s 100%
>
> 4) Create an ext2 file system on the partition.
>
> $ mkfs.ext2 /dev/sdc1
>
> 5) Print out the partition table and discover the missing file system type.
>
> $ sudo parted /dev/sdc unit s print
> Model: Linux scsi_debug (scsi)
> Disk /dev/sdc: 24576s
> Sector size (logical/physical): 4096B/4096B
> Partition Table: msdos
>
> Number Start End Size Type File system Flags
> 1 64s 24575s 24512s primary
>
> $
>
> NOTE the missing "ext2" that should be listed under the "File
> system" column.
>
> Please note that this problem did not occur when I created a
> SCSI_DEBUG device using a sector size of 512 bytes.
Thank you for the report and detailed reproducer.
This is not surprising, since I have made no effort whatsoever to adjust
the bit-rotting file-system-specific code in parted to work with >512-byte
sectors, and the ext[234] type-detecting code is part of that.
Unless it's easy to fix, I would like to eliminate the code that parted
currently uses for that and to use code from a well-maintained library
instead, but haven't looked into it at all.
More information about the parted-devel
mailing list