From Fedora Project Wiki

No edit summary
(81 intermediate revisions by 23 users not shown)
Line 3: Line 3:
[[Category:LiveMedia]]
[[Category:LiveMedia]]
</noinclude>
</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.
[[Image:Artwork_DesignService_fedora-iso-usb.png‎|right]]


This page explains '''how to create and use Fedora 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.


{{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 processIf you have any documents on your USB stick, it's not a bad idea to ''back them up'' before you start.
The Live USB stick can include a feature called a ''persistent overlay'', which allows changes made to persist across rebootsWithout a ''persistent overlay'', the stick will return to a fresh state each time it is booted.


* 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.
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.
* 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!
You may also use a ''non-destructive'' method to create the stick, meaning existing files on the stick will not be destroyed.


If you are into technical details or want more information, please read on.}}
By combining these features, you can carry your computer with you in your pocket, booting it on nearly any system you find yourself using.


{{admon/warning | Using UNetbootin | 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. While your results may vary, for best results, use the liveusb-creator.}}
However, if you do not need the extended features, it is recommended you use the simplest possible "direct write" method to write the stick, as this will provide the best chance of it booting on the widest possible range of systems (though it will destroy all data on the stick). The way to do this is described in the "quick start" sections at the top of this page. If you wish to use the extended features, those methods are described later in the page.


With current Fedora releases you can also write the non-live Fedora installation images (the DVD and network installation images) to a USB stick, which many users find more convenient and faster than writing to an optical disc. The "direct write" method is always recommended for writing the installation images.


__TOC__
{{anchor|quickstarts}}
== Windows quick start (direct write) ==


{{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.}}
{{admon/important | Destructive method | This method will destroy all data on the USB stick. Alternative, non-destructive methods are described later in this document.}}


{{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.}}
# Download a Fedora image, choose a USB stick that does not contain any data you need, and connect it
# Download and run [https://github.com/downloads/openSUSE/kiwi/ImageWriter.exe SUSE Studio ImageWriter] or [http://www.netbsd.org/~martin/rawrite32/ Rawrite32]
# Choose the Fedora image as the '''Image''' (SUSE Studio) or '''Filesystem image''' (Rawrite32) - if the image file is not shown, you may have to change the file selector options or change the image's extension
# Choose the USB stick in the drop-down box by the '''Copy''' button (SUSE Studio) or as the '''Target''' (Rawrite32)
# Double-check you're really, really sure you don't need any of the data on the USB stick!
# Click '''Copy''' (SUSE Studio) or '''Write to disk...''' (Rawrite32)
# Wait for the operation to complete, then reboot your computer, and do whatever you need to do to boot from a USB stick - often this will involve pressing or holding down '''F12''', '''F2''' or '''Del'''.


== System Requirements ==
== Linux (GNOME) quick start (direct write) ==


* 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 also available for Mac OS X and Windows, and is in the Fedora repository as well.
{{admon/important | Destructive method | This method will destroy all data on the USB stick. Alternative, non-destructive methods are described later in this document.}}
* 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===
This method is for people running Linux with GNOME, Nautilus and the GNOME Disk Utility installed. 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]].


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
# Download a Fedora image, choose a USB stick that does not contain any data you need, and connect it
data), the only risk is wasting some time.
# 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...'''
# Wait for the operation to complete, then reboot your computer, and do whatever you need to do to boot from a USB stick - often this will involve pressing or holding down '''F12''', '''F2''' or '''Del'''.


If your USB stick is not in working order, this procedure may fail. Watch for error messages during the process.
== OS X quick start (direct write) ==
{{admon/important | Destructive method | This method will destroy all data on the USB stick. Alternative, non-destructive methods are described later in this document.}}
Unfortunately, there is no known useful graphical tool for a direct write on OS X. The [[#unetbootin|UNetbootin]] utility described later in this document works on OS X, but cannot be guaranteed to produce reliably bootable Fedora images. This console-based method is not as graphically easy as using UNetbootin, but it is more reliable.
# Download a Fedora image, choose a USB stick that does not contain any data you need, and connect it
# Open a terminal
# Run {{command|diskutil list}}. This will list all disks connected to the system, as {{filename|/dev/rdisk1}}, {{filename|/dev/rdisk2}} and so on. Identify - very carefully! - which one corresponds to the USB stick you wish to use. Hereafter, we'll assume it was {{filename|/dev/rdisk2}} - modify the commands as appropriate for your stick.
# Run {{command|diskutil unmountDisk /dev/rdisk2}}
# Type <code>dd if=</code>, then drag and drop the Fedora image file to the terminal window - this should result in its filesystem location being appended to the command. Now complete the command with <code>of=/dev/rdisk2 bs=1m</code>, but ''don't hit Enter yet''. You should wind up with something like {{command|sudo dd if<nowiki>=</nowiki>/Volumes/Images/Fedora-Live-Desktop-x86_64-20-1.iso of<nowiki>=</nowiki>/dev/rdisk2 bs<nowiki>=</nowiki>1m}}
# Double-check you have the correct disk number and you're really, really sure you don't need any of the data on the USB stick!
# Hit Enter
# Wait for the operation to complete, then reboot your computer, and hold down the left Alt/Option key to access the boot menu - you should see a Fedora logo. Click this to boot.


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.
__TOC__


=== Check the size of your USB stick ===
{{admon/important | Creating a live ISO image | A Live USB system is created from the same ISO image file that is used to create 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 live ISO image file.}}


Many USB sticks indicate the size on the packaging or the outside of the stick.
{{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.}}


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 port.  You can check the contents and size using the graphical file manager.  In Linux, you can also use the command line:
== System Requirements ==


<pre>
* A working computer running GNU/Linux, Windows or OS X.
$ df -h
* A [[wikipedia:USB flash drive|USB flash drive]], also known as USB stick, thumb drive, pen drive, or jump drive. For most Fedora live images, you will need at least 1 GB or more of storage space. For the network install image, 400 MB or more should be sufficient. For a DVD image, you should have at least 4.7 GB.
Filesystem            Size  Used Avail Use% Mounted on
* A Fedora ISO file, which you can download from http://fedoraproject.org/get-fedora.
/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.
=== Ability to boot from USB media ===


Take note of "/dev/sdb1" or equivalent; you will be specifying the device name if you use the command line method.
* 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 its data), the only risk is wasting some time.


== How to Partition ==
* If your USB stick is not in working order, this procedure may fail.  Watch for error messages during the process.


{{admon/warning | CAUTION | This will erase all data on the USB drive!  Please read the instructions below ''carefully''.}}
=== UEFI boot of USB sticks ===


If the drive has not been partitioned properly (or if you are unsure), use <code>fdisk</code> to repartition it.
{{admon/important | Use a 64 bit image for UEFI | UEFI booting is only supported with the 64bit release of Fedora.}}
Whether a Fedora image written to a USB stick will be bootable natively via [[wikipedia:UEFI|UEFI]] is a somewhat complex question which depends on the Fedora release, the type of image (live or non-live), and the method used to write it. The {{command|--efi}} parameter to the [[#litd|livecd-iso-to-disk]] tool attempts to make a stick written with that tool natively UEFI bootable.


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.
As of {{FedoraVersion|long|20}}, all sticks written using [[#quickstarts|"direct write" methods]] should be UEFI-bootable, at least some sticks written with [[#luc|liveusb-creator]] should be UEFI-bootable, and all sticks written with {{command|livecd-iso-to-disk --format --reset-mbr --efi}} should be UEFI-bootable. Use of {{command|--efi}} without {{command|--format}} and {{command|--reset-mbr}} can be considered a 'best effort', and may not produce a UEFI-bootable stick. Sticks written with other methods and tools will most probably not be UEFI-bootable.


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:
If you boot a Fedora stick in UEFI native mode and install from it, you will get a UEFI native installation of Fedora. If you wish to do a BIOS native installation of Fedora, you must ensure you boot your stick in BIOS compatibility mode, if your firmware has this capability. The interface for choosing the mode used to boot varies between systems, and so we cannot give precise instructions on this. If you have difficulty, you may want to use a method which is known ''not'' to produce a UEFI-bootable stick, and hence force your firmware to boot it in BIOS compatibility mode.


<pre>
== Checking USB disk size / free space ==
$ /sbin/fdisk /dev/sdb
</pre>


If you don't have fdisk installed, run <code>yum install util-linux-ng</code> as root.  
As noted before, the disk must have a certain amount of storage space depending on the type of image you select. If you use a destructive method, the stick must be at least that size; 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:


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.
[[image:Properties_USB_size.png]]


Command (m for help): '''d'''
== Writing the image ==
Selected partition 1
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/warning | CAUTION | This will erase all data on the USB drive!  Please read the instructions below ''carefully''.}}
Remember, the most reliable methods, which are recommended if you do not need to preserve the contents of your stick or use any of the advanced features such as storage persistence, are the "direct write" methods described [[#quickstarts|above]]. Only use these alternative methods if you need to preserve the contents of your stick, or use advanced features.
 
If your USB media has sufficient free space on a ''vfat'' file system already, you do not need to perform this step.
 
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!'''''
 
<pre>
$ 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.
After the "direct write" methods, [[#litd|The livecd-iso-to-disk method]] is the second most reliable, and supports all Fedora images and the full range of advanced features. However, it is a command-line tool, and only available for Fedora. [[#fmw|The Fedora Media Writer method]] is less reliable and cannot write non-live images, but it is graphical, and is easily available for Windows and Fedora.


== How to install non-destructively ==
The reliability, ease of use and feature availability of other methods, including [[#unetbootin|UNetbootin]], is questionable, and Fedora may be unable to offer support for them.


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.
{{anchor|fmw}}
=== Using Fedora Media Writer (Windows and Fedora, graphical, destructive) ===


== From a Downloaded Image ==
[[Image:Fedora_Live_USB_creator.png]]


=== Download an ISO ===
Fedora live USB sticks can be created on Windows and Fedora using the [https://github.com/lmacken/liveusb-creator/ Fedora Media Writer] utility. You could have known it as 'liveusb-creator'. It cannot create USB sticks from the non-live installer images.


(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.)
It is graphical, easy to use and it is destructive (will destroy existing data on the stick). Under the hood, it works the same as the "direct-write" method but provides a graphical user interface around it and can download recent Fedora images for you.


You can use BitTorrent or your web browser to download a bootable image, or ISO, which you will install on your USB drive.
On Fedora, you can use a Fedora graphical software installation tool to install the {{package|liveusb-creator}} package, or use the command line.
For fedora 22 and later versions use [[dnf|DNF]]:
: {{command|su -c 'dnf install liveusb-creator'}}


Quick links:
Or for Fedora 21 and earlier versions use YUM:  
* [http://fedoraproject.org/en/get-fedora Supported releases]
: {{command|su -c 'yum install liveusb-creator'}}
* [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.
On Windows, you can download the installer from [https://github.com/lmacken/liveusb-creator/releases the liveusb-creator site].


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.)
To run the tool, look for '''Fedora Media Writer''' in the system menus, or (in Fedora) run {{command|liveusb-creator}} on the command line.


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.
To use the tool, just choose which Fedora flavor you want to install or try. On the title screen, you can either choose Workstation, Server or your own .iso file. There are more choices under the "..." button on the bottom of the list.


Live ISOs are ''not'' made daily for Branched, Alpha, Beta, and Final phases, only at the Alpha, Beta, and Final milestones.
When you start Fedora Media Writer, the three dots in the bottom will be flashing while the tool checks for a new Fedora release.  


=== Graphical Method - Windows or Fedora ===
After writing, your flash drive will have a changed partition layout and some systems may report it to be about 10MB large. You can fix this yourself or you can insert the drive again while Fedora Media Writer is running and it will provide you with an option to restore a single-partition layout and to create a VFAT partition.


Fedora LiveUSB sticks can be created in Windows and Linux using the [http://fedorahosted.org/liveusb-creator liveusb-creator].


For Windows using the following steps:
{{anchor|#device}}
* Download liveusb-creator from http://fedorahosted.org/liveusb-creator
* Double click 'liveusb-creator'


{{anchor|device}}
=== Identifying a stick by {{filename|/dev}} name on Linux ===


If you are using Fedora, you can use Add/Remove Programs and search for ''liveusb-creator'', or use the command line:
The following methods will require you to know the {{filename|/dev}} name for your USB stick - e.g. {{filename|/dev/sdc}} - when using them on Linux. 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>
$ su -c "yum install liveusb-creator"
[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.
{{anchor|unetbootin}}


=== Using [http://unetbootin.sourceforge.net/ UNetbootin] (Windows, OS X and Linux, graphical, non-destructive) ===


To start, run <code>liveusb-creator</code> on the command line, or on the GNOME menu, go to "Applications -> System Tools -> liveusb-creator".
{{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.}}


If you are using an older version of Fedora (9 or 10), you may need to work around [[Common F11 bugs#494000|bug 494000]].
While your results may vary, it is usually the case that the [[#quickstarts|direct write]], [[#litd|livecd-iso-to-disk]], and [[#luc|liveusb-creator]] methods give better results than UNetbootin. If you encounter problems with UNetbootin, please contact the UNetbootin developers, not the Fedora developers.


=== Command Line Method - Linux only ===
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.


In the following examples, replace "/path/to/ISO" with e.g. F16-Live-i686.iso or the full path to the ISO you downloaded, e.g. /tmp/F16-Live-i686.iso.
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.


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!'''''
[[Image:Unetbootin_gtk3.png]]


The [[livecd-iso-to-disk]] method also works with DVD install iso images, even though these are not Live images.
# 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


==== Using dd for a direct copy ====
{{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.}}


Fedora 12 and above, you can simply use dd although the specialized tools have additional features like non destructive writing and data persistence. Fedora 12 to Fedora 15 this method will only work for liveCD iso's and NOT install media. With Fedora 16, install media will work fine as well.
{{anchor|litd}}
=== Command line method: Using the ''livecd-iso-to-disk'' tool (Fedora only, non-graphical, both non-destructive and destructive methods available) ===


$ sudo dd if=''F16-Live-i686''.iso of=/dev/sd''X'' bs=8M
{{admon/important | Potentially destructive method | This method will destroy all data on the USB stick ''if the '''--format''' parameter is passed''.}}


Note that you want the device name (e.g. /dev/sdx) not the partition name (e.g. /dev/sdx1).
The ''livecd-iso-to-disk'' tool is the most capable, non-destructive, and second most reliable method of writing a Fedora ISO image to a USB stick, but it 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. Please use (in order of preference) [[#quickstarts|the direct write methods]], [[#luc|liveusb-creator]], [[#unetbootin|UNetbootin]] or other third-party tool on other operating systems. It is also 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.


This method also works with netinst.iso and boot.iso images. In Fedora 13, ":/images/install.img" has to be appended to boot parameter stage2=hd:label="Fedora" (you can do it after hitting Tab in boot selection screen) to prevent asking for install.img location in loader text UI. This should be fixed with [https://bugzilla.redhat.com/show_bug.cgi?id=528809 bug 528809]
Make sure the ''livecd-tools'' RPM is installed with the command:


==== Check livecd-tools ====
: {{command|rpm -q livecd-tools}}


Make sure the livecd-tools RPM is installed.
You will see the name of the RPM and a version number if it is installed, or no output if it is not installed.


<pre>
If ''livecd-tools'' is not installed, install it using this command, or a graphical software installation tool. For Fedora 22 and later versions use [[dnf|DNF]]:
$ 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.
: {{command|su -c 'dnf install livecd-tools'}}


If "livecd-tools" is not installed, install it using yum.
Or for Fedora 21 and earlier versions use [[yum|YUM]]:
<pre>
: {{command|su -c 'yum install livecd-tools'}}
$ su -c "yum install livecd-tools"
</pre>


==== Run [[livecd-iso-to-disk]] script ====
Detailed usage information is available in the first pages of the [https://github.com/rhinstaller/livecd-tools/blob/master/tools/livecd-iso-to-disk.sh#L27 livecd-iso-to-disk script], which you can also see by running this command:


Script usage is available in the first pages of the [http://git.fedorahosted.org/git/?p=hosted/livecd;a=blob;f=tools/livecd-iso-to-disk.sh;hb=HEAD livecd-iso-to-disk script].
: {{command|su -c 'livecd-iso-to-disk --help'}}


Make sure that the USB drive is not mounted before executing the following, and give the root password when prompted.
: There is also the [https://github.com/rhinstaller/livecd-tools/blob/master/docs/livecd-iso-to-disk.pod packaged manual page documentation],
: {{command|man livecd-iso-to-disk}}


$ su -c "livecd-iso-to-disk ''/path/to/ISO'' /dev/''USBPARTITIONNAME''"
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.
Password:
Copying live image to USB stick
Updating boot config file
Installing boot loader
USB stick set up as live image!


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''':
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-Live-Desktop-x86_64-20-1.iso /dev/sdX"}}
See [[#Data persistence|Data persistence]] below for how to create Live USB devices with more than temporary storage of user files and settings.


$ su -c "livecd-iso-to-disk --format --reset-mbr ''/path/to/ISO'' /dev/''USBPARTITIONNAME''"
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:


==== Data Persistence ====
: {{command|su -c "livecd-iso-to-disk --reset-mbr Fedora-Live-Desktop-x86_64-20-1.iso /dev/sdX"}}


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.
{{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''.}}


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 necessary, you can have ''livecd-iso-to-disk'' re-partition and re-format the target stick:


If you prefer the command line, you can run the following command:
: {{command|su -c "livecd-iso-to-disk --format --reset-mbr Fedora-Live-Desktop-x86_64-20-1.iso /dev/sdX"}}


$ sudo livecd-iso-to-disk --overlay-size-mb 512 ''/path/to/ISO'' /dev/''USBPARTITIONNAME''
{{anchor|dd}}


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.
=== Command line "direct write" method (most operating systems, non-graphical, destructive) ===


{{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 (see this [http://thread.gmane.org/gmane.linux.kernel.device-mapper.devel/14644 dm-devel discussion] and [http://wiki.sugarlabs.org/go/LiveOS_image#Overlay_recovery this page] for emergency recovery). 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.}}
{{admon/important | Destructive method | This method will destroy all data on the USB stick. Alternative, non-destructive methods are described elsewhere in this document.}}


The persistent overlay status may be queried by issuing this command on the live system:
This method is equivalent to the other "direct write" methods described in the [[#quickstarts|Quickstarts section]], 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].
dmsetup status live-rw
The returned value may look like this:


live-rw: 0 8388608 snapshot 42296/204800 176
<ol>
<li>[[#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.
<li>'''Unmount all mounted partition from that device.''' This is very important, otherwise the written image might get corrupted. You can see all mounted partitions with
<pre>lsblk /dev/sdb</pre>
and unmount them with
<pre>umount /run/media/user/mountpoint</pre>
<li>Write the ISO file to the device:
<pre>sudo dd if=/path/to/image.iso of=/dev/sdX bs=8M status=progress oflag=direct</pre>
where <code>sdX</code> is the name of your device. Wait until the command completes.<br>
If you receive <code>dd: invalid status flag: ‘progress’</code> error, your dd version doesn't support <code>status=progress</code> option and you'll need to remove it (and you won't see writing progress).
</ol>


where the fraction after 'snapshot' for the logical volume is that of 512-byte sectors consumed in the overlay.
=== Creating a USB stick from a running live environment ===


== From a running Live CD/DVD/USB ==
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 you are already running a live CD or DVD and want to convert that into a bootable USB stick, run the following command as a root user:
: {{command|su -c "livecd-iso-to-disk /run/initramfs/livedev /dev/sdX"}}


<pre>
(For versions before Fedora 17, use {{filename|/dev/live}} instead of {{filename|/run/initramfs/livedev}}.)
# livecd-iso-to-disk /dev/sr0 /dev/USBPARTITIONNAME
</pre>
From a running Live USB, use /dev/live as the source:
<pre>
# livecd-iso-to-disk /dev/live /dev/USBPARTITIONNAME
</pre>


== How to Boot a Live USB Drive ==
== Booting the image ==


* Power off the computer.
[[Image:Bios_USB_boot.jpg|thumb|right|Set USB as first boot device. Your BIOS may be different.]]
* 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}}
# 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 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).


== How to Make a bootable USB Drive to Install Fedora instead of using a physical DVD ==
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.
{{admon/important|Requires livecd-tools 16.11 |Please ensure that you have the latest version of livecd-tools before attempting this: Known bug #[[rhbug:812141|812141]]}}


=== Why would I want to make a USB device installer from the DVD instead of the LiveCD? ===
# 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. If you have a UEFI firmware, you may see choices to boot the stick in UEFI native mode or BIOS compatibility mode: remember that, if you intend to install Fedora, a UEFI native boot will result in a UEFI native Fedora installation, while a BIOS compatibility mode boot will result in a BIOS native Fedora installation.
# Save the changes, exit, and the computer should boot the Live USB drive.


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.
== Data persistence ==


=== Preparing the USB stick ===
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 that kernel updates require [[#Kernel updates|manual intervention]] and [[#limited overlay|overlay space may be insufficient]]. The primary use of this feature is booting a USB stick with your live image as well as the persistent changes. Note that you will need to have space on your target USB stick for the live image plus your overlay plus any other data you want on the stick.


{{admon/note|Formatting is necessary|Due to some changes in the anaconda installer in Fedora 17, it is necessary to format the USB media that you are using. This is only required when using the DVD media, not the Live media. It is therefore suggested that you use a 4-8GB pen drive and not an external hard disk since you will lose your data. See rhbz#813905}}
Use the [[#luc|liveusb-creator tool]] described above to do this easily. There is a graphical slider in the interface you can use to assign space on the target stick for persistent storage.


The easiest setup method is to install 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.  (Unetbootin has worked in the past as well, but does not currently work for Fedora 14 and 15.)
If using the ''livecd-iso-to-disk'' tool, add the {{command|--overlay-size-mb}} parameter to add a persistent data storage area to the target stick. For example:


The manual setup method follows:
: {{command|su -c "livecd-iso-to-disk --overlay-size-mb 512 Fedora-Live-Desktop-x86_64-20-1.iso /dev/USBPARTITIONNAME"}}


First, download the DVD iso file of your choice from a [http://fedoraproject.org/en/get-fedora-all]This method also works for the boot and netinstall iso's.
where 512 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.
{{anchor|limited overlay}}
{{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 [[wikipedia:Device mapper|Device-mapper]] 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 (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). 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 filesystemSee [[LiveOS image#Merge overlay into new image|this page section]] for instructions.


Then, from your running Fedora system (including a Fedora livecd) make sure you have the livecd-tools package installed by doing:
See [[#Mounting a Live USB filesystem|this section]] for mounting the root filesystem outside of a boot.
<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
For normal, write-many storage, use the {{command|--home-size-mb}} option to create a home directory filesystem for personal files. Home.img can be re-used and loop mounted outside of the Live USB environment.}}
or df -h to find where the stick was mounted.
The persistent overlay status may be queried by issuing this command on the live system:


Next unmount 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/sdb
: {{command|dmsetup status live-rw}}


Now as root run:
The returned value may look like this:
<pre>
<pre>
# livecd-iso-to-disk --format --reset-mbr --msdos path-to/Fedora-*.iso /dev/sdb
live-rw: 0 8388608 snapshot 42296/204800 176
</pre>
</pre>
where the fraction after 'snapshot' for the logical volume is that of 512-byte sectors consumed in the overlay.


== Errors and Solutions ==
== Troubleshooting ==


=== liveusb-creator problems ===
=== liveusb-creator problems ===


* Try the [https://fedorahosted.org/liveusb-creator/wiki/FAQ liveusb-creator FAQ].
* Try the [http://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.
* 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.
* The [https://fedorahosted.org/mailman/listinfo/liveusb-creator liveusb-creator mailing list] has [https://lists.fedorahosted.org/pipermail/liveusb-creator archives] which may also be useful.


=== Partition isn't marked bootable! ===
=== Partition isn't marked bootable! ===
Line 312: Line 292:
If you get the following message, you need to mark the partition bootable.
If you get the following message, you need to mark the partition bootable.
<pre>
<pre>
$ livecd-iso-to-disk Fedora-<release>-Live-i686.iso /dev/sdb1
$ su -c "livecd-iso-to-disk Fedora-Live-Desktop-x86_64-20-1.iso /dev/sdX"
Partition isn't marked bootable!
Partition isn't marked bootable!
You can mark the partition as bootable with  
You can mark the partition as bootable with  
     $ /sbin/parted /dev/sdb
     $ /sbin/parted /dev/sdX
     (parted) toggle N boot
     (parted) toggle N boot
     (parted) quit
     (parted) quit
Line 321: Line 301:
</pre>
</pre>


To mark the partition bootable,
To mark the partition bootable, run parted, and use the 'toggle X boot' command. For example:
<pre>
<pre>
$ parted /dev/sdb
$ parted /dev/sdX
GNU Parted 1.8.6
GNU Parted 1.8.6
Using /dev/sdb
Using /dev/sdX
Welcome to GNU Parted! Type 'help' to view a list of commands.
Welcome to GNU Parted! Type 'help' to view a list of commands.
(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 339: Line 319:
(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 334:
If you get the following message, you need to label the partition.
If you get the following message, you need to label the partition.
<pre>
<pre>
$ livecd-iso-to-disk Fedora-<release>-Live-i686.iso /dev/sdb1
$ su -c "livecd-iso-to-disk Fedora-Live-Desktop-x86_64-20-1.iso /dev/sdX"
Need to have a filesystem label or UUID for your USB device
Need to have a filesystem label or UUID for your USB device
Label can be set with /sbin/dosfslabel
Label can be set with /sbin/dosfslabel
Line 360: Line 340:
</pre>
</pre>


To label the partition.
To label the partition:
<pre>
<pre>
$ dosfslabel /dev/sdb1 usbdisk
su -c "dosfslabel /dev/sdX LIVE"
</pre>
</pre>


=== Partition has different physical/logical endings! ===
=== Partition has different physical/logical endings! ===


If you get the following message, you may need to reformat the flash drive.
If you get this message from fdisk, you may need to reformat the flash drive, as described earlier in this guide.
<pre>
$ fdisk -l /dev/sdb
 
Disk /dev/sdb: 2029 MB, 2029518848 bytes
129 heads, 32 sectors/track, 960 cylinders
Units = cylinders of 4128 * 512 = 2113536 bytes
 
Device Boot      Start        End      Blocks  Id  System
/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! ===
=== MBR appears to be blank! ===


If your test boot reports a corrupted boot sector, or you get the following message, you need to install MBR.
If your test boot reports a corrupted boot sector, or you get the following message, you need to install or reset the master boot record (MBR).
<pre>
<pre>
$ livecd-iso-to-disk Fedora-<release>-Live-i686.iso /dev/sdb1
$ su -c "livecd-iso-to-disk Fedora-Live-Desktop-x86_64-20-1.iso /dev/sdX"
MBR appears to be blank.
MBR appears to be blank.
You can add an MBR to this device with
You can add an MBR to this device with
Line 391: Line 359:
</pre>
</pre>


To install or reset MBR:
$ su -c "livecd-iso-to-disk --reset-mbr Fedora-Live-Desktop-x86_64-20-1.iso /dev/sdX"


To install MBR,
=== Issues using other Linux distributions ===
<pre>
$ cat /usr/share/syslinux/mbr.bin > /dev/sdb
</pre>


=== SYSLINUX Boot Error! ===
Ubuntu and derivative Linux distributions have a usb-creator program similar to Live USB Creator. 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.


If you were using the script on previous Red Hat or Fedora Release and getting following error message,
The livecd-iso-to-disk script 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 the [[#quickstarts|"direct write"]] methods described above.
<pre>
SYSLINUX 3.xx ... EBIOS Load error - Boot error
</pre>


You may need to upgrade your syslinux to 3.50 or higher from Peter Anvin's [http://syslinux.zytor.com/faq.php SYSLINUX] .
== Testing a USB stick using qemu ==


* http://www.kernel.org/pub/linux/utils/boot/syslinux/RPMS/i386/
You can test your stick using QEMU as shown in the screenshot below.


=== Ubuntu issues ===
[[Image:Screenshot_qemu_gtk3.png‎|thumb]]
Ubuntu and derivative Linux distributions have a usb-creator program similar to Live USB Creator.
This ''does not work'' with Fedora .iso images, it silently rejects them.
(usb-creator requires the .iso has a Debian layout, with a /.disk/info file and a casper directory.)


The livecd-iso-to-disk script isn't meant to be run from a non-Fedora system.
For example, you could type the following commands:
Testers have reported that even though it runs in an Ubuntu 10.10 terminal and may complete successfully, the resulting USB flash drive does not boot (RHBZ #[[rhbug:699554|699554]]).
<pre>
 
su -c 'umount /dev/sdX1'
Expert users may be able to use dd to write the Fedora .iso to the USB flash drive (thereby overwriting its partition information and all files on it).
qemu -hda /dev/sdX -m 1024 -vga std
Another workaround is to burn the Fedora .iso to a CD-R, boot from this, and then run Live USB Creator or livecd-iso-to-disk from the Fedora environment.
</pre>
 
== Mounting a Live USB filesystem ==
== Testing Live Image on USB ==
 
You can test your Live Image on USB using QEMU as shown in the screenshot below.


[[Image:FedoraLiveCD_USBHowTo_usb_flash_with_qemu.png|thumb]]
You can use the [https://github.com/rhinstaller/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.


For example, if your USB flash drive is on /dev/sdb1, you could type following command:
== Kernel updates ==


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-3.12.5-302.fc20.x86_64.img) and kernel (such as vmlinuz-3.12.5-302.fc20.x86_64) should be moved to replace the /run/initramfs/live/syslinux/initrd0.img and /run/initramfs/live/syslinux/vmlinuz0 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:
<pre>
<pre>
$ umount /dev/sdb1
echo 'hostonly="no"
$ qemu -hda /dev/sdb -m 256 -vga std
add_dracutmodules+=" dmsquash-live "
compress="xz"' > /etc/dracut.conf.d/01-liveos.conf
</pre>
</pre>
== Mounting a Live USB filesystem ==


You can use the [http://git.fedorahosted.org/git?p=hosted/livecd;a=blob_plain;f=tools/liveimage-mount;hb=HEAD '''''liveimage-mount'''''] script in the ''livecd-tools'' package to mount an attached Live USB device or other LiveOS image, such as a Live.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.
The following commands will move the new kernel and initramfs files to the device's /syslinux directory:
<pre>
bootpath=run/initramfs/live/syslinux
new=3.12.5-302.fc20.x86_64


== See also ==
cd /
[http://www.redhatmagazine.com/2007/11/07/i-am-fedora-and-so-can-you/ Red Hat Magazine | I am Fedora, and so can you!]
mv -f boot/vmlinuz-$new ${bootpath}/vmlinuz0
 
mv -f boot/initramfs-${new}.img ${bootpath}/initrd0.img
== References ==
</pre>


* http://www.redhat.com/archives/fedora-test-list/2007-May/msg00308.html
== See Also ==
* http://www.redhat.com/archives/fedora-livecd-list/2007-April/msg00029.html
* [[Adobe Flash]]

Revision as of 21:20, 4 July 2016

This page explains how to create and use Fedora 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 include a feature called a persistent overlay, which allows changes made to persist across reboots. Without a persistent overlay, the stick will return to a fresh state each time it is booted.

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.

You may also use a non-destructive method to create the stick, meaning existing files on the stick will not be destroyed.

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

However, if you do not need the extended features, it is recommended you use the simplest possible "direct write" method to write the stick, as this will provide the best chance of it booting on the widest possible range of systems (though it will destroy all data on the stick). The way to do this is described in the "quick start" sections at the top of this page. If you wish to use the extended features, those methods are described later in the page.

With current Fedora releases you can also write the non-live Fedora installation images (the DVD and network installation images) to a USB stick, which many users find more convenient and faster than writing to an optical disc. The "direct write" method is always recommended for writing the installation images.

Windows quick start (direct write)

Important.png
Destructive method
This method will destroy all data on the USB stick. Alternative, non-destructive methods are described later in this document.
  1. Download a Fedora image, choose a USB stick that does not contain any data you need, and connect it
  2. Download and run SUSE Studio ImageWriter or Rawrite32
  3. Choose the Fedora image as the Image (SUSE Studio) or Filesystem image (Rawrite32) - if the image file is not shown, you may have to change the file selector options or change the image's extension
  4. Choose the USB stick in the drop-down box by the Copy button (SUSE Studio) or as the Target (Rawrite32)
  5. Double-check you're really, really sure you don't need any of the data on the USB stick!
  6. Click Copy (SUSE Studio) or Write to disk... (Rawrite32)
  7. Wait for the operation to complete, then reboot your computer, and do whatever you need to do to boot from a USB stick - often this will involve pressing or holding down F12, F2 or Del.

Linux (GNOME) quick start (direct write)

Important.png
Destructive method
This method will destroy all data on the USB stick. Alternative, non-destructive methods are described later in this document.

This method is for people running Linux with GNOME, Nautilus and the GNOME Disk Utility installed. 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...
  6. Wait for the operation to complete, then reboot your computer, and do whatever you need to do to boot from a USB stick - often this will involve pressing or holding down F12, F2 or Del.

OS X quick start (direct write)

Important.png
Destructive method
This method will destroy all data on the USB stick. Alternative, non-destructive methods are described later in this document.

Unfortunately, there is no known useful graphical tool for a direct write on OS X. The UNetbootin utility described later in this document works on OS X, but cannot be guaranteed to produce reliably bootable Fedora images. This console-based method is not as graphically easy as using UNetbootin, but it is more reliable.

  1. Download a Fedora image, choose a USB stick that does not contain any data you need, and connect it
  2. Open a terminal
  3. Run diskutil list. This will list all disks connected to the system, as /dev/rdisk1, /dev/rdisk2 and so on. Identify - very carefully! - which one corresponds to the USB stick you wish to use. Hereafter, we'll assume it was /dev/rdisk2 - modify the commands as appropriate for your stick.
  4. Run diskutil unmountDisk /dev/rdisk2
  5. Type dd if=, then drag and drop the Fedora image file to the terminal window - this should result in its filesystem location being appended to the command. Now complete the command with of=/dev/rdisk2 bs=1m, but don't hit Enter yet. You should wind up with something like sudo dd if=/Volumes/Images/Fedora-Live-Desktop-x86_64-20-1.iso of=/dev/rdisk2 bs=1m
  6. Double-check you have the correct disk number and you're really, really sure you don't need any of the data on the USB stick!
  7. Hit Enter
  8. Wait for the operation to complete, then reboot your computer, and hold down the left Alt/Option key to access the boot menu - you should see a Fedora logo. Click this to boot.
Important.png
Creating a live ISO image
A Live USB system is created from the same ISO image file that is used to create CD/DVD media. You can download ISO images for the official Fedora release from the Fedora download site. Consult How to create and use a Live CD for more information on creating your own customized live ISO image file.
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.

System Requirements

  • A working computer running GNU/Linux, Windows or OS X.
  • A USB flash drive, also known as USB stick, thumb drive, pen drive, or jump drive. For most Fedora live images, you will need at least 1 GB or more of storage space. For the network install image, 400 MB or more should be sufficient. For a DVD image, you should have at least 4.7 GB.
  • A Fedora ISO file, which you can download from http://fedoraproject.org/get-fedora.

Ability to boot from USB media

  • 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 its data), the only risk is wasting some time.
  • If your USB stick is not in working order, this procedure may fail. Watch for error messages during the process.

UEFI boot of USB sticks

Important.png
Use a 64 bit image for UEFI
UEFI booting is only supported with the 64bit release of Fedora.

Whether a Fedora image written to a USB stick will be bootable natively via UEFI is a somewhat complex question which depends on the Fedora release, the type of image (live or non-live), and the method used to write it. The --efi parameter to the livecd-iso-to-disk tool attempts to make a stick written with that tool natively UEFI bootable.

As of Fedora 20, all sticks written using "direct write" methods should be UEFI-bootable, at least some sticks written with liveusb-creator should be UEFI-bootable, and all sticks written with livecd-iso-to-disk --format --reset-mbr --efi should be UEFI-bootable. Use of --efi without --format and --reset-mbr can be considered a 'best effort', and may not produce a UEFI-bootable stick. Sticks written with other methods and tools will most probably not be UEFI-bootable.

If you boot a Fedora stick in UEFI native mode and install from it, you will get a UEFI native installation of Fedora. If you wish to do a BIOS native installation of Fedora, you must ensure you boot your stick in BIOS compatibility mode, if your firmware has this capability. The interface for choosing the mode used to boot varies between systems, and so we cannot give precise instructions on this. If you have difficulty, you may want to use a method which is known not to produce a UEFI-bootable stick, and hence force your firmware to boot it in BIOS compatibility mode.

Checking USB disk size / free space

As noted before, the disk must have a certain amount of storage space depending on the type of image you select. If you use a destructive method, the stick must be at least that size; 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

Writing the image

Remember, the most reliable methods, which are recommended if you do not need to preserve the contents of your stick or use any of the advanced features such as storage persistence, are the "direct write" methods described above. Only use these alternative methods if you need to preserve the contents of your stick, or use advanced features.

After the "direct write" methods, The livecd-iso-to-disk method is the second most reliable, and supports all Fedora images and the full range of advanced features. However, it is a command-line tool, and only available for Fedora. The Fedora Media Writer method is less reliable and cannot write non-live images, but it is graphical, and is easily available for Windows and Fedora.

The reliability, ease of use and feature availability of other methods, including UNetbootin, is questionable, and Fedora may be unable to offer support for them.

Using Fedora Media Writer (Windows and Fedora, graphical, destructive)

Fedora Live USB creator.png

Fedora live USB sticks can be created on Windows and Fedora using the Fedora Media Writer utility. You could have known it as 'liveusb-creator'. It cannot create USB sticks from the non-live installer images.

It is graphical, easy to use and it is destructive (will destroy existing data on the stick). Under the hood, it works the same as the "direct-write" method but provides a graphical user interface around it and can download recent Fedora images for you.

On Fedora, you can use a Fedora graphical software installation tool to install the Package-x-generic-16.pngliveusb-creator package, or use the command line. For fedora 22 and later versions use DNF:

su -c 'dnf install liveusb-creator'

Or for Fedora 21 and earlier versions use YUM:

su -c 'yum install liveusb-creator'

On Windows, you can download the installer from the liveusb-creator site.

To run the tool, look for Fedora Media Writer in the system menus, or (in Fedora) run liveusb-creator on the command line.

To use the tool, just choose which Fedora flavor you want to install or try. On the title screen, you can either choose Workstation, Server or your own .iso file. There are more choices under the "..." button on the bottom of the list.

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

After writing, your flash drive will have a changed partition layout and some systems may report it to be about 10MB large. You can fix this yourself or you can insert the drive again while Fedora Media Writer is running and it will provide you with an option to restore a single-partition layout and to create a VFAT partition.


Identifying a stick by /dev name on Linux

The following methods will require you to know the /dev name for your USB stick - e.g. /dev/sdc - when using them on Linux. 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.

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

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 direct write, livecd-iso-to-disk, and liveusb-creator 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.

Unetbootin gtk3.png

  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.

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 tool is the most capable, non-destructive, and second most reliable method of writing a Fedora ISO image to a USB stick, but it 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. Please use (in order of preference) the direct write methods, liveusb-creator, UNetbootin or other third-party tool on other operating systems. It is also 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.

Make sure the livecd-tools RPM is installed with the command:

rpm -q livecd-tools

You will see the name of the RPM and a version number if it is installed, or no output if it is not installed.

If livecd-tools is not installed, install it using this command, or a graphical software installation tool. For Fedora 22 and later versions use DNF:

su -c 'dnf install livecd-tools'

Or for Fedora 21 and earlier versions use YUM:

su -c 'yum install livecd-tools'

Detailed usage information is available in the first pages of the livecd-iso-to-disk script, which you can also see by running this command:

su -c 'livecd-iso-to-disk --help'
There is also the packaged manual page documentation,
man livecd-iso-to-disk

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.

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-Live-Desktop-x86_64-20-1.iso /dev/sdX"

See Data persistence below for how to create Live USB devices with more than temporary storage of user files and settings.

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-Live-Desktop-x86_64-20-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-Live-Desktop-x86_64-20-1.iso /dev/sdX"

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. Alternative, non-destructive methods are described elsewhere in this document.

This method is equivalent to the other "direct write" methods described in the Quickstarts section, 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.

  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 see all mounted partitions with
    lsblk /dev/sdb

    and unmount them with

    umount /run/media/user/mountpoint
  3. Write the ISO file to the device:
    sudo dd if=/path/to/image.iso of=/dev/sdX bs=8M status=progress oflag=direct

    where sdX is the name of your device. Wait until the command completes.
    If you receive dd: invalid status flag: ‘progress’ error, your dd version doesn't support status=progress option and you'll need to remove it (and you won't see writing progress).

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"

(For versions before Fedora 17, use /dev/live instead of /run/initramfs/livedev.)

Booting the image

Set USB as first boot device. Your BIOS may be different.
  1. Power off the computer.
  2. Plug the USB drive into a USB port.
  3. Remove all other portable media, such as CD, DVD, or floppy disks.
  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.

  1. Wait for a safe point to reboot safely.
  2. 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.
  3. 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. If you have a UEFI firmware, you may see choices to boot the stick in UEFI native mode or BIOS compatibility mode: remember that, if you intend to install Fedora, a UEFI native boot will result in a UEFI native Fedora installation, while a BIOS compatibility mode boot will result in a BIOS native Fedora installation.
  4. Save the changes, exit, and the computer should boot the Live USB drive.

Data persistence

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 that kernel updates require manual intervention and overlay space may be insufficient. The primary use of this feature is booting a USB stick with your live image as well as the persistent changes. Note that you will need to have space on your target USB stick for the live image plus your overlay plus any other data you want on the stick.

Use the liveusb-creator tool described above to do this easily. There is a graphical slider in the interface you can use to assign space on the target stick for persistent storage.

If using the livecd-iso-to-disk tool, 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 512 Fedora-Live-Desktop-x86_64-20-1.iso /dev/USBPARTITIONNAME"

where 512 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
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 Device-mapper 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 (see this dm-devel discussion and this page for emergency recovery). 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.

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

For normal, write-many storage, use the --home-size-mb option to create a home directory filesystem for personal files. Home.img can be re-used and loop mounted outside of the Live USB environment.

The persistent overlay status may be queried by issuing this command on the live system:

dmsetup status live-rw

The returned value may look like this:

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.

Troubleshooting

liveusb-creator problems

Partition isn't marked bootable!

If you get the following message, you need to mark the partition bootable.

$ su -c "livecd-iso-to-disk Fedora-Live-Desktop-x86_64-20-1.iso /dev/sdX"
Partition isn't marked bootable!
You can mark the partition as bootable with 
    $ /sbin/parted /dev/sdX
    (parted) toggle N boot
    (parted) quit
Cleaning up to exit...

To mark the partition bootable, run parted, and use the 'toggle X boot' command. For example:

$ parted /dev/sdX
GNU Parted 1.8.6
Using /dev/sdX
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.             

Partitions need a filesystem label!

If you get the following message, you need to label the partition.

$ su -c "livecd-iso-to-disk Fedora-Live-Desktop-x86_64-20-1.iso /dev/sdX"
Need to have a filesystem label or UUID for your USB device
Label can be set with /sbin/dosfslabel
Cleaning up to exit...

To label the partition:

su -c "dosfslabel /dev/sdX LIVE"

Partition has different physical/logical endings!

If you get this message from fdisk, you may need to reformat the flash drive, as described earlier in this guide.

MBR appears to be blank!

If your test boot reports a corrupted boot sector, or you get the following message, you need to install or reset the master boot record (MBR).

$ su -c "livecd-iso-to-disk Fedora-Live-Desktop-x86_64-20-1.iso /dev/sdX"
MBR appears to be blank.
You can add an MBR to this device with
Cleaning up to exit...

To install or reset MBR:

$ su -c "livecd-iso-to-disk --reset-mbr Fedora-Live-Desktop-x86_64-20-1.iso /dev/sdX"

Issues using other Linux distributions

Ubuntu and derivative Linux distributions have a usb-creator program similar to Live USB Creator. 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.

The livecd-iso-to-disk script 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 the "direct write" methods described above.

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

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.

Kernel updates

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-3.12.5-302.fc20.x86_64.img) and kernel (such as vmlinuz-3.12.5-302.fc20.x86_64) should be moved to replace the /run/initramfs/live/syslinux/initrd0.img and /run/initramfs/live/syslinux/vmlinuz0 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 "
compress="xz"' > /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=3.12.5-302.fc20.x86_64

cd /
mv -f boot/vmlinuz-$new ${bootpath}/vmlinuz0
mv -f boot/initramfs-${new}.img ${bootpath}/initrd0.img

See Also