Merge pull request #31068 from dalaing/fdisk-examples

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

authored by Samuel Leathers and committed by GitHub 7becd38c 40969dfe

+115 -57
-48
nixos/doc/manual/installation/installing-uefi.xml
··· 1 - <section xmlns="http://docbook.org/ns/docbook" 2 - xmlns:xlink="http://www.w3.org/1999/xlink" 3 - xmlns:xi="http://www.w3.org/2001/XInclude" 4 - version="5.0" 5 - xml:id="sec-uefi-installation"> 6 - 7 - <title>UEFI Installation</title> 8 - 9 - <para>NixOS can also be installed on UEFI systems. The procedure 10 - is by and large the same as a BIOS installation, with the following 11 - changes: 12 - 13 - <itemizedlist> 14 - <listitem> 15 - <para>You should boot the live CD in UEFI mode (consult your 16 - specific hardware's documentation for instructions). You may find 17 - the <link 18 - xlink:href="http://www.rodsbooks.com/refind">rEFInd 19 - boot manager</link> useful.</para> 20 - </listitem> 21 - <listitem> 22 - <para>Instead of <command>fdisk</command>, you should use 23 - <command>gdisk</command> to partition your disks. You will need to 24 - have a separate partition for <filename>/boot</filename> with 25 - partition code EF00, and it should be formatted as a 26 - <literal>vfat</literal> filesystem.</para> 27 - </listitem> 28 - <listitem> 29 - <para>Instead of <option>boot.loader.grub.device</option>, 30 - you must set <option>boot.loader.systemd-boot.enable</option> to 31 - <literal>true</literal>. <command>nixos-generate-config</command> 32 - should do this automatically for new configurations when booted in 33 - UEFI mode.</para> 34 - </listitem> 35 - <listitem> 36 - <para>After having mounted your installation partition to 37 - <code>/mnt</code>, you must mount the <code>boot</code> partition 38 - to <code>/mnt/boot</code>.</para> 39 - </listitem> 40 - <listitem> 41 - <para>You may want to look at the options starting with 42 - <option>boot.loader.efi</option> and <option>boot.loader.systemd-boot</option> 43 - as well.</para> 44 - </listitem> 45 - </itemizedlist> 46 - </para> 47 - 48 - </section>
+114 -8
nixos/doc/manual/installation/installing.xml
··· 6 6 7 7 <title>Installing NixOS</title> 8 8 9 + <para>NixOS can be installed on BIOS or UEFI systems. The procedure 10 + for a UEFI installation is by and large the same as a BIOS installation. The differences are mentioned in the steps that follow.</para> 11 + 9 12 <orderedlist> 10 13 11 - <listitem><para>Boot from the CD.</para></listitem> 14 + <listitem><para>Boot from the CD.</para> 15 + <variablelist> 16 + <varlistentry><term>UEFI systems</term> 17 + <listitem><para>You should boot the live CD in UEFI mode 18 + (consult your specific hardware's documentation for instructions). 19 + You may find the <link xlink:href="http://www.rodsbooks.com/refind">rEFInd boot 20 + manager</link> useful.</para></listitem></varlistentry></variablelist></listitem> 12 21 13 22 <listitem><para>The CD contains a basic NixOS installation. (It 14 23 also contains Memtest86+, useful if you want to test new hardware). ··· 50 59 <itemizedlist> 51 60 52 61 <listitem><para>For partitioning: 53 - <command>fdisk</command>.</para></listitem> 62 + <command>fdisk</command>. 63 + <screen> 64 + # fdisk /dev/sda # <lineannotation>(or whatever device you want to install on)</lineannotation> 65 + -- for UEFI systems only 66 + > n # <lineannotation>(create a new partition for /boot)</lineannotation> 67 + > 3 # <lineannotation>(make it a partition number 3)</lineannotation> 68 + > # <lineannotation>(press enter to accept the default)</lineannotation> 69 + > +512M # <lineannotation>(the size of the UEFI boot partition)</lineannotation> 70 + > t # <lineannotation>(change the partition type ...)</lineannotation> 71 + > 3 # <lineannotation>(... of the boot partition ...)</lineannotation> 72 + > 1 # <lineannotation>(... to 'UEFI System')</lineannotation> 73 + -- for BIOS or UEFI systems 74 + > n # <lineannotation>(create a new partition for /swap)</lineannotation> 75 + > 2 # <lineannotation>(make it a partition number 2)</lineannotation> 76 + > # <lineannotation>(press enter to accept the default)</lineannotation> 77 + > +8G # <lineannotation>(the size of the swap partition, set to whatever you like)</lineannotation> 78 + > n # <lineannotation>(create a new partition for /)</lineannotation> 79 + > 1 # <lineannotation>(make it a partition number 1)</lineannotation> 80 + > # <lineannotation>(press enter to accept the default)</lineannotation> 81 + > # <lineannotation>(press enter to accept the default and use the rest of the remaining space)</lineannotation> 82 + > a # <lineannotation>(make the partition bootable)</lineannotation> 83 + > x # <lineannotation>(enter expert mode)</lineannotation> 84 + > f # <lineannotation>(fix up the partition ordering)</lineannotation> 85 + > r # <lineannotation>(exit expert mode)</lineannotation> 86 + > w # <lineannotation>(write the partition table to disk and exit)</lineannotation></screen></para></listitem> 54 87 55 88 <listitem><para>For initialising Ext4 partitions: 56 89 <command>mkfs.ext4</command>. It is recommended that you assign a ··· 67 100 <listitem><para>For creating swap partitions: 68 101 <command>mkswap</command>. Again it’s recommended to assign a 69 102 label to the swap partition: <option>-L 70 - <replaceable>label</replaceable></option>.</para></listitem> 103 + <replaceable>label</replaceable></option>. For example: 104 + 105 + <screen> 106 + # mkswap -L swap /dev/sda2</screen> 107 + 108 + </para></listitem> 109 + 110 + <listitem> 111 + <variablelist> 112 + <varlistentry><term>UEFI systems</term> 113 + <listitem><para>For creating boot partitions: 114 + <command>mkfs.fat</command>. Again it’s recommended to assign a 115 + label to the boot partition: <option>-L 116 + <replaceable>label</replaceable></option>. For example: 117 + 118 + <screen> 119 + # mkfs.fat -F 32 -L boot /dev/sda3</screen> 120 + 121 + </para></listitem></varlistentry></variablelist></listitem> 71 122 72 123 <listitem><para>For creating LVM volumes, the LVM commands, e.g., 73 124 ··· 95 146 96 147 </para></listitem> 97 148 149 + <listitem> 150 + <variablelist> 151 + <varlistentry><term>UEFI systems</term> 152 + <listitem><para>Mount the boot file system on <filename>/mnt/boot</filename>, e.g. 153 + 154 + <screen> 155 + # mount /dev/disk/by-label/boot /mnt/boot 156 + </screen> 157 + 158 + </para></listitem></varlistentry></variablelist></listitem> 159 + 98 160 <listitem><para>If your machine has a limited amount of memory, you 99 161 may want to activate swap devices now (<command>swapon 100 162 <replaceable>device</replaceable></command>). The installer (or 101 163 rather, the build actions that it may spawn) may need quite a bit of 102 - RAM, depending on your configuration.</para></listitem> 164 + RAM, depending on your configuration. 165 + 166 + <screen> 167 + # swapon /dev/sda2</screen> 168 + 169 + </para></listitem> 103 170 104 171 <listitem> 105 172 ··· 135 202 install Emacs by running <literal>nix-env -i 136 203 emacs</literal>.</para> 137 204 138 - <para>You <emphasis>must</emphasis> set the option 205 + <variablelist> 206 + 207 + <varlistentry><term>BIOS systems</term> 208 + <listitem><para>You <emphasis>must</emphasis> set the option 139 209 <option>boot.loader.grub.device</option> to specify on which disk 140 210 the GRUB boot loader is to be installed. Without it, NixOS cannot 141 - boot.</para> 211 + boot.</para></listitem></varlistentry> 212 + 213 + <varlistentry><term>UEFI systems</term> 214 + <listitem><para>You <emphasis>must</emphasis> set the option 215 + <option>boot.loader.systemd-boot.enable</option> to <literal>true</literal>. 216 + <command>nixos-generate-config</command> should do this automatically for new 217 + configurations when booted in 218 + UEFI mode.</para> 219 + <para>You may want to look at the options starting with 220 + <option>boot.loader.efi</option> and <option>boot.loader.systemd-boot</option> 221 + as well.</para></listitem></varlistentry> 222 + 223 + </variablelist> 142 224 143 225 <para>If there are other operating systems running on the machine before 144 226 installing NixOS, the ··· 247 329 <example xml:id='ex-install-sequence'><title>Commands for Installing NixOS on <filename>/dev/sda</filename></title> 248 330 <screen> 249 331 # fdisk /dev/sda # <lineannotation>(or whatever device you want to install on)</lineannotation> 332 + -- for UEFI systems only 333 + > n # <lineannotation>(create a new partition for /boot)</lineannotation> 334 + > 3 # <lineannotation>(make it a partition number 3)</lineannotation> 335 + > # <lineannotation>(press enter to accept the default)</lineannotation> 336 + > +512M # <lineannotation>(the size of the UEFI boot partition)</lineannotation> 337 + > t # <lineannotation>(change the partition type ...)</lineannotation> 338 + > 3 # <lineannotation>(... of the boot partition ...)</lineannotation> 339 + > 1 # <lineannotation>(... to 'UEFI System')</lineannotation> 340 + -- for BIOS or UEFI systems 341 + > n # <lineannotation>(create a new partition for /swap)</lineannotation> 342 + > 2 # <lineannotation>(make it a partition number 2)</lineannotation> 343 + > # <lineannotation>(press enter to accept the default)</lineannotation> 344 + > +8G # <lineannotation>(the size of the swap partition)</lineannotation> 345 + > n # <lineannotation>(create a new partition for /)</lineannotation> 346 + > 1 # <lineannotation>(make it a partition number 1)</lineannotation> 347 + > # <lineannotation>(press enter to accept the default)</lineannotation> 348 + > # <lineannotation>(press enter to accept the default and use the rest of the remaining space)</lineannotation> 349 + > a # <lineannotation>(make the partition bootable)</lineannotation> 350 + > x # <lineannotation>(enter expert mode)</lineannotation> 351 + > f # <lineannotation>(fix up the partition ordering)</lineannotation> 352 + > r # <lineannotation>(exit expert mode)</lineannotation> 353 + > w # <lineannotation>(write the partition table to disk and exit)</lineannotation> 250 354 # mkfs.ext4 -L nixos /dev/sda1 251 355 # mkswap -L swap /dev/sda2 252 356 # swapon /dev/sda2 357 + # mkfs.fat -F 32 -L boot /dev/sda3 # <lineannotation>(for UEFI systems only)</lineannotation> 253 358 # mount /dev/disk/by-label/nixos /mnt 359 + # mount /dev/disk/by-label/boot /mnt/boot # <lineannotation>(for UEFI systems only)</lineannotation> 254 360 # nixos-generate-config --root /mnt 255 361 # nano /mnt/etc/nixos/configuration.nix 256 362 # nixos-install ··· 267 373 ./hardware-configuration.nix 268 374 ]; 269 375 270 - boot.loader.grub.device = "/dev/sda"; 376 + boot.loader.grub.device = "/dev/sda"; # <lineannotation>(for BIOS systems only)</lineannotation> 377 + boot.loader.systemd-boot.enable = true; # <lineannotation>(for UEFI systems only)</lineannotation> 271 378 272 379 # Note: setting fileSystems is generally not 273 380 # necessary, since nixos-generate-config figures them out ··· 279 386 }</screen> 280 387 </example> 281 388 282 - <xi:include href="installing-uefi.xml" /> 283 389 <xi:include href="installing-usb.xml" /> 284 390 <xi:include href="installing-pxe.xml" /> 285 391 <xi:include href="installing-virtualbox-guest.xml" />
+1 -1
nixos/doc/manual/release-notes/rl-1404.xml
··· 13 13 <itemizedlist> 14 14 15 15 <listitem><para>Installation on UEFI systems is now supported. See 16 - <xref linkend="sec-uefi-installation"/> for 16 + <xref linkend="sec-installation"/> for 17 17 details.</para></listitem> 18 18 19 19 <listitem><para>Systemd has been updated to version 212, which has