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
Ideally we shouldn't have borked partitions on the golden image that has been just written (if there are any, we have much bigger problems). Unallocated shouldn't be a problem either, parttype is part of GPT or MBR table, it's not read from the filesystem or similar.
Here's a test with an unformatted partition:
dd if=/dev/zero of=test.img bs=4M count=1
cgdisk test.img # Create a some GPT partitions with empty space and random types
sudo losetup -fP test.img
lsblk -J -o PATH,PARTN,PARTTYPE /dev/loop0
3 partitions with parttype != null, last partition is number 3
There's nothing out of the ordinary in the output. I also tested MBR logical & extended partitions and that requires some special care when handling... but we don't use them, nobody uses them anymore, there's no point in supporting that.
So it should be safe to fall back to counting partitions. If you want to be super mega ultra hyper extra safe, you can add PTTYPE to the output and if it's "dos" (MBR) try to handle logical partitions, but it's not worth the effort.
Restore PARTN that was removed in 24f2e0b, then do one or more of the following when PARTN is not available:
The text was updated successfully, but these errors were encountered: