Re: Hard Drive Partition Table shows partition larger than drive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Robert,

On 4/28/20 10:28 AM, Robert Steinmetz wrote:
On 4/27/20 1:54 PM, Phil Turmel wrote:
here is the output of lsdrv for the drive.

USB [usb-storage] Bus 001 Device 002: ID 152d:2338 JMicron Technology Corp. / JMicron USA Technology Corp. JM20337 Hi-Speed USB to SATA & PATA Combo Bridge {000000000005}
└scsi 4:0:0:0 TOSHIBA  HDWD110          {585T7P6NS}
  └sdb 931.51g [8:16] Partitioned (dos)
                                    ^^^^^
There's your answer.  This drive is using a dos partition table, not GPT.  But there's some info where the GPT would be that is confusing parted.

   └sdb1 931.51g [8:17] Empty/Unknown

As you can see, this partition entry is rational.

Try displaying the partition table with fdisk instead of parted.

Here is what fdisk says:

Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 244190646 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
Disklabel type: dos
Disk identifier: 0x19e6cd02

Device     Boot Start        End    Sectors  Size Id Type
/dev/sdb1  *     2048 1953523711 1953521664  7.3T fd Linux raid autodetect

Note the discrepancy between the disk size and the partition size.

fdisk is multiplying the sectors in the dos partition table by 4096 instead of 512. DOS partition tables always presume 512-byte sectors. Looks like a bug in fdisk.

It seems the end sector for partition /dev/sdb1 is incorrect and should be 244190646 or 244190645 depending on how sectors are numberd that is if there is a sector 0 or it starts at 1.

The "end" sector of a partition is the last address within the partition. One less than what would be the start of the next partition.

Phil



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux