coreos-installer icon indicating copy to clipboard operation
coreos-installer copied to clipboard

Partition saving should handle converting MBR partitions to GPT

Open prestist opened this issue 2 years ago • 2 comments

Feature Request

Desired Feature

Now that partition saving bails when its not able to save partitions that are found on a MBR device, we need to have a way to convert the listed save partitions that are MBR partitions to GPT partitions and save them.

Other Information

This request is expecting issue 816 to be resolved first.

prestist avatar Aug 16 '22 18:08 prestist

Ok, I am currently in the midst of looking into how to convert MBR partition entries into GPT entries, though I have already ran into a question. It looks like GPT has a field called Partition type GUIDs which you can read about here. To my eyes I dont see anything that would indicate a similar concept in MBR.

What should I do about these special GUIDS? Should I set it as "00000000-0000-0000-0000-000000000000" and let the OS or another app interrogate the saved partitions? OR should I try for a best effort and handle a few common cases?(I say this with less understanding that I would need to do this atm)

prestist avatar Oct 31 '22 15:10 prestist

MBR has partition type codes, which are a single byte. Most of the possible codes aren't relevant to us, and all of the relevant ones should have corresponding GPT type GUIDs. If we see a type code we don't recognize, I think we should just convert it to a suitable fallback GPT type GUID. AFAIK Linux ignores the type codes/GUIDs anyway, and CoreOS doesn't support dual-booting, so it should be fine to treat the type code conversion as best-effort.

bgilbert avatar Oct 31 '22 19:10 bgilbert