Skip to content
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

Support gpt partition tables #19

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

matthijskooijman
Copy link

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).

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant