From: Phil Turmel <philip@turmel.org>
To: Robert Steinmetz <rob@steinmetznet.com>,
Wols Lists <antlists@youngman.org.uk>,
linux-raid@vger.kernel.org
Subject: Re: Hard Drive Partition Table shows partition larger than drive
Date: Tue, 28 Apr 2020 10:36:40 -0400 [thread overview]
Message-ID: <407df0cc-e18c-4ba4-ed37-04282d20c93f@turmel.org> (raw)
In-Reply-To: <c2c0bdf0-ebff-d52f-8f76-9fe3af3d58bb@steinmetznet.com>
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
prev parent reply other threads:[~2020-04-28 14:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-26 17:49 Hard Drive Partition Table shows partition larger than drive Robert Steinmetz
2020-04-26 20:21 ` Wols Lists
2020-04-27 14:40 ` Robert Steinmetz
2020-04-27 17:54 ` Phil Turmel
2020-04-28 14:28 ` Robert Steinmetz
2020-04-28 14:36 ` Phil Turmel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=407df0cc-e18c-4ba4-ed37-04282d20c93f@turmel.org \
--to=philip@turmel.org \
--cc=antlists@youngman.org.uk \
--cc=linux-raid@vger.kernel.org \
--cc=rob@steinmetznet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).