How to create and use Live USB

From FedoraProject

(Difference between revisions)
Jump to: navigation, search
(Use the more generic 'stick' because 'device' could also include non storage units.)
(Multi Live Boot installations)
 
(127 intermediate revisions by 39 users not shown)
Line 1: Line 1:
<noinclude>
+
{{autolang|base=yes}}
[[Category:LiveMedia]]
+
[[Image:mediawriter-icon.png‎|right]]
</noinclude>
+
This page explains '''how to create and use Live USB media'''.  A Live USB system stored on flash memory, sometimes called a ''stick'', lets you boot any USB-bootable computer into a Fedora operating system environment without writing to that computer's hard disk.  The Live USB stick can feature an area to store changes to the system, called a ''persistent overlay''.  It can also have a separate area to store user account information and data such as documents and downloaded files, with optional encryption for security and peace of mind. Finally, with a non-destructive installation, pre-existing files and excess storage space on the stick are accessible from the system. Essentially, you can carry your computer with you in your pocket, booting it on nearly any system you find yourself using.
+
  
 +
This page explains '''how to create and use Fedora USB media'''.  You can write all [https://getfedora.org/ Fedora ISO images] to a USB stick, making this a convenient way on any USB-bootable computer to either install Fedora or try a 'live' Fedora environment without writing to the computer's hard disk. You will need a USB stick at least as large as the image you wish to write.
  
{{admon/note | Quick start | The process for most people is simple.  Almost all USB sticks are provided by hardware manufacturers ready to use with this process.  If you have any documents on your USB stick, it's not a bad idea to ''back them up'' before you start.
+
{{anchor|quickstarts}}
 +
{{anchor|fmw}}
 +
{{anchor|luc}}
 +
== Quickstart: Using Fedora Media Writer ==
 +
[[Image:Fedora_Live_USB_creator.png|thumb|right|Fedora Media Writer screenshot]]
  
* Download the '''LiveUSB Creator''' program from http://fedorahosted.org/liveusb-creator if you're on Windows, or install on your Linux system using PackageKit or yum.
+
For most cases, the best tool to create a Fedora USB stick is the [https://github.com/MartinBriza/MediaWriter Fedora Media Writer] utility, which was formerly known as LiveUSB Creator. It is available on Fedora, other Linux distributions using [http://flatpak.org/ Flatpak], Windows and macOS.
* Download the Live ISO image from http://fedoraproject.org/get-fedora.
+
* Insert your stick and run the '''LiveUSB Creator''' program.
+
  
Then reboot your system and use your computer's built-in function to choose the USB boot device -- usually this is a special key you hold down at boot time, such as '''F12'''. Then enjoy!
+
{{admon/important | Destructive method | This method will destroy all data on the USB stick. If you need a non-destructive write method (to preserve existing data on your USB stick) and/or support for 'data persistence', you can use the [[#litd|livecd-iso-to-disk]] utility on Fedora.}}
  
If you are into technical details or want more information, please read on.}}
+
Fedora Media Writer is graphical and easy to use. It can download recent Fedora images for you as well as writing them to the USB stick.
  
{{admon/warning | Using UNetbootin | For information about UNetbootin, see [[Common_F12_bugs#unetbootin-broken|this note]] on the F12 issues page.  UNetbootin since version 393 is able to create Fedora Live USB sticks.  If you are using an older version, you can download an upgrade from [http://unetbootin.sourceforge.net/ the UNetbootin site].}}
+
On Fedora, you can use a Fedora graphical software installation tool to install the {{package|mediawriter}} package, or use the command line:
  
 +
{{command|1=su -c 'dnf install mediawriter'}}
  
__TOC__
+
On Windows and macOS, you can download the installer from [https://github.com/MartinBriza/MediaWriter/releases the releases page]. On other Linux distributions, if they support the [http://flatpak.org/ Flatpak] application distribution system, you can download a flatpak from [https://github.com/MartinBriza/MediaWriter/releases the releases page].
  
{{admon/important | Creating Live CD ISO image | A Live USB system is created from the same ISO image file that is used to create Live CD/DVD media.  You can download ISO images for the official Fedora release from [http://fedoraproject.org/get-fedora the Fedora download site]. Consult [[How to create and use a Live CD]] for more information on creating your own customized ISO image file.}}
+
To run the tool, look for '''Fedora Media Writer''' in the system menus. When you start Fedora Media Writer, the three dots in the bottom will be flashing while the tool checks for a new Fedora release.  
  
{{admon/note | Command formats | Lines beginning with "$" indicate commands you should type (do not include the $; this represents the command line prompt); subsequent lines represent typical output.  You will need to run some commands as root.}}
+
To write the stick:
  
== System Requirements ==
+
# Choose which Fedora flavor you want to install or try.
 +
#: On the title screen, you can choose Workstation, Server or your own .iso file. Other choices (including KDE, Cinnamon, Xfce and so on) are under the "..." button at the bottom of the list.
 +
# Ensure your USB stick is plugged into the system.
 +
# Click ''Create Live USB''.
 +
# Ensure the right stick is selected.
 +
# Click ''Write to disk'' and wait for the write to complete.
 +
# Once the stick has been written, shut the system down and boot it from the USB stick (see [[#booting|the Booting section]]).
  
* A working computer running Fedora  or Windows. If you are using other Linux distributions, consider using dd or [http://unetbootin.sourceforge.net/ UNetbootin]. UNetbootin is available in the Fedora repository as well
+
After writing, your USB stick will have a changed partition layout and some systems may report it to be about 10MB large. To return your USB stick to its factory configuration, insert the drive again while Fedora Media Writer is running. The app provides you with an option to restore to the factory layout. This layout includes a single VFAT partition.
* A [[wikipedia:USB flash drive|USB flash drive]], also known as a USB stick, thumb drive, pen drive, or jump drive, with 1 GB or more of storage space, on a ''vfat'' file system (standard for almost all off-the-shelf USB media)
+
  
===Ability to boot from USB media===
+
__TOC__
  
Though most modern ones can, not all computers can boot from USB media, due to different BIOS settings and system capabilities.  If your computer cannot do so, this procedure will not be useful.  If you are not sure and don't mind downloading and installing an image on your USB drive (possibly wiping it of
+
{{anchor|booting}}
data), the only risk is wasting some time.
+
== Booting from USB sticks ==
  
If your USB stick is not in working order, this procedure may fail. Watch for error messages during the process.
+
[[Image:Bios_USB_boot.jpg|thumb|right|Set USB as first boot device. Your BIOS may be different.]]
  
Some flash drives may not be bootable by default, even if your hardware is capable of doing so. You may need to mark the partition bootable or you may just need to reformat the flash drive. See [https://fedoraproject.org/wiki/How_to_create_and_use_Live_USB#Errors_and_Solutions Errors and Solutions] below for more information.
+
Almost all modern PCs can boot from USB sticks (some very old ones may not be able to). However, precisely how you tell the system to boot from a USB stick varies substantially from system to system. First, just try this:
  
=== Check the size of your USB stick ===
+
# Power off the computer.
 +
# Plug the USB drive into a USB port.
 +
# Remove all other portable media, such as CDs, DVDs, floppy disks or other USB sticks.
 +
# Power on the computer.
 +
# If the computer is configured to automatically boot from the USB drive, you will see a screen that says "Automatic boot in 10 seconds..." with a countdown (unless you do a native UEFI boot, where you will see a rather more minimal boot menu).
  
Many USB sticks indicate the size on the packaging or the outside of the stick.
+
If the computer starts to boot off the hard drive as normal, you'll need to manually configure it to boot off the USB drive. Usually, that should work something like this:
  
If you don't know the size of the stick, or want to check it for data, you should be able to auto-mount the USB stick by inserting it into a USB portYou can check the contents and size using the graphical file managerIn Linux, you can also use the command line:
+
# Wait for a safe point to reboot.
 +
# As the machine starts to reboot, watch carefully for instructions on which key to press (usually a function key, Escape, Tab or Delete) to enter the boot device selection menu, "BIOS setup", "firmware", or "UEFI"Press and hold that key.  If you miss the window of opportunity (often only a few seconds) then reboot and try again.
 +
# Use the firmware ("BIOS") interface or the boot device menu to put your USB drive first in the boot sequenceIt might be listed as a hard drive rather than a removable drive.  Each hardware manufacturer has a slightly different method for doing so.
 +
#: '''Be careful!'''  Your computer could become unbootable or lose functionality if you change any other settings. Though these settings can be reverted, you'll need to remember what you changed in order to do so.
 +
# Save the changes, exit, and the computer should boot from the USB drive.
  
<pre>
+
If your system has a [[Unified_Extensible_Firmware_Interface|UEFI]] firmware, it will usually allow you to boot the stick in UEFI native mode or BIOS compatibility mode. If you boot in UEFI native mode and perform a Fedora installation, you will get a UEFI native Fedora installation. If you boot in BIOS compatibility mode and perform a Fedora installation, you will get a BIOS compatibility mode Fedora installation. For more information on all this, see the [[Unified_Extensible_Firmware_Interface|UEFI page]]. USB sticks written from x86_64 images with [[#fmw|Fedora Media Writer]], [[#gnome|GNOME Disk Utility]], [[#dd|dd]], other dd-style utilities, and [[#litd|livecd-iso-to-disk]] with {{code|--efi}} should be UEFI native bootable. Sticks written with other utilities may not be UEFI native bootable, and sticks written from i686 images will never be UEFI bootable.
$ df -h
+
Filesystem            Size  Used Avail Use% Mounted on
+
/dev/mapper/VolGroup00-LogVol00
+
143G  14G  122G  10% /
+
/dev/sda1              99M  12M  82M  13% /boot
+
tmpfs                1009M    0 1009M  0% /dev/shm
+
/dev/sdb1            3.9G  4.0K  3.9G  1% /media/usbdisk
+
</pre>
+
 
+
USB drives are usually mounted in /media. In this case, the device is /dev/sdb1, has a 3.9GB capacity and is almost empty.
+
 
+
Take note of "/dev/sdb1" or equivalent; you will be specifying the device name if you use the command line method.
+
  
== How to Partition ==
+
== Checking USB disk size / free space ==
  
{{admon/warning | CAUTION | This will erase all data on the USB drive!  Please read the instructions below ''carefully''.}}
+
As noted before, the disk must have a certain amount of storage space depending on the image you select. If you use a destructive method, the stick must be at least the size of the image; if you use a non-destructive method, it must have at least that much free space. Whichever operating system you are using, you can usually check this with a file manager, usually by right clicking and selecting ''Properties''. Here is a screenshot of how this looks on GNOME:
  
If the drive has not been partitioned properly (or if you are unsure), use <code>fdisk</code> to repartition it.
+
[[image:Properties_USB_size.png|thumb|350px|none]]
  
It is also possible to do a non-destructive installation of a LiveUSB image, if you have sufficient empty space. See [https://fedoraproject.org/wiki/How_to_create_and_use_Live_USB#How_to_install_non-destructively How to install non-destructively] below.
+
{{anchor|#device}}
 +
{{anchor|device}}
 +
== Identifying a stick by {{filename|/dev}} name on Linux ==
  
The <code>fdisk</code> command must be run as root.  Include only the drive name in the command, not the partition number.  '''''Be sure to select the correct disk, or you may erase important data!'''''  Check the output of "df -h" if you are unsure. For example, if your partition will be /dev/sdb1, do:
+
Most of the [[#writing|alternative writing methods]] will require you to know the {{filename|/dev}} name for your USB stick - e.g. {{filename|/dev/sdc}} - when using them on Linux. You do not need to know this in order to use [[#fmw|Fedora Media Writer]]. To find this out:
  
 +
# Insert the USB stick into a USB port.
 +
# Open a terminal and run {{command|dmesg}}.
 +
# Near the end of the output, you will see something like:
 
<pre>
 
<pre>
$ /sbin/fdisk /dev/sdb
+
[32656.573467] sd 8:0:0:0: [sdX] Attached SCSI removable disk
 
</pre>
 
</pre>
 +
where sdX will be sdb, sdc, sdd, etc. '''Take note of this label''' as it is the name of the disk you will use. We'll call it ''sdX'' from now on. If you have connected more than one USB stick to the system, be careful that you identify the correct one - often you will see a manufacturer name or capacity in the output which you can use to make sure you identified the correct stick.
  
If you don't have fdisk installed, run <code>yum install util-linux-ng</code> as root.
+
{{anchor|writing}}
 +
== Alternative USB stick writing methods ==
  
The following session output from <code>fdisk</code> shows the responses to give to the prompts. The line starting <code>Last cylinder ...</code> refers to the size of the flash drive, so may be different than in the example.
+
As explained above, the recommended method for writing the stick in most cases is [[#fmw|Fedora Media Writer]]. In this section, other tools which may be useful in specific circumstances are documented.
  
Command (m for help): '''d'''
+
{{anchor|gnome}}
Selected partition 1
+
=== Using GNOME Disk Utility (Linux, graphical, destructive) ===
+
Command (m for help): '''n'''
+
Command action
+
e  extended
+
p  primary partition (1-4)
+
'''p'''
+
Partition number (1-4): '''1'''
+
First cylinder (1-960, default 1): '''↵'''
+
Using default value 1
+
Last cylinder or +size or +sizeM or +sizeK (1-960, default 960): '''↵'''
+
Using default value 960
+
+
Command (m for help): '''t'''
+
Selected partition 1
+
Hex code (type L to list codes): '''6'''
+
Changed system type of partition 1 to 6 (FAT16)
+
+
Command (m for help): '''a'''
+
Partition number (1-4): '''1'''
+
+
Command (m for help): '''w'''
+
The partition table has been altered!
+
+
Calling ioctl() to re-read partition table.
+
+
WARNING: If you have created or modified any DOS 6.x
+
partitions, please see the fdisk manual page for additional
+
information.
+
Syncing disks.
+
  
== How to Format ==
+
{{admon/important | Destructive method | This method will destroy all data on the USB stick. If you need a non-destructive write method (to preserve existing data on your USB stick) and/or support for 'data persistence', you can use the [[#litd|livecd-iso-to-disk]] utility on Fedora.}}
  
{{admon/warning | CAUTION | This will erase all data on the USB drive!  Please read the instructions below ''carefully''.}}
+
This method is for people running Linux (or another *nix) with GNOME, Nautilus and the GNOME Disk Utility installed. Particularly, if you are using a distribution other than Fedora which does not support Flatpak, this may be the easiest available method. A standard installation of Fedora, or a standard GNOME installation of many other distributions, should be able to use this method. On Fedora, ensure the packages {{package|nautilus}} and {{package|gnome-disk-utility}} are installed. Similar graphical direct-write tools may be available for other desktops, or you may use the [[#dd|command line "direct write" method]].
  
If your USB media has sufficient free space on a ''vfat'' file system already, you do not need to perform this step.
+
# Download a Fedora image, choose a USB stick that does not contain any data you need, and connect it
 +
# Run Nautilus (Files) - for instance, open the Overview by pressing the Start/Super key, and type ''Files'', then hit enter
 +
# Find the downloaded image, right-click on it, go to '''Open With''', and click '''Disk Image Writer'''
 +
# Double-check you're really, really sure you don't need any of the data on the USB stick!
 +
# Select your USB stick as the '''Destination''', and click '''Start Restoring...'''
  
To finish, the partition must be formatted with an actual file system using <code>mkdosfs</code> as the root user.  Unmount the device before using <code>mkdosfs</code>.  In the below example, /dev/USBPARTITIONNAME might be, for example, /dev/sdb1.  '''''Be sure to select the correct partition; formatting destroys all data on it!'''''
+
{{anchor|litd}}
 +
=== Command line method: Using the ''livecd-iso-to-disk'' tool (Fedora only, non-graphical, both non-destructive and destructive methods available) ===
  
<pre>
+
{{admon/important | Potentially destructive method | This method will destroy all data on the USB stick ''if the '''--format''' parameter is passed''.}}
$ umount /dev/USBPARTITIONNAME
+
$ /sbin/mkdosfs -F 32 -n usbdisk /dev/USBPARTITIONNAME
+
</pre>
+
  
If you don't have mkdosfs installed, run "yum install dosfstools" as root.
+
The {{command|livecd-iso-to-disk}} method is slightly less reliable than Fedora Media Writer and can be used reliably only from within Fedora: it does not work in Windows or OS X, and is not supported (and will usually fail) in non-Fedora distributions. However, it supports three advanced features which FMW does not include:
  
== How to install non-destructively ==
+
# You may use a ''non-destructive'' method to create the stick, meaning existing files on the stick will not be destroyed. This is less reliable than the ''destructive'' write methods, and should be used only if you have no stick you can afford to wipe.
 +
# On live images, you can include a feature called a ''persistent overlay'', which allows changes made to persist across reboots. You can perform updates just like a regular installation to your hard disk, except that kernel updates require [[#Kernel updates|manual intervention]] and [[#limited overlay|overlay space may be insufficient]]. Without a ''persistent overlay'', the stick will return to a fresh state each time it is booted.
 +
# On live images, you can also have a separate area to store user account information and data such as documents and downloaded files, with optional encryption for security and peace of mind.
  
Skip the repartitioning and formatting step above, and simply continue with the below steps.  Please keep in mind you should have at least 1GB free.  '''It is highly recommended to make a backup copy of the data on the USB drive before proceeding''' in case something goes wrong.
+
By combining these features, you can carry your computer with you in your pocket, booting it on nearly any system you find yourself using.
  
== From a Downloaded Image ==
+
It is not a good idea to try and write a new Fedora release using the version of {{command|livecd-iso-to-disk}} in a much older Fedora release: it is best to only use a release a maximum of two versions older than the release you are trying to write.
  
=== Download an ISO ===
+
Ensure the {{package|livecd-tools}} package is installed: {{command|su -c 'dnf install livecd-tools'}}
  
(If you are using liveusb-creator - the "Graphical" method below, with a "supported" Fedora release, you can skip this step. The program will download the ISO for you.)
+
Basic examples follow. Remember to [[#device|identify your USB stick's device name]] first. In all cases, you can add the parameter {{command|--efi}} to (try to) render the stick bootable in native UEFI mode. Detailed usage information is available by running: {{command|livecd-iso-to-disk --help}} or {{command|man livecd-iso-to-disk}}.
  
You can use BitTorrent or your web browser to download a bootable image, or ISO, which you will install on your USB drive.
+
To make an existing USB stick bootable as a Fedora image - without deleting any of the data on it - make sure that the USB drive is not mounted before executing the following, and give the root password when prompted:
 +
: {{command|su -c "livecd-iso-to-disk Fedora-Workstation-Live-x86_64-{{FedoraVersionNumber|next}}-1.1.iso /dev/sdX"}}
  
Quick links:
+
In case it is not possible to boot from a disk created with the method shown above, before re-partitioning and re-formatting, often resetting the master boot record will enable booting:
* [http://fedoraproject.org/en/get-fedora Supported releases]
+
* [http://fedoraproject.org/get-prerelease Pre-releases] (Alpha and Beta; redirects to previous supported release during pre-Alpha phase)
+
* [[Releases/Rawhide|Rawhide]] daily build
+
  
You are looking for a file with "Live" in the name, usually of the form "F<version>-<architecture>-Live.iso".  For example, "F12-i686-Live.iso" is the Fedora 12 release for 32-bit Pentium Pro and compatible CPUs.  "F13-Alpha-x86_64-Live.iso" is the alpha pre-release version of Fedora 13 for 64-bit Intel-compatible CPUs. Be sure to choose the correct file for your architecture.  32-bit releases will generally run on 64-bit hardware, but will not be optimized.
+
: {{command|su -c "livecd-iso-to-disk --reset-mbr Fedora-Workstation-Live-x86_64-{{FedoraVersionNumber|next}}-1.1.iso /dev/sdX"}}
  
These instructions will also work for [[Spins Custom|Custom Spins]] of Fedora Live ISO images, including those you make yourself with Revisor (a graphical tool), or LiveCD Creator (command-line tool used by Revisor).  (Pungi is a command-line tool you can use to create installable ISOs, but not Live ISOs.)
+
{{admon/warning | CAUTION: | Using the {{command|--format}} option in the following command will erase all data on the USB drive!  Please read the instructions below ''carefully''.}}
  
If you use a LiveUSB with data persistence, you can use the "yum update" method described below to get the latest daily Rawhide RPMs (mostly for testers and not everyday use) [https://bugzilla.redhat.com/show_bug.cgi?id=446935 except for the kernel].  See [[Releases/Rawhide]] for more information about daily builds.
+
If necessary, you can have ''livecd-iso-to-disk'' re-partition and re-format the target stick:
  
Live ISOs are ''not'' made daily for Branched, Alpha, Beta, and Final phases, only at the Alpha, Beta, and Final milestones.
+
: {{command|su -c "livecd-iso-to-disk --format --reset-mbr Fedora-Workstation-Live-x86_64-{{FedoraVersionNumber|next}}-1.1.iso /dev/sdX"}}
  
=== Graphical Method - Windows or Fedora ===
+
To include a persistent filesystem for {{filename|/home}}, use the {{command|--home-size-mb}} parameter. For example:
  
Fedora LiveUSB sticks can be created in Windows and Linux using the [http://fedorahosted.org/liveusb-creator liveusb-creator].
+
: {{command|su -c "livecd-iso-to-disk --home-size-mb 2048 Fedora-Workstation-Live-x86_64-{{FedoraVersionNumber|next}}-1.1.iso /dev/sdX"}}
  
For Windows using the following steps:
+
This will create a 2 GiB filesystem that will be mounted as {{filename|/home}} each time the stick is booted, allowing you to preserve data in {{filename|/home}} across boots.
* Download liveusb-creator from http://fedorahosted.org/liveusb-creator
+
* Double click 'liveusb-creator'
+
  
 +
To enable 'data persistence' support - so changes you make to the entire live environment will persist across boots - add the {{command|--overlay-size-mb}} parameter to add a persistent data storage area to the target stick. For example:
  
If you are using Fedora, you can use Add/Remove Programs and search for liveusb-creator or on the command line:
+
: {{command|su -c "livecd-iso-to-disk --overlay-size-mb 2048 Fedora-Workstation-Live-x86_64-{{FedoraVersionNumber|next}}-1.1.iso /dev/sdX"}}
  
<pre>
+
where 2048 is the desired size (in megabytes) of the overlay. The ''livecd-iso-to-disk'' tool will not accept an overlay size value greater than 4095 for VFAT, but for ext[234] filesystems it is only limited by the available space.
$ su -c "yum install liveusb-creator"
+
{{anchor|limited overlay}}
</pre>
+
{{admon/note | Limited Lifetime of Persistent Overlay | Due to the way it's currently implemented, every single change to this form of overlay (writes AND deletes) subtracts from its free space, so it will eventually be "used up" and your USB stick will no longer boot (see this [http://thread.gmane.org/gmane.linux.kernel.device-mapper.devel/14644 dm-devel discussion] and [[LiveOS_image#Overlay_recovery|this page]] for emergency recovery). You can use {{command|dmsetup status live-rw}} to see how much space remains in the overlay: the output will contain something like {{code|snapshot 42296/204800}}, indicating that 42296 of 204800 512-byte sectors are allocated. Because of these limitations, it is advisable to use the system-level persistence sparingly, for configuration changes and important security updates only. Or, if you have sufficient disk space available, changes to the LiveOS root filesystem snapshot can be merged into a new copy of the root filesystem.  See [[LiveOS image#Merge overlay into new image|this page section]] for instructions.}}
  
 +
You can combine {{command|--home-size-mb}} and {{command|--overlay-size-mb}}, in which case data written to {{filename|/home}} will not exhaust the persistent overlay.
  
To start, run <code>liveusb-creator</code> on the command line, or on the GNOME menu, go to "Applications -> System Tools -> liveusb-creator".
+
{{anchor|dd}}
  
=== Command Line Method - Linux only ===
+
=== Command line "direct write" method (most operating systems, non-graphical, destructive) ===
  
In the following examples, replace "/path/to/ISO" with e.g. F12-Live-i686.iso or the full path to the ISO you downloaded, e.g. /tmp/F12-Live-i686.iso.
+
{{admon/important | Destructive method | This method will destroy all data on the USB stick. If you need a non-destructive write method (to preserve existing data on your USB stick) and/or support for 'data persistence', you can use the [[#litd|livecd-iso-to-disk]] utility on Fedora.}}
  
Replace /dev/USBPARTITIONNAME with the appropriate partition name.  For example, /dev/sdb1 in the example above ("Check the size of your USB drive"). '''''Be careful to specify the correct device, or you may lose important data!'''''
+
This method direct writes the image to the USB stick much like [[#fmw|Fedora Media Writer]] or [[#gnome|GNOME Disk Utility]], but uses a command line utility named {{command|dd}}. Like the other "direct write" methods, it will destroy all data on the stick and does not support any of the advanced features like data persistence, but it is a very reliable method. The {{command|dd}} tool is available on most Unix-like operating systems, including Linux distributions and OS X, and [http://www.chrysocome.net/dd a Windows port is available]. This may be your best method if you cannot use Fedora Media Writer or GNOME Disk Utility, or just if you prefer command line utilities and want a simple, quick way to write a stick.
  
The livecd-iso-to-disk method also works with netinst.iso and boot.iso files, even though these are not Live images.
+
# [[#device|Identify the name of the USB drive partition]]. If using this method on Windows, with the port linked above, the {{command|dd --list}} command should provide you with the correct name.
 +
# '''Unmount all mounted partition from that device.''' This is very important, otherwise the written image might get corrupted. You can umount all mounted partitions from the device with {{command|umount /dev/sdX*}}, where X is the appropriate letter, e.g. {{command|umount /dev/sdc*}}
 +
# Write the ISO file to the device:
 +
#: {{command|1=su -c 'dd if=/path/to/image.iso of=/dev/sdX bs=8M status=progress oflag=direct'}}
 +
# Wait until the command completes.
 +
#: If you see {{code|dd: invalid status flag: 'progress'}}, your dd version doesn't support the {{code|1=status=progress}} option and you'll need to remove it (and you won't see writing progress).
  
==== Using dd for a direct copy ====
+
{{anchor|unetbootin}}
 +
=== Using [http://unetbootin.sourceforge.net/ UNetbootin] (Windows, OS X and Linux, graphical, non-destructive) ===
  
Fedora 12 and above, you can simply use dd although the specialized tools have additional features like non destructive writing and data persistence
+
[[Image:Unetbootin_gtk3.png|thumb|right|Unetbootin screenshot]]
  
<pre>
+
{{admon/warning | Reliability not assured | Following each release, Fedora support volunteers receive reports of problems with installation images created by UNetbootin. Using the most recent version of UNetbootin available has been known to improve results. UNetbootin may work in some cases but not others - for instance, it will likely create a stick that is bootable in BIOS mode, but not UEFI mode. Fedora cannot guarantee support for UNetbootin-written images.}}
  
$ dd if=F12-Live-i686.iso of=/dev/sdX bs=8M
+
While your results may vary, it is usually the case that the [[#fmw|Fedora Media Writer]], [[#litd|livecd-iso-to-disk]], [[#gnome|GNOME]] and [[#dd|dd]] methods give better results than UNetbootin. If you encounter problems with UNetbootin, please contact the UNetbootin developers, not the Fedora developers.
  
</pre>
+
UNetbootin is a graphical, bootable USB image creator. Using it will allow you to preserve any data you have in the USB drive. If you have trouble booting, however, you may wish to try with a blank, cleanly FAT32-formatted drive.
  
Note that you want the device name (e.g. /dev/sdx) not the partition name (e.g. /dev/sdx1).
+
If you are running a 64-bit Linux distribution, UNetbootin may fail to run until you install the 32-bit versions of quite a lot of system libraries. Fedora cannot help you with this: please direct feedback on this issue to the UNetbootin developers.
  
==== Check livecd-tools ====
+
# Download the latest UNetbootin version from [http://unetbootin.sourceforge.net/ the official site] and install it. On Linux, the download is an executable file: save it somewhere, change it to be executable (using {{command|chmod ugo+x filename}} or a file manager), and then run it.
 +
# Launch UNetbootin. On Linux, you might have to type the root password.
 +
# Click on '''Diskimage''' and search for the ISO file you downloaded.
 +
# Select Type: USB drive and [[#device|choose the correct device for your stick]]
 +
# Click OK
  
Make sure the livecd-tools RPM is installed.
+
{{admon/note | Drive not visible | If you do not see ''sdX'' listed, you might have to reformat the drive. You can do this from most file manager or disk utility tools, e.g. the GNOME disk utility ("Disks") on Fedora. The FAT32 format is most likely to result in a bootable stick. This will cause you to lose all data on the drive.}}
  
<pre>
+
=== Creating a USB stick from a running live environment ===
$ rpm -q livecd-tools
+
</pre>
+
  
You will see the name of the RPM and a version number if it is installed, and no output if it is not installed.
+
If you are already running a live CD, DVD, or USB and want to convert that into a bootable USB stick, run the following command:
  
If "livecd-tools" is not installed, install it using yum.
+
: {{command|su -c "livecd-iso-to-disk /run/initramfs/livedev /dev/sdX"}}
<pre>
+
$ su -c "yum install livecd-tools"
+
</pre>
+
  
==== Run livecd-iso-to-disk script ====
+
See [[#Mounting a Live USB filesystem|this section]] for mounting the root filesystem outside of a boot.
  
Make sure that the USB drive is not mounted before executing the following, and give the root password when prompted.
+
== Troubleshooting ==
  
<pre>
+
=== Fedora Media Writer problems ===
$ su -c "livecd-iso-to-disk /path/to/ISO /dev/USBPARTITIONNAME"
+
Password:
+
Copying live image to USB stick
+
Updating boot config file
+
Installing boot loader
+
USB stick set up as live image!
+
</pre>
+
  
In case it is not possible to boot from a disk created with the method shown above, you can also tell livecd to format the medium itself. '''Note that this method causes livecd to format the disk and thus erase all the data on it''':
+
* Bugs can be reported to [https://github.com/MartinBriza/MediaWriter/issues GitHub] or [https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=mediawriter Bugzilla]. You can [http://bugz.fedoraproject.org/mediawriter browse existing Bugzilla reports]. Please report any problems you encounter that have not already been reported.
  
<pre>
+
=== livecd-iso-to-disk problems ===
$ su -c "livecd-iso-to-disk --format --reset-mbr /path/to/ISO /dev/USBPARTITIONNAME"
+
</pre>
+
  
==== Data Persistence ====
+
==== Partition isn't marked bootable! ====
 
+
Data persistence means that your files and settings will remain even after you reboot your live system.  You can perform updates just like a regular installation to your hard disk except for kernel updates which are not supported. The primary use of this feature is booting a USB stick with your live image as well as the persistent changes.
+
 
+
Use liveusb-creator, a graphical utility to do this easily. Liveusb-creator is available in the Fedora repository and for Windows users as well.
+
 
+
If you prefer the command line, you can run the following command:
+
 
+
<pre>
+
$ livecd-iso-to-disk --overlay-size-mb 512 /path/to/ISO /dev/USBPARTITIONNAME
+
</pre>
+
 
+
where 512 is the desired size (in megabytes) of the overlay. The livecd-iso-to-disk shell script won't accept an overlay size value greater than 2047 for VFAT, but for ext[23] filesystems it is only limited by the available space. You can find the livecd-iso-to-disk shell script in the LiveOS directory at the top-level of the CD image. Note that you'll need to have space on your USB stick for the live image plus your overlay plus any other data you want on the stick.
+
 
+
{{admon/note | Limited Lifetime of Persistent Overlay | One very important note about using the "primary" persistent overlay for system changes is that due to the way it's currently implemented (as a LVM copy-on-write snapshot), every single change to it (writes AND deletes) subtracts from its free space, so it will eventually be "used up" and your USB stick will no longer boot. Because of these limitations, it is advisable to use the system-level persistence sparingly, for configuration changes and important security updates only. For a truly persistent write-many (vs write-once) overlay, use the ''--home-size-mb'' option to create a home directory filesystem image for personal files. Unlike the primary system overlay image, the home.img can be re-used and loop mounted outside of the liveusb environment.}}
+
 
+
The persistent overlay status may be queried by issuing this command on the live system:
+
dmsetup status
+
The returned value may look like this:
+
 
+
live-osimg.min: 0 8388608 snapshot 2352/2352 24
+
live-rw: 0 8388608 snapshot 42296/204800 176
+
 
+
where the fraction after 'snapshot' for the logical volume is that of 512-byte sectors consumed in the overlay.
+
 
+
== From a running Live CD/DVD ==
+
 
+
If you are already running a live CD or DVD and want to convert that into a bootable USB stick, run the following command:
+
 
+
<pre>
+
$ livecd-iso-to-disk /dev/live /dev/USBPARTITIONNAME
+
</pre>
+
 
+
== How to Boot a Live USB Drive ==
+
 
+
* Power off the computer.
+
* Plug the USB drive into a USB port.
+
* Remove all other portable media, such as CD, DVD, or floppy disks.
+
* Power on the computer.
+
* If the computer is configured to automatically boot off of the USB drive, you will see a screen that says "Automatic boot in 10 seconds..." with a countdown.
+
* If the computer starts to boot off the hard drive, you'll need to manually configure it to boot off the USB drive.
+
** Wait for a safe point to reboot safely.
+
** As the machine starts to reboot, watch carefully for instructions on which key to press (usually a function key or Escape) to enter the boot device selection menu, or "BIOS setup".  Press and hold that key.  If you miss the window of opportunity (often only a few seconds) then reboot and try again.
+
** Use the BIOS setup menu to put your USB drive first in the boot sequence.  It might be listed as a hard drive rather than a removable drive.  Each hardware manufacturer has a slightly different method for doing so.  '''Use caution!'''  Your computer could become unbootable or lose functionality if you change any other settings.  Though these settings can be reverted, you'll need to remember what you changed in order to do so.
+
** Save the changes, exit, and the computer should boot the Live USB drive.
+
 
+
{{Anchor|dvd2usb}}
+
 
+
== How to Make a bootable USB Drive to Install Fedora instead of using a physical DVD ==
+
 
+
=== Why would I want to make a USB device installer from the DVD instead of the LiveCD? ===
+
 
+
If you are installing to a netbook, or otherwise do not have an optical drive (or burner, or media), and you want the extra flexibility of using the regular DVD installer instead of the Live image, then this method will give a useful install medium. You are then free to customize package selection, choose which filesystem you prefer for your rootfs (ext3 OR ext4, btrfs, etc), and rescue mode is available.
+
 
+
=== Preparing the USB stick ===
+
 
+
The easiest setup method is to install and use '''unetbootin''' or Fedora's own '''livecd-iso-to-disk''' script from livecd-tools. Note that the liveusb-creator GUI, however, does not support putting the DVD installer on USB.
+
 
+
The manual setup method follows:
+
 
+
First, download the iso file Fedora-12-i386-DVD.iso from a Fedora mirror.
+
Then loop mount the iso on a local mount point such as /mnt/tmp
+
 
+
<pre>
+
# mount -o loop /path-to-iso/Fedora-12-i386-DVD.iso /mnt/tmp
+
</pre>
+
 
+
Now plug in the USB stick and then copy the main iso file as well as the images directory from the /mnt/tmp/ directory to the root directory of the USB stick.
+
 
+
<pre>
+
# cp /path-to-iso/Fedora-12-i386-DVD.iso /media/usbdisk/
+
# cp -r /mnt/tmp/images /media/usbdisk/
+
</pre>
+
 
+
Next download the boot.iso file from a rawhide mirror from the development/i386/os/images/ directory on the mirror and store it on your computer's hard drive.
+
 
+
From your running {{FedoraVersion||current}} system (including an {{FedoraVersion||current}} livecd) make sure you have the livecd-tools package installed by doing:
+
<pre>
+
yum install livecd-tools
+
</pre>
+
 
+
Use the "mount" command to find the USB stick (e.g., /dev/sdb1) or look at /var/log/messages to find where the stick was mounted.
+
Next umount the USB stick either from the desktop icon or using the umount command - but keep a note of where the USB stick is attached to the filesystem, e.g., /dev/sdb1
+
 
+
Now as root run:
+
<pre>
+
# livecd-iso-to-disk path-to/boot.iso /dev/sdb1
+
</pre>
+
 
+
If the stick is not bootable, then refer to the information below to make it bootable, otherwise this command will fail.
+
 
+
You should now have a bootable USB stick which will run an {{FedoraVersion||current}} install. When you boot the stick, select a hard drive install and select the drive as /dev/sdb1 (or your USB device drive) and the path should be /
+
 
+
The remainder of the install should be the same as for using a DVD in an optical drive, but when you select options make sure that you select your disk partitioning carefully if you are doing custom partitioning and also make sure that the bootloader is installed on the correct drive - by default it will be installed on the USB stick so you will need to change it to the master boot record on the hard drive.
+
 
+
== Errors and Solutions ==
+
 
+
=== liveusb-creator problems ===
+
 
+
* Try the [https://fedorahosted.org/liveusb-creator/wiki/FAQ liveusb-creator FAQ].
+
* Bugs are tracked in [https://fedorahosted.org/liveusb-creator/ Trac] - see e.g. [https://fedorahosted.org/liveusb-creator/report/1 existing tickets].  Please [https://fedorahosted.org/liveusb-creator/newticket open a new ticket] if you encounter any problems that have not already been reported.
+
* The [https://fedorahosted.org/mailman/listinfo/liveusb-creator liveusb-creator mailing list] has [https://fedorahosted.org/pipermail/liveusb-creator/ archives] which may also be useful.
+
 
+
=== Partition isn't marked bootable! ===
+
 
+
If you get the following message, you need to mark the partition bootable.
+
<pre>
+
$ livecd-iso-to-disk Fedora-<release>-Live-i686.iso /dev/sdb1
+
Partition isn't marked bootable!
+
You can mark the partition as bootable with
+
    $ /sbin/parted /dev/sdb
+
    (parted) toggle N boot
+
    (parted) quit
+
Cleaning up to exit...
+
</pre>
+
  
To mark the partition bootable,
+
If you get the message {{code|Partition isn't marked bootable!}}, you need to mark the partition bootable. To do this, run {{command|su -c 'parted /dev/sdX'}}, and use the {{code|toggle N boot}} command, where X is the appropriate letter and N is the partition number. For example:
 
<pre>
 
<pre>
 
$ parted /dev/sdb
 
$ parted /dev/sdb
Line 344: Line 209:
 
(parted) print                                                             
 
(parted) print                                                             
 
Model: Imation Flash Drive (scsi)
 
Model: Imation Flash Drive (scsi)
Disk /dev/sdb: 1062MB
+
Disk /dev/sdX: 1062MB
 
Sector size (logical/physical): 512B/512B
 
Sector size (logical/physical): 512B/512B
 
Partition Table: msdos
 
Partition Table: msdos
Line 354: Line 219:
 
(parted) print                                                     
 
(parted) print                                                     
 
Model: Imation Flash Drive (scsi)
 
Model: Imation Flash Drive (scsi)
Disk /dev/sdb: 1062MB
+
Disk /dev/sdX: 1062MB
 
Sector size (logical/physical): 512B/512B
 
Sector size (logical/physical): 512B/512B
 
Partition Table: msdos
 
Partition Table: msdos
Line 365: Line 230:
 
</pre>
 
</pre>
  
=== Partitions need a filesystem label! ===
+
==== Partitions need a filesystem label! ====
  
If you get the following message, you need to label the partition.
+
If you get the message {{code|Need to have a filesystem label or UUID for your USB device}}, you need to label the partition: {{command|su -c "dosfslabel /dev/sdX LIVE"}}
<pre>
+
$ livecd-iso-to-disk Fedora-<release>-Live-i686.iso /dev/sdb1
+
Need to have a filesystem label or UUID for your USB device
+
Label can be set with /sbin/dosfslabel
+
Cleaning up to exit...
+
</pre>
+
  
To label the partition.
+
==== Partition has different physical/logical endings! ====
<pre>
+
$ dosfslabel /dev/sdb1 usbdisk
+
</pre>
+
  
=== Partition has different physical/logical endings! ===
+
If you get this message from fdisk, you may need to reformat the flash drive when writing the image, by passing {{code|--format}} when writing the stick.
  
If you get the following message, you may need to reformat the flash drive.
+
==== MBR appears to be blank! ====
<pre>
+
$ fdisk -l /dev/sdb
+
  
Disk /dev/sdb: 2029 MB, 2029518848 bytes
+
If your test boot reports a corrupted boot sector, or you get the message {{code|MBR appears to be blank.}}, you need to install or reset the master boot record (MBR), by passing {{code|--reset-mbr}} when writing the stick.
129 heads, 32 sectors/track, 960 cylinders
+
Units = cylinders of 4128 * 512 = 2113536 bytes
+
  
Device Boot      Start        End      Blocks  Id  System
+
==== livecd-iso-to-disk on other Linux distributions ====
/dev/sdb1  *          1        961    1981936    6  FAT16
+
Partition 1 has different physical/logical endings:
+
phys=(967, 128, 32) logical=(960, 31, 32)
+
</pre>
+
  
=== MBR appears to be blank! ===
+
{{command|livecd-iso-to-disk}} is not meant to be run from a non-Fedora system. Even if it happens to run and write a stick apparently successfully from some other distribution, the stick may well fail to boot. Use of {{command|livecd-iso-to-disk}} on any distribution other than Fedora is unsupported and not expected to work: please use an alternative method, such as [[#fmw|Fedora Media Writer]].
  
If your test boot reports a corrupted boot sector, or you get the following message, you need to install MBR.
+
=== Ubuntu's ''usb-creator'' ===
<pre>
+
$ livecd-iso-to-disk Fedora-<release>-Live-i686.iso /dev/sdb1
+
MBR appears to be blank.
+
You can add an MBR to this device with
+
Cleaning up to exit...
+
</pre>
+
  
 +
Ubuntu and derivative Linux distributions have a {{command|usb-creator}} program similar to Fedora Media Writer. This '''does not work''' with Fedora ISO images, it silently rejects them. usb-creator requires the ISO to have a Debian layout, with a {{filename|/.disk/info}} file and a casper directory. Do not attempt to use this utility to write a Fedora ISO image.
  
To install MBR,
+
== Testing a USB stick using qemu ==
<pre>
+
 
$ cat /usr/share/syslinux/mbr.bin > /dev/sdb
+
You can test your stick using QEMU as shown in the screenshot below.
</pre>
+
  
=== SYSLINUX Boot Error! ===
+
[[Image:Screenshot_qemu_gtk3.png‎|thumb]]
  
If you were using the script on previous Red Hat or Fedora Release and getting following error message,
+
For example, you could type the following commands:
 
<pre>
 
<pre>
SYSLINUX 3.xx ... EBIOS Load error - Boot error
+
su -c 'umount /dev/sdX1'
 +
qemu -hda /dev/sdX -m 1024 -vga std
 
</pre>
 
</pre>
 +
== Mounting a Live USB filesystem ==
  
You may need to upgrade your syslinux to 3.50 or higher from Peter Anvin's [http://syslinux.zytor.com/faq.php SYSLINUX] .
+
You can use the [https://github.com/livecd-tools/livecd-tools/blob/master/tools/liveimage-mount ''liveimage-mount''] script in the {{package|livecd-tools}} package to mount an attached Live USB device or other LiveOS image, such as an ISO or Live CD.  This is convenient when you want to copy in or out some file from the LiveOS filesystem on a Live USB, or just examine the files in a Live ISO or Live CD.
  
* http://www.kernel.org/pub/linux/utils/boot/syslinux/RPMS/i386/
+
== Kernel updates for ''livecd-iso-to-disk''-written images with a persistent overlay ==
  
== Testing Live Image on USB ==
+
If you have [[#limited overlay|sufficient overlay space]] to accommodate a kernel update on a Live USB installation, the kernel and initramfs will be installed to the /boot directory.  To put these into service they must be moved to the /syslinux directory of the installation partition.  This is accessible from the running Live USB filesystem at the /run/initramfs/live mount point. The new initramfs (such as initramfs-4.9.13-200.fc25.x86_64.img) and kernel (such as vmlinuz-4.9.13-200.fc25.x86_64) should be moved to replace the /run/initramfs/live/syslinux/initrd.img and /run/initramfs/live/syslinux/vmlinuz files, respectively.
 
+
* '''Note''': ''[[dracut]]'' no longer includes the ''dmsquash-live'' module by default. Starting with Fedora 19, ''dracut'' defaults to the {{command|hostonly&#61;"yes"}} option, which precludes the ''dmsquash-live'' module. So, one can add a dracut config file, as root, before updating the kernel:
You can test your Live Image on USB using QEMU as shown in the screenshot below.
+
<pre>
 
+
echo 'hostonly="no"
[[Image:FedoraLiveCD_USBHowTo_usb_flash_with_qemu.png|thumb]]
+
add_dracutmodules+=" dmsquash-live "' > /etc/dracut.conf.d/01-liveos.conf
 
+
</pre>
For example, if your USB flash drive is on /dev/sdb1, you could type following command:
+
  
 +
The following commands will move the new kernel and initramfs files to the device's /syslinux directory:
 
<pre>
 
<pre>
$ umount /dev/sdb1
+
bootpath=run/initramfs/live/syslinux
$ qemu -hda /dev/sdb -m 256 -vga std
+
new=4.9.13-200.fc25.x86_64
 +
 
 +
cd /
 +
mv -f boot/vmlinuz-$new ${bootpath}/vmlinuz
 +
mv -f boot/initramfs-${new}.img ${bootpath}/initrd.img
 
</pre>
 
</pre>
  
== See also ==
+
{{admon/note | Fedora Guide | The procedure documented in this guide is also detailed at http://docs.fedoraproject.org/readme-burning-isos/ . The Guide may have different content, and be more or less detailed. If you edit this page or find a problem with the Guide, please also file a bug against the guide to have its content updated.}}
[http://www.redhatmagazine.com/2007/11/07/i-am-fedora-and-so-can-you/ Red Hat Magazine | I am Fedora, and so can you!]
+
  
== References ==
+
==Multi Live Image boot installations==
 +
The ''livecd-iso-to-disk'' --multi option allows one to install more than one LiveOS image on a single device. Version 24.2 or greater of {{package|livecd-tools}} will automatically configure the device boot loader to give a Multi Live Image Boot Menu for the device.
  
* http://www.redhat.com/archives/fedora-test-list/2007-May/msg00308.html
+
<noinclude>
* http://www.redhat.com/archives/fedora-livecd-list/2007-April/msg00029.html
+
[[Category:LiveMedia]]
 +
</noinclude>

Latest revision as of 01:55, 24 October 2017

Mediawriter-icon.png

This page explains how to create and use Fedora USB media. You can write all Fedora ISO images to a USB stick, making this a convenient way on any USB-bootable computer to either install Fedora or try a 'live' Fedora environment without writing to the computer's hard disk. You will need a USB stick at least as large as the image you wish to write.

[edit] Quickstart: Using Fedora Media Writer

Fedora Media Writer screenshot

For most cases, the best tool to create a Fedora USB stick is the Fedora Media Writer utility, which was formerly known as LiveUSB Creator. It is available on Fedora, other Linux distributions using Flatpak, Windows and macOS.

Important.png
Destructive method
This method will destroy all data on the USB stick. If you need a non-destructive write method (to preserve existing data on your USB stick) and/or support for 'data persistence', you can use the livecd-iso-to-disk utility on Fedora.

Fedora Media Writer is graphical and easy to use. It can download recent Fedora images for you as well as writing them to the USB stick.

On Fedora, you can use a Fedora graphical software installation tool to install the Package-x-generic-16.pngmediawriter package, or use the command line:

su -c 'dnf install mediawriter'

On Windows and macOS, you can download the installer from the releases page. On other Linux distributions, if they support the Flatpak application distribution system, you can download a flatpak from the releases page.

To run the tool, look for Fedora Media Writer in the system menus. When you start Fedora Media Writer, the three dots in the bottom will be flashing while the tool checks for a new Fedora release.

To write the stick:

  1. Choose which Fedora flavor you want to install or try.
    On the title screen, you can choose Workstation, Server or your own .iso file. Other choices (including KDE, Cinnamon, Xfce and so on) are under the "..." button at the bottom of the list.
  2. Ensure your USB stick is plugged into the system.
  3. Click Create Live USB.
  4. Ensure the right stick is selected.
  5. Click Write to disk and wait for the write to complete.
  6. Once the stick has been written, shut the system down and boot it from the USB stick (see the Booting section).

After writing, your USB stick will have a changed partition layout and some systems may report it to be about 10MB large. To return your USB stick to its factory configuration, insert the drive again while Fedora Media Writer is running. The app provides you with an option to restore to the factory layout. This layout includes a single VFAT partition.

Contents


[edit] Booting from USB sticks

Set USB as first boot device. Your BIOS may be different.

Almost all modern PCs can boot from USB sticks (some very old ones may not be able to). However, precisely how you tell the system to boot from a USB stick varies substantially from system to system. First, just try this:

  1. Power off the computer.
  2. Plug the USB drive into a USB port.
  3. Remove all other portable media, such as CDs, DVDs, floppy disks or other USB sticks.
  4. Power on the computer.
  5. If the computer is configured to automatically boot from the USB drive, you will see a screen that says "Automatic boot in 10 seconds..." with a countdown (unless you do a native UEFI boot, where you will see a rather more minimal boot menu).

If the computer starts to boot off the hard drive as normal, you'll need to manually configure it to boot off the USB drive. Usually, that should work something like this:

  1. Wait for a safe point to reboot.
  2. As the machine starts to reboot, watch carefully for instructions on which key to press (usually a function key, Escape, Tab or Delete) to enter the boot device selection menu, "BIOS setup", "firmware", or "UEFI". Press and hold that key. If you miss the window of opportunity (often only a few seconds) then reboot and try again.
  3. Use the firmware ("BIOS") interface or the boot device menu to put your USB drive first in the boot sequence. It might be listed as a hard drive rather than a removable drive. Each hardware manufacturer has a slightly different method for doing so.
    Be careful! Your computer could become unbootable or lose functionality if you change any other settings. Though these settings can be reverted, you'll need to remember what you changed in order to do so.
  4. Save the changes, exit, and the computer should boot from the USB drive.

If your system has a UEFI firmware, it will usually allow you to boot the stick in UEFI native mode or BIOS compatibility mode. If you boot in UEFI native mode and perform a Fedora installation, you will get a UEFI native Fedora installation. If you boot in BIOS compatibility mode and perform a Fedora installation, you will get a BIOS compatibility mode Fedora installation. For more information on all this, see the UEFI page. USB sticks written from x86_64 images with Fedora Media Writer, GNOME Disk Utility, dd, other dd-style utilities, and livecd-iso-to-disk with --efi should be UEFI native bootable. Sticks written with other utilities may not be UEFI native bootable, and sticks written from i686 images will never be UEFI bootable.

[edit] Checking USB disk size / free space

As noted before, the disk must have a certain amount of storage space depending on the image you select. If you use a destructive method, the stick must be at least the size of the image; if you use a non-destructive method, it must have at least that much free space. Whichever operating system you are using, you can usually check this with a file manager, usually by right clicking and selecting Properties. Here is a screenshot of how this looks on GNOME:

Properties USB size.png

[edit] Identifying a stick by /dev name on Linux

Most of the alternative writing methods will require you to know the /dev name for your USB stick - e.g. /dev/sdc - when using them on Linux. You do not need to know this in order to use Fedora Media Writer. To find this out:

  1. Insert the USB stick into a USB port.
  2. Open a terminal and run dmesg.
  3. Near the end of the output, you will see something like:
[32656.573467] sd 8:0:0:0: [sdX] Attached SCSI removable disk

where sdX will be sdb, sdc, sdd, etc. Take note of this label as it is the name of the disk you will use. We'll call it sdX from now on. If you have connected more than one USB stick to the system, be careful that you identify the correct one - often you will see a manufacturer name or capacity in the output which you can use to make sure you identified the correct stick.

[edit] Alternative USB stick writing methods

As explained above, the recommended method for writing the stick in most cases is Fedora Media Writer. In this section, other tools which may be useful in specific circumstances are documented.

[edit] Using GNOME Disk Utility (Linux, graphical, destructive)

Important.png
Destructive method
This method will destroy all data on the USB stick. If you need a non-destructive write method (to preserve existing data on your USB stick) and/or support for 'data persistence', you can use the livecd-iso-to-disk utility on Fedora.

This method is for people running Linux (or another *nix) with GNOME, Nautilus and the GNOME Disk Utility installed. Particularly, if you are using a distribution other than Fedora which does not support Flatpak, this may be the easiest available method. A standard installation of Fedora, or a standard GNOME installation of many other distributions, should be able to use this method. On Fedora, ensure the packages Package-x-generic-16.pngnautilus and Package-x-generic-16.pnggnome-disk-utility are installed. Similar graphical direct-write tools may be available for other desktops, or you may use the command line "direct write" method.

  1. Download a Fedora image, choose a USB stick that does not contain any data you need, and connect it
  2. Run Nautilus (Files) - for instance, open the Overview by pressing the Start/Super key, and type Files, then hit enter
  3. Find the downloaded image, right-click on it, go to Open With, and click Disk Image Writer
  4. Double-check you're really, really sure you don't need any of the data on the USB stick!
  5. Select your USB stick as the Destination, and click Start Restoring...

[edit] Command line method: Using the livecd-iso-to-disk tool (Fedora only, non-graphical, both non-destructive and destructive methods available)

Important.png
Potentially destructive method
This method will destroy all data on the USB stick if the --format parameter is passed.

The livecd-iso-to-disk method is slightly less reliable than Fedora Media Writer and can be used reliably only from within Fedora: it does not work in Windows or OS X, and is not supported (and will usually fail) in non-Fedora distributions. However, it supports three advanced features which FMW does not include:

  1. You may use a non-destructive method to create the stick, meaning existing files on the stick will not be destroyed. This is less reliable than the destructive write methods, and should be used only if you have no stick you can afford to wipe.
  2. On live images, you can include a feature called a persistent overlay, which allows changes made to persist across reboots. You can perform updates just like a regular installation to your hard disk, except that kernel updates require manual intervention and overlay space may be insufficient. Without a persistent overlay, the stick will return to a fresh state each time it is booted.
  3. On live images, you can also have a separate area to store user account information and data such as documents and downloaded files, with optional encryption for security and peace of mind.

By combining these features, you can carry your computer with you in your pocket, booting it on nearly any system you find yourself using.

It is not a good idea to try and write a new Fedora release using the version of livecd-iso-to-disk in a much older Fedora release: it is best to only use a release a maximum of two versions older than the release you are trying to write.

Ensure the Package-x-generic-16.pnglivecd-tools package is installed: su -c 'dnf install livecd-tools'

Basic examples follow. Remember to identify your USB stick's device name first. In all cases, you can add the parameter --efi to (try to) render the stick bootable in native UEFI mode. Detailed usage information is available by running: livecd-iso-to-disk --help or man livecd-iso-to-disk.

To make an existing USB stick bootable as a Fedora image - without deleting any of the data on it - make sure that the USB drive is not mounted before executing the following, and give the root password when prompted:

su -c "livecd-iso-to-disk Fedora-Workstation-Live-x86_64-28-1.1.iso /dev/sdX"

In case it is not possible to boot from a disk created with the method shown above, before re-partitioning and re-formatting, often resetting the master boot record will enable booting:

su -c "livecd-iso-to-disk --reset-mbr Fedora-Workstation-Live-x86_64-28-1.1.iso /dev/sdX"
Warning.png
CAUTION:
Using the --format option in the following command will erase all data on the USB drive! Please read the instructions below carefully.

If necessary, you can have livecd-iso-to-disk re-partition and re-format the target stick:

su -c "livecd-iso-to-disk --format --reset-mbr Fedora-Workstation-Live-x86_64-28-1.1.iso /dev/sdX"

To include a persistent filesystem for /home, use the --home-size-mb parameter. For example:

su -c "livecd-iso-to-disk --home-size-mb 2048 Fedora-Workstation-Live-x86_64-28-1.1.iso /dev/sdX"

This will create a 2 GiB filesystem that will be mounted as /home each time the stick is booted, allowing you to preserve data in /home across boots.

To enable 'data persistence' support - so changes you make to the entire live environment will persist across boots - add the --overlay-size-mb parameter to add a persistent data storage area to the target stick. For example:

su -c "livecd-iso-to-disk --overlay-size-mb 2048 Fedora-Workstation-Live-x86_64-28-1.1.iso /dev/sdX"

where 2048 is the desired size (in megabytes) of the overlay. The livecd-iso-to-disk tool will not accept an overlay size value greater than 4095 for VFAT, but for ext[234] filesystems it is only limited by the available space.

Note.png
Limited Lifetime of Persistent Overlay
Due to the way it's currently implemented, every single change to this form of overlay (writes AND deletes) subtracts from its free space, so it will eventually be "used up" and your USB stick will no longer boot (see this dm-devel discussion and this page for emergency recovery). You can use dmsetup status live-rw to see how much space remains in the overlay: the output will contain something like snapshot 42296/204800, indicating that 42296 of 204800 512-byte sectors are allocated. Because of these limitations, it is advisable to use the system-level persistence sparingly, for configuration changes and important security updates only. Or, if you have sufficient disk space available, changes to the LiveOS root filesystem snapshot can be merged into a new copy of the root filesystem. See this page section for instructions.

You can combine --home-size-mb and --overlay-size-mb, in which case data written to /home will not exhaust the persistent overlay.

[edit] Command line "direct write" method (most operating systems, non-graphical, destructive)

Important.png
Destructive method
This method will destroy all data on the USB stick. If you need a non-destructive write method (to preserve existing data on your USB stick) and/or support for 'data persistence', you can use the livecd-iso-to-disk utility on Fedora.

This method direct writes the image to the USB stick much like Fedora Media Writer or GNOME Disk Utility, but uses a command line utility named dd. Like the other "direct write" methods, it will destroy all data on the stick and does not support any of the advanced features like data persistence, but it is a very reliable method. The dd tool is available on most Unix-like operating systems, including Linux distributions and OS X, and a Windows port is available. This may be your best method if you cannot use Fedora Media Writer or GNOME Disk Utility, or just if you prefer command line utilities and want a simple, quick way to write a stick.

  1. Identify the name of the USB drive partition. If using this method on Windows, with the port linked above, the dd --list command should provide you with the correct name.
  2. Unmount all mounted partition from that device. This is very important, otherwise the written image might get corrupted. You can umount all mounted partitions from the device with umount /dev/sdX*, where X is the appropriate letter, e.g. umount /dev/sdc*
  3. Write the ISO file to the device:
    su -c 'dd if=/path/to/image.iso of=/dev/sdX bs=8M status=progress oflag=direct'
  4. Wait until the command completes.
    If you see dd: invalid status flag: 'progress', your dd version doesn't support the status=progress option and you'll need to remove it (and you won't see writing progress).

[edit] Using UNetbootin (Windows, OS X and Linux, graphical, non-destructive)

Unetbootin screenshot
Warning.png
Reliability not assured
Following each release, Fedora support volunteers receive reports of problems with installation images created by UNetbootin. Using the most recent version of UNetbootin available has been known to improve results. UNetbootin may work in some cases but not others - for instance, it will likely create a stick that is bootable in BIOS mode, but not UEFI mode. Fedora cannot guarantee support for UNetbootin-written images.

While your results may vary, it is usually the case that the Fedora Media Writer, livecd-iso-to-disk, GNOME and dd methods give better results than UNetbootin. If you encounter problems with UNetbootin, please contact the UNetbootin developers, not the Fedora developers.

UNetbootin is a graphical, bootable USB image creator. Using it will allow you to preserve any data you have in the USB drive. If you have trouble booting, however, you may wish to try with a blank, cleanly FAT32-formatted drive.

If you are running a 64-bit Linux distribution, UNetbootin may fail to run until you install the 32-bit versions of quite a lot of system libraries. Fedora cannot help you with this: please direct feedback on this issue to the UNetbootin developers.

  1. Download the latest UNetbootin version from the official site and install it. On Linux, the download is an executable file: save it somewhere, change it to be executable (using chmod ugo+x filename or a file manager), and then run it.
  2. Launch UNetbootin. On Linux, you might have to type the root password.
  3. Click on Diskimage and search for the ISO file you downloaded.
  4. Select Type: USB drive and choose the correct device for your stick
  5. Click OK
Note.png
Drive not visible
If you do not see sdX listed, you might have to reformat the drive. You can do this from most file manager or disk utility tools, e.g. the GNOME disk utility ("Disks") on Fedora. The FAT32 format is most likely to result in a bootable stick. This will cause you to lose all data on the drive.

[edit] Creating a USB stick from a running live environment

If you are already running a live CD, DVD, or USB and want to convert that into a bootable USB stick, run the following command:

su -c "livecd-iso-to-disk /run/initramfs/livedev /dev/sdX"

See this section for mounting the root filesystem outside of a boot.

[edit] Troubleshooting

[edit] Fedora Media Writer problems

[edit] livecd-iso-to-disk problems

[edit] Partition isn't marked bootable!

If you get the message Partition isn't marked bootable!, you need to mark the partition bootable. To do this, run su -c 'parted /dev/sdX', and use the toggle N boot command, where X is the appropriate letter and N is the partition number. For example:

$ parted /dev/sdb
GNU Parted 1.8.6
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: Imation Flash Drive (scsi)
Disk /dev/sdX: 1062MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  1062MB  1062MB  primary  fat16             

(parted) toggle 1 boot
(parted) print                                                    
Model: Imation Flash Drive (scsi)
Disk /dev/sdX: 1062MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  1062MB  1062MB  primary  fat16        boot 

(parted) quit                                                             
Information: Don't forget to update /etc/fstab, if necessary.             

[edit] Partitions need a filesystem label!

If you get the message Need to have a filesystem label or UUID for your USB device, you need to label the partition: su -c "dosfslabel /dev/sdX LIVE"

[edit] Partition has different physical/logical endings!

If you get this message from fdisk, you may need to reformat the flash drive when writing the image, by passing --format when writing the stick.

[edit] MBR appears to be blank!

If your test boot reports a corrupted boot sector, or you get the message MBR appears to be blank., you need to install or reset the master boot record (MBR), by passing --reset-mbr when writing the stick.

[edit] livecd-iso-to-disk on other Linux distributions

livecd-iso-to-disk is not meant to be run from a non-Fedora system. Even if it happens to run and write a stick apparently successfully from some other distribution, the stick may well fail to boot. Use of livecd-iso-to-disk on any distribution other than Fedora is unsupported and not expected to work: please use an alternative method, such as Fedora Media Writer.

[edit] Ubuntu's usb-creator

Ubuntu and derivative Linux distributions have a usb-creator program similar to Fedora Media Writer. This does not work with Fedora ISO images, it silently rejects them. usb-creator requires the ISO to have a Debian layout, with a /.disk/info file and a casper directory. Do not attempt to use this utility to write a Fedora ISO image.

[edit] Testing a USB stick using qemu

You can test your stick using QEMU as shown in the screenshot below.

Screenshot qemu gtk3.png

For example, you could type the following commands:

su -c 'umount /dev/sdX1'
qemu -hda /dev/sdX -m 1024 -vga std

[edit] Mounting a Live USB filesystem

You can use the liveimage-mount script in the Package-x-generic-16.pnglivecd-tools package to mount an attached Live USB device or other LiveOS image, such as an ISO or Live CD. This is convenient when you want to copy in or out some file from the LiveOS filesystem on a Live USB, or just examine the files in a Live ISO or Live CD.

[edit] Kernel updates for livecd-iso-to-disk-written images with a persistent overlay

If you have sufficient overlay space to accommodate a kernel update on a Live USB installation, the kernel and initramfs will be installed to the /boot directory. To put these into service they must be moved to the /syslinux directory of the installation partition. This is accessible from the running Live USB filesystem at the /run/initramfs/live mount point. The new initramfs (such as initramfs-4.9.13-200.fc25.x86_64.img) and kernel (such as vmlinuz-4.9.13-200.fc25.x86_64) should be moved to replace the /run/initramfs/live/syslinux/initrd.img and /run/initramfs/live/syslinux/vmlinuz files, respectively.

  • Note: dracut no longer includes the dmsquash-live module by default. Starting with Fedora 19, dracut defaults to the hostonly="yes" option, which precludes the dmsquash-live module. So, one can add a dracut config file, as root, before updating the kernel:
echo 'hostonly="no"
add_dracutmodules+=" dmsquash-live "' > /etc/dracut.conf.d/01-liveos.conf

The following commands will move the new kernel and initramfs files to the device's /syslinux directory:

bootpath=run/initramfs/live/syslinux
new=4.9.13-200.fc25.x86_64

cd /
mv -f boot/vmlinuz-$new ${bootpath}/vmlinuz
mv -f boot/initramfs-${new}.img ${bootpath}/initrd.img
Note.png
Fedora Guide
The procedure documented in this guide is also detailed at http://docs.fedoraproject.org/readme-burning-isos/ . The Guide may have different content, and be more or less detailed. If you edit this page or find a problem with the Guide, please also file a bug against the guide to have its content updated.

[edit] Multi Live Image boot installations

The livecd-iso-to-disk --multi option allows one to install more than one LiveOS image on a single device. Version 24.2 or greater of Package-x-generic-16.pnglivecd-tools will automatically configure the device boot loader to give a Multi Live Image Boot Menu for the device.