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

nixos manual: Adds some examples of how to use fdisk. #31068

Merged
merged 1 commit into from Dec 17, 2017
Merged

nixos manual: Adds some examples of how to use fdisk. #31068

merged 1 commit into from Dec 17, 2017

Conversation

dalaing
Copy link
Contributor

@dalaing dalaing commented Nov 1, 2017

It's a fairly basic usage, but it makes explicity the fact that
you should at least have a main partition and a swap partition,
and will save some users a bit of internet searching while they
are getting set up.

Motivation for this change

I know a few people who were curious about NixOS but stopped at the point of the manual that said "Use fdisk" with no further information. I started writing this PR to address that, but as I started writing I remembered that there were quite a few points of confusion around the BIOS vs UEFI instructions when my team were all installing NixOS, so I decided to have a go at streamlining that as well - the plan being to at least partly address #9096.

Other than that, I don't want to modify much else in this PR - mostly to try to keep the scope of the change as small as possible.

It took a bit of effort to dig the requirements for partitions and formatting under the BIOS and UEFI schemes out of the various threads on the internet where people are mostly answering questions about what specs and standards require with examples of what works for them, which is often quite different or fragile.

I'm not particularly keen on trying to go through that process for everything else that is already in the guide, like whether the refind instructions are still valid for example.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@dalaing
Copy link
Contributor Author

dalaing commented Nov 1, 2017

I'm looking at mentioning the /boot partition as well, which might help address #9096.

@dalaing
Copy link
Contributor Author

dalaing commented Nov 1, 2017

I've updated this to mention the /boot partition, and I merged the BIOS and UEFI instructions on the way through.

Copy link
Member

@disassembler disassembler left a comment

Choose a reason for hiding this comment

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

In general, this documentation makes me happy! Thanks for submitting it!

<variablelist>
<varlistentry><term>UEFI systems</term>
<listitem><para>You should boot the live CD in UEFI mode
(consult your specific hardware's documentation for instructions).
Copy link
Member

Choose a reason for hiding this comment

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

should we be recommending the refind tool? What benefit does that give the user?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At this point I'm just copying the existing information from installing-uefi.xml into this document :)

Copy link
Member

Choose a reason for hiding this comment

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

iirc, refind is the only way to do it on mac?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is the kind of thing that motivated me to try to change as little as possible while putting this together :)

Copy link
Member

Choose a reason for hiding this comment

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

On my old laptop (2011 macbook pro) I just used systemd-boot, no refind involved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this PR I'm trying to merge existing documentation and add some information about fdisk - I don't want to involve more than that or the review will go on forever and/or I'd be writing about things I have no first hand experience with.

Maybe we can file a docs issue about refind?

<replaceable>label</replaceable></option>. For example:

<screen>
# mkfs.fat -F 32 -L boot /dev/sda3</screen>
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if it's required, but most people have the EFI boot loader on sda1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The plan behind numbering the partitions the way that I have partly to match the partition numbers in the rest of the installation documentation (sda1 for / and sda2 for /swap), and partly to simplify the merging of the BIOS and UEFI documentation.

I can try something different there, but it could be a bit dicey.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did a small amount of digging, and I don't think the EFI boot loader needs to be on any particular partition. For some reason I'm seeing sda3 popping up a few times when I google for information on this, although it's only sda3 in my proposed change to limit the scope of the change and try to merge the BIOS and UEFI instructions without it all turning into a mess.

> x # <lineannotation>(enter expert mode)</lineannotation>
> f # <lineannotation>(fix up the partition ordering)</lineannotation>
> r # <lineannotation>(exit expert mode)</lineannotation>
> w # <lineannotation>(write the partition table to disk and exit)</lineannotation>
# mkfs.ext4 -L nixos /dev/sda1
Copy link
Member

Choose a reason for hiding this comment

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

I'd put this on 2, although there's no official standard of where your root partition goes.

Copy link
Member

Choose a reason for hiding this comment

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

I'd put swap on sda3, near the end of the disk.

@@ -13,7 +13,7 @@ the following highlights:
<itemizedlist>

<listitem><para>Installation on UEFI systems is now supported. See
<xref linkend="sec-uefi-installation"/> for
<xref linkend="sec-installation"/> for
Copy link
Member

Choose a reason for hiding this comment

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

I don't see a match in these changes for where the the docbook section for sec-uefi-installation is renamed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The docbook section for sec-uefi-installation is removed, as the instructions were folded into installing.xml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, missed that in my commit, just pushed ammended to do the actual removal :)

Also unifies the BIOS and UEFI installation instructions.

It's a fairly basic usage, but it makes explicity the fact that
you should at least have a main partition and a swap partition,
and will save some users a bit of internet searching while they
are getting set up.
@dalaing
Copy link
Contributor Author

dalaing commented Dec 17, 2017

Does anyone have any more thoughts on this?

I know the partition order is a bit out of the ordinary, but it seems to work and I think it leads to a good "flow" through the document, particularly with regard to the other parts of the installation instructions that refer to the various partitions.

If this had the normal partition order, I think the flow on effects would mean that we couldn't merge the BIOS and UEFI sections, and that adding different fdisk instructions to the two different sets of instructions would increase the chance of confusing new users even more.

@grahamc
Copy link
Member

grahamc commented Dec 17, 2017

@GrahamcOfBorg eval

@disassembler
Copy link
Member

I think it's better than what's existing. Merging!

@disassembler disassembler merged commit 7becd38 into NixOS:master Dec 17, 2017
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

5 participants