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/doc: Actually fix partitioning instructions. #48025

Merged

Conversation

samueldr
Copy link
Member

@samueldr samueldr commented Oct 8, 2018

The previous tentative to the fix got the order mixed up a bit. This
new fix has been re-verified to get them in the good order as per the
instructions in the following chapters.


First of all: sorry. Next: it's hard trying to write something like that when you automatically fix the wrong inputs in your head! I was not seeing "/dev/sda1", but "the root partition".

The issue was pointed out to me in private by a friend trying NixOS and following the instructions.

This'll need to be backported.


The instructions are verified on qemu with a 100GiB disk.

Now, take a moment and check where the guide wants to create the root filesystem and swap:

  • # mkfs.ext4 -L nixos /dev/sda1
  • # mkswap -L swap /dev/sda2

I am verifying that in the next output the vda1 and vda2 partitions are sized as expected.

MBR
[root@nixos:~]# parted /dev/vda -- mklabel msdos
Information: You may need to update /etc/fstab.

[root@nixos:~]# parted /dev/vda -- mkpart primary 1MiB -8GiB
Information: You may need to update /etc/fstab.

                                                                          
[root@nixos:~]# parted /dev/vda -- mkpart primary linux-swap -8GiB -1s
Information: You may need to update /etc/fstab.

[root@nixos:~]# fdisk -l /dev/vda
Disk /dev/vda: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0cadb97f

Device     Boot     Start       End   Sectors Size Id Type
/dev/vda1            2048 192937983 192935936  92G 83 Linux
/dev/vda2       192937984 209715199  16777216   8G 82 Linux swap / Solaris
GPT
[root@nixos:~]# parted /dev/vda -- mklabel gpt
Information: You may need to update /etc/fstab.

                                                                          
[root@nixos:~]# parted /dev/vda -- mkpart primary 512MiB -8GiB
Information: You may need to update /etc/fstab.

                                                                          
[root@nixos:~]# parted /dev/vda -- mkpart primary linux-swap -8GiB -1MiB
Information: You may need to update /etc/fstab.

                                                                          
[root@nixos:~]# parted /dev/vda -- mkpart ESP fat32 1MiB 512MiB
Information: You may need to update /etc/fstab.

                                                                          
[root@nixos:~]# parted /dev/vda -- set 3 boot on
Information: You may need to update /etc/fstab.

                                                                          
[root@nixos:~]# fdisk -l /dev/vda
Disk /dev/vda: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 5860F00D-3FE1-4945-8FB4-0C76A1DB23B3

Device         Start       End   Sectors  Size Type
/dev/vda1    1048576 192937983 191889408 91.5G Linux filesystem
/dev/vda2  192937984 209713151  16775168    8G Linux swap
/dev/vda3       2048   1048575   1046528  511M EFI System

Partition table entries are not in disk order.

What was done
  • ✔️ make format on the installing.xml file
  • ✔️ building the documentation
  • ✔️ Rendered here

<para>
Next, add a <emphasis>swap</emphasis> partition. The size required will
vary according to needs, here a 8GiB one is created.
<screen language="commands"># parted /dev/sda -- mkpart primary linux-swap -8GiB -1MiB</screen>
Copy link
Member

Choose a reason for hiding this comment

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

Instead of -1 we could use 100%

@grahamc
Copy link
Member

grahamc commented Oct 8, 2018

Right now, this causes parted to emit a warning that the partition is not aligned for proper performance. Not sure we can easily (or should try to) fix that here.

@grahamc
Copy link
Member

grahamc commented Oct 8, 2018

Tested, they work great.

The previous tentative to the fix got the order mixed up a bit. This
new fix has been re-verified to get them in the good order as per the
instructions in the following chapters.
@samueldr samueldr force-pushed the fix/actually-fix-partitioning-instructions branch from da4609e to 467bec3 Compare October 8, 2018 16:43
@samueldr
Copy link
Member Author

samueldr commented Oct 8, 2018

Yeah, 100% fits the bill much better!

@samueldr samueldr merged commit c3c4a92 into NixOS:master Oct 10, 2018
@samueldr samueldr deleted the fix/actually-fix-partitioning-instructions branch October 10, 2018 03:01
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