1 # Booting from a USB flash drive {#sec-booting-from-usb}
3 The image has to be written verbatim to the USB flash drive for it to be
4 bootable on UEFI and BIOS systems. Here are the recommended tools to do that.
6 ## Creating bootable USB flash drive with a graphical tool {#sec-booting-from-usb-graphical}
8 Etcher is a popular and user-friendly tool. It works on Linux, Windows and macOS.
10 Download it from [balena.io](https://www.balena.io/etcher/), start the program,
11 select the downloaded NixOS ISO, then select the USB flash drive and flash it.
14 Etcher reports errors and usage statistics by default, which can be disabled in
18 An alternative is [USBImager](https://bztsrc.gitlab.io/usbimager),
19 which is very simple and does not connect to the internet. Download the version
20 with write-only (wo) interface for your system. Start the program,
21 select the image, select the USB flash drive and click "Write".
23 ## Creating bootable USB flash drive from a Terminal on Linux {#sec-booting-from-usb-linux}
25 1. Plug in the USB flash drive.
26 2. Find the corresponding device with `lsblk`. You can distinguish them by
28 3. Make sure all partitions on the device are properly unmounted. Replace `sdX`
29 with your device (e.g. `sdb`).
35 4. Then use the `dd` utility to write the image to the USB flash drive.
38 sudo dd bs=4M conv=fsync oflag=direct status=progress if=<path-to-image> of=/dev/sdX
41 ## Creating bootable USB flash drive from a Terminal on macOS {#sec-booting-from-usb-macos}
43 1. Plug in the USB flash drive.
44 2. Find the corresponding device with `diskutil list`. You can distinguish them
46 3. Make sure all partitions on the device are properly unmounted. Replace `diskX`
47 with your device (e.g. `disk1`).
50 diskutil unmountDisk diskX
53 4. Then use the `dd` utility to write the image to the USB flash drive.
56 sudo dd if=<path-to-image> of=/dev/rdiskX bs=4m
59 After `dd` completes, a GUI dialog "The disk
60 you inserted was not readable by this computer" will pop up, which can
64 Using the 'raw' `rdiskX` device instead of `diskX` with dd completes in
65 minutes instead of hours.
68 5. Eject the disk when it is finished.
71 diskutil eject /dev/diskX