Support gpt partition tables#19
Open
matthijskooijman wants to merge 4 commits into
Open
Conversation
This removes the old disk id from the info passed to sfdisk, forcing it to generate a new disk id instead of preserving the old disk id when updating the partition table. This allows removing the code that randomizes the disk id after sfdisk updated the partition table. Also note that this code was previously already redudundant because after initializing there is more code that changes the disk id if it is identical (to support the non-initializing flow, but that is also run when initializing).
This removes some duplicate code, preparing for making that code more complex to support GPT in an upcoming commit.
The sfdisk command has a convenient `--disk-id` option, saving the need to use grep to parse fdisk output.
The sfdisk command already handles most of what is needed. This just removes the last-lba entry from sfdisk partition info (which is based on the source disk size and would otherwise limit the available destination space, if it is omitted the entire destination disk is usable), and makes change_disk_id support generating a longer UUID disk id when a GPT table is in use.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is something I needed to make rpi-clone on an orange pi 5 running Armbian, which uses GPT for its SD-card partitions. This was tested in combination with billw2#140 for the base changes to make Armbian work at all (I will rebase that PR as well soon, but it is a bit more complicated).