Menu

#3 disktype incorrectly reports information for 4K-sector disks

open
nobody
None
5
2012-11-09
2012-11-09
Mark K
No

I have a disk with 4KB physical sectors. (It's a 3TB Seagate external USB drive. The SATA<->USB bridge in the drive "fakes" 4KB physical sectors, so as far as the computer is concerned it actually has 4096-byte sectors.)

While disktype can print the partition layout of that disk, it incorrectly reports the size of the partitions, and that the partitions are blank. Perhaps that's because when reading data from the partitions, it assumes the sector size is 512 bytes, so reads from the wrong place?

Here's some example output. Note that the initial block device size is reported correctly. But the partition sizes are wrong and neither partition is blank.

# disktype /dev/sdc

--- /dev/sdc
Block device, size 2.729 TiB (3000592973824 bytes)
DOS/MBR partition map
Partition 1: 12.21 GiB (13107298816 bytes, 25600193 sectors from 63)
Type 0x07 (HPFS/NTFS)
First 220.5 KiB (225792 bytes) are blank
Partition 2: 337.1 GiB (361966731264 bytes, 706966272 sectors from 25600256)
Type 0x83 (Linux)
Blank disk/medium

# fdisk -l /dev/sdc
Note: sector size is 4096 (not 512)

Disk /dev/sdc: 3000.6 GB, 3000592973824 bytes
255 heads, 63 sectors/track, 45600 cylinders, total 732566644 sectors
Units = sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00056e11

Device Boot Start End Blocks Id System
/dev/sdc1 63 25600255 102400772 7 HPFS/NTFS/exFAT
/dev/sdc2 25600256 732566527 2827865088 83 Linux

Discussion


Log in to post a comment.