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
AMI root partition table: use GPT to support >2T partitions #102174
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Diff LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit, otherwise looks good.
nixos/lib/make-disk-image.nix
Outdated
@@ -28,6 +28,9 @@ | |||
# partition of reasonable size is created in addition to the root partition. | |||
# For "legacy", the msdos partition table is used and a single large root | |||
# partition is created. | |||
# For "legacy+gpt", the GPT partition table is used, a 1049K no-fs partition for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1049K? I see 1MiB later on.
I would also document that it's a BIOS Boot partition, the actual human-friendly name of the partition type that parted calls "bios_grub".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was surprised by this too.
Check out out what parted has to say:
Disk /build/nixos.raw: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 2097kB 1049kB no-fs bios_grub
2 2097kB 2146MB 2144MB ext4 primary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from sfdisk, per @samueldr's suggestion:
Device Start End Sectors Size Type
/dev/xvda1 2048 4095 2048 1M BIOS boot
/dev/xvda2 4096 10485759966 10485755871 4.9T Linux filesystem
601f3fd
to
d77ddf2
Compare
Motivation for this change
With the MBR partition table, it is impossible extend the root disk beyond 2T. This became quite a literal nightmare for me, so let's swap it to GPT. Note: NixOps refers to the root partition with
by-label/nixos
which continues to work.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)