disko icon indicating copy to clipboard operation
disko copied to clipboard

sgdisk behaves confusingly when specifying `partitions.${name}.start = "0M"`

Open nativerv opened this issue 7 months ago • 1 comments

partitions.${name}.start = "0M" causes sgdisk to begin at the start of next free space on disk, which crashes disko with confusing errors.

This is despite the manpage setting a distinction between plain 'N' as sector numbers and 'N[K/M/G]' as logical size/byte positions, and stating that '0' is the 'next free space' position, not 0 with a letter.

In any case it would be nice to have a check for start = '0*' (and possibly any intersections which fail too) in disko as the sgdisk is an implementation detail. Start should be 1M (or whatever is physically possible minimum considering GPT and such) or not specified for the first partition, with only size being specified.

Encountered errors for reference:

  • Could not create partition 1 from 1258295296 to 1258297343 (sgdisk)
  • Failed to open key file. (cryptsetup luksFormat; not in the disko log, but when grabbed from the generated diskoScript and tried manually; not sure if this was caused by the same issue but maybe)
  • Notably it randomly succeeded once with start = "0M" and then proceeded failing again with the same disko.nix

nativerv avatar Jul 12 '24 12:07 nativerv