-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add function write_bootable_protective_mbr_into
#132
Add function write_bootable_protective_mbr_into
#132
Conversation
f40e53a
to
d352a99
Compare
Ahhh yeah I know actually I had an HP laptop years ago that had that issue I don't think we need an API change for that. I would always make that partition use the bootflag. It's not like it's used anyway. So I propose you remove the parameter and always put the bootflag. The protective MBR is not meant to be used like it is a usable partition table. It's just an information for the OS to tell to use GPT instead. It doesn't even cover partitions that are too big. @bgilbert do you have an opinion on this? |
Our system uses gptman both at build time (for building the initial boot image) and at runtime (for updating the boot disk and for provisioning the data disks.) It's not hard to imagine a scenario where that approach would be problematic for us - say a system is configured to boot from a data disk before the OS disk. The BIOS would skip the data disk initially, but then after it'd been provisioned, it would attempt to boot from its MBR, leaving the system unbootable without manual intervention. |
bc47325
to
f75abbe
Compare
To be fair, you don't need to write the protective MBR if you don't want to. The BIOS will skip the disk if it doesn't have a DOS partition table. (I tested on my machine) In doubt I don't mind that we add this functionality but I want to avoid an API break. Do you mind duplicating the function? |
We found that some tools do not recognise a disk as GPT if there is no protective MBR present.
Sure thing! |
…o separate fn to avoid API break
write_bootable_protective_mbr_into
It's released in https://github.com/rust-disk-partition-management/gptman/releases/tag/v1.1.0 I should have rename the PR before merging oops! ^_^ We're currently 2 maintainers on the project but I think it would be great to have more. If by any chance you or anyone you know (who work with this crate) would be interested in maintaining the project please let me know! |
Sure, I'd be happy to help out. |
It's very low maintenance tbh! Just the CLI gets annoying with the update but I'm still deciding to remove it. The invitation should be on your way. |
We're using gptman to build a bootable disk image, that needs to boot on both BIOS and UEFI systems. We've found that some legacy BIOS systems don't consider a disk to be bootable unless the bootable flag is set on the PMBR.
This change is an API break, if you'd prefer to add a separate function or prevent an API break some other way, let me know!