Util-Linux package development
 help / color / mirror / Atom feed
* GPT writing of unknown partition uuids
@ 2015-07-14 20:16 Scott Moser
  2015-07-15  0:37 ` Dale R. Worley
  2015-07-15 13:42 ` Karel Zak
  0 siblings, 2 replies; 8+ messages in thread
From: Scott Moser @ 2015-07-14 20:16 UTC (permalink / raw)
  To: util-linux

Hi,

I came to send the previous patch after realizing that the following is a
lossy operation if the GUID type for the partition is not known to sfdisk.

$ img="/tmp/my.img"
$ size="100M"

$ rm -f "$img"
$ truncate --size "$size" "$img"
$ GPT_PREP="9E1A2D38-C612-4316-AA26-8B49521E5A8B"
$ PT1_UUID="7EB5EBCA-1611-431B-9C80-D87300B41B3B"
$ LABEL_UUID="3C5AD185-CFBF-480D-B80C-AD089E073AC9"

$ sfdisk "$img" <<EOF
label: gpt
label-id: $LABEL_UUID
unit: sectors
1 : start=2048, size=16384, type=$GPT_PREP, uuid=$PT1_UUID
EOF

If sfdisk does not know the uuid provided, it silently falls back to
0FC63DAF-8483-4772-8E79-3D69D8477DE4 (Linux filesystem).

It seems like if the user provided you with a GUID, sfdisk should trust
them, or at very least exit failure if it refuses to use the provided
GUID.

Thoughts?
Scott

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-07-15 15:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-14 20:16 GPT writing of unknown partition uuids Scott Moser
2015-07-15  0:37 ` Dale R. Worley
2015-07-15 13:28   ` Scott Moser
2015-07-15 13:42 ` Karel Zak
2015-07-15 14:56   ` Scott Moser
2015-07-15 15:02     ` Karel Zak
2015-07-15 15:09     ` Vadim Kochan
2015-07-15 15:12       ` Vadim Kochan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox