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

AMI root partition table: use GPT to support >2T partitions #102174

Merged
merged 2 commits into from Oct 30, 2020

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Oct 30, 2020

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
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Member

@cole-h cole-h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diff LGTM.

Copy link
Member

@samueldr samueldr left a 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.

@@ -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
Copy link
Member

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

Copy link
Member Author

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

Copy link
Member Author

@grahamc grahamc Oct 30, 2020

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

@grahamc grahamc merged commit 38a394b into NixOS:master Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants