You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a GPT-partitioned image where the first partition
needs to start at block 64. The problem is that fdisk/sfdisk is unable to
replicate this partition layout using an sfdisk script, because the
generated script doesn't work when it's read back in.
This seems to be a problem with interpreting the "table-length" value.
It appears to be multiplied by 4 instead of divided by 4 when checking
sector limits.
# ls -l /tmp/bmb_root
-rw-r--r-- 1 smurf smurf 1170228224 Jun 25 22:16 /tmp/bmb_root
# bc
bc 1.07.1
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
1170228224/512-34
2285568
# cat /tmp/lb ### minimum/maximum working LBA values
label: gpt
label-id: 3C0E3DAC-3069-354E-BA0E-CB74029F5A5C
device: /tmp/bmb_root
unit: sectors
table-length: 8
first-lba: 34
last-lba: 2285568
# sfdisk /tmp/bmb_root </tmp/lb
Checking that no-one is using this disk right now ... OK
Disk /tmp/bmb_root: 1,1 GiB, 1170228224 bytes, 2285602 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 3C0E3DAC-3069-354E-BA0E-CB74029F5A5C
Created a new GPT disklabel (GUID: 3C0E3DAC-3069-354E-BA0E-CB74029F5A5C).
Partition table length changed from 128 to 8.
New situation:
Disklabel type: gpt
Disk identifier: 3C0E3DAC-3069-354E-BA0E-CB74029F5A5C
# sfdisk -d /tmp/bmb_root
label: gpt
label-id: 3C0E3DAC-3069-354E-BA0E-CB74029F5A5C
device: /tmp/bmb_root
unit: sectors
first-lba: 4
last-lba: 2285598
table-length: 8
#
Note the shifting "last-lba" value.
The text was updated successfully, but these errors were encountered:
Cf. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=931087
I have created a GPT-partitioned image where the first partition
needs to start at block 64. The problem is that fdisk/sfdisk is unable to
replicate this partition layout using an sfdisk script, because the
generated script doesn't work when it's read back in.
This seems to be a problem with interpreting the "table-length" value.
It appears to be multiplied by 4 instead of divided by 4 when checking
sector limits.
Note the shifting "last-lba" value.
The text was updated successfully, but these errors were encountered: