Hi,

mick.crane wrote:
> > > root@pumpkin:~# fdisk -l /dev/sda
> > > Disk /dev/sda: 223.57 GiB, 240057409536 bytes, 468862128 sectors
> > > ...
> > > Disklabel type: dos
> > > ...
> > > Device     Boot     Start       End   Sectors   Size Id Type
> > > /dev/sda1  *         2048 466862079 466860032 222.6G 83 Linux
> > > /dev/sda2       466864126 468860927   1996802   975M  5 Extended
> > > /dev/sda5       466864128 468860927   1996800   975M 82 Linux swap / 
> > > Solaris

Michael wrote:
> as i interpret this, the disk in questions has a dos partition table...

Indeed.

(And as mick.crane already noticed, it is a bit awkward to create an
extended partiton 2 only to fill it nearly up with logical partition 5.
I wonder what entity decided to do so.)


David Christensen wrote:
> > Did you zero your drive prior to installing Debian? Perhaps there
> > is a leftover GPT secondary partition table on disk. See below.

> on a disk with a gpt partition table, yes.
> maybe i am missing something. if so, please enlighten me!

A remnant backup GPT is a typical risk of repartitioning a USB stick
from GPT to MBR Partition Table. Such repartitioning happens e.g. if you
put a Debian installation or Live ISO onto a previously GPT partitioned
stick.
(xorriso-dd-target zeros the last block of the target stick in order to
prevent partition editors from re-creating the previous GPT partitioning.)


> > Your disk has 468862128 sectors. A GPT secondary partition table
> >  should start 33 sectors before the end of the disk:

Here i disagree. The size of the GPT partition array is adjustable.

32 blocks of 4 entries each is a usual size. But actually you have to
read from the GPT header block the 4 bytes beginning at offset 80 as
little-endian number to get the number of array blocks (by dividing by 4).
The start block of the partition array is adjustable, too: Offset 72,
8 bytes as 64-bit little-endian number.

The position of the GPT header is always 512-byte block 1 for the primary
partition table and the last valid block address of the device for the
backup table.

Specs for GPT are part of the UEFI specs. Current is:
  https://uefi.org/specs/UEFI/2.10/05_GUID_Partition_Table_Format.html
(I myself am still reading version 2.6 ...)


> > Run the following command to see if there is a GPT secondary partition
> > table on your disk:
> > # dd bs=512 count=33 if=/dev/sda skip=468862095 | hexdump -C

So i would rather propose to inspect the last block, whether it begins
by the bytes "EFI PART\000\000\001\000" (meaning GPT version 1.0):

  dd bs=512 count=1 if=/dev/sda skip=468862127 | hexdump -C


Have a nice day :)

Thomas

Reply via email to