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-booting-from-usb">
6
7<title>Booting from a USB Drive</title>
8
9<para>For systems without CD drive, the NixOS live CD can be booted from
10a USB stick. You can use the <command>dd</command> utility to write the image:
11<command>dd if=<replaceable>path-to-image</replaceable>
12of=<replaceable>/dev/sdb</replaceable></command>. Be careful about specifying the
13correct drive; you can use the <command>lsblk</command> command to get a list of
14block devices.</para>
15
16<para>The <command>dd</command> utility will write the image verbatim to the drive,
17making it the recommended option for both UEFI and non-UEFI installations. For
18non-UEFI installations, you can alternatively use
19<link xlink:href="http://unetbootin.sourceforge.net/">unetbootin</link>. If you
20cannot use <command>dd</command> for a UEFI installation, you can also mount the
21ISO, copy its contents verbatim to your drive, then either:
22
23<itemizedlist>
24 <listitem>
25 <para>Change the label of the disk partition to the label of the ISO
26 (visible with the blkid command), or</para>
27 </listitem>
28 <listitem>
29 <para>Edit <filename>loader/entries/nixos-livecd.conf</filename> on the drive
30 and change the <literal>root=</literal> field in the <literal>options</literal>
31 line to point to your drive (see the documentation on <literal>root=</literal>
32 in <link xlink:href="https://www.kernel.org/doc/Documentation/kernel-parameters.txt">
33 the kernel documentation</link> for more details).</para>
34 </listitem>
35</itemizedlist>
36</para>
37
38</section>