1<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-booting-from-usb">
2 <title>Booting from a USB Drive</title>
3 <para>
4 For systems without CD drive, the NixOS live CD can be booted from a
5 USB stick. You can use the <literal>dd</literal> utility to write
6 the image: <literal>dd if=path-to-image of=/dev/sdX</literal>. Be
7 careful about specifying the correct drive; you can use the
8 <literal>lsblk</literal> command to get a list of block devices.
9 </para>
10 <note>
11 <title>On macOS</title>
12 <programlisting>
13$ diskutil list
14[..]
15/dev/diskN (external, physical):
16 #: TYPE NAME SIZE IDENTIFIER
17[..]
18$ diskutil unmountDisk diskN
19Unmount of all volumes on diskN was successful
20$ sudo dd if=nix.iso of=/dev/rdiskN
21</programlisting>
22 <para>
23 Using the 'raw' <literal>rdiskN</literal> device instead of
24 <literal>diskN</literal> completes in minutes instead of hours.
25 After <literal>dd</literal> completes, a GUI dialog "The disk
26 you inserted was not readable by this computer" will pop up,
27 which can be ignored.
28 </para>
29 </note>
30 <para>
31 The <literal>dd</literal> utility will write the image verbatim to
32 the drive, making it the recommended option for both UEFI and
33 non-UEFI installations.
34 </para>
35</section>