From Fedora Project Wiki
Line 178: Line 178:
Entrambi questi metodi funzionano con tutte le immagini Fedora, non solo con le live: si possono usare {{command|dd}} o {{command|livecd-iso-to-disk}} per scrivere un Fedora DVD o un'installazione in rete su chiavetta USB. Tuttavia per Fedora 15, le immagini non-live non possono essere scritte con {{command|dd}}.
Entrambi questi metodi funzionano con tutte le immagini Fedora, non solo con le live: si possono usare {{command|dd}} o {{command|livecd-iso-to-disk}} per scrivere un Fedora DVD o un'installazione in rete su chiavetta USB. Tuttavia per Fedora 15, le immagini non-live non possono essere scritte con {{command|dd}}.


==== Using dd for a direct copy ====
==== Usare <code>dd</code> per la copia diretta ====


{{admon/warning | CAUTION | This will erase all data on the USB drive! Please read the instructions below ''carefully''.}}
{{admon/warning | ATTENZIONE | Questo potrebbe cancellare tutti i dati contenuti nel drive USB! Si prega di leggere ''attentamente'' le prossime istruzioni.}}


You can simply use dd (or similar direct imaging tools for other operating systems) to write a Fedora ISO to USB, although the specialized tools have additional features like non-destructive writing and data persistence. dd will always destroy any other data on the target stick, and cannot provide a persistent environment.
Si può semplicemente usare <code>dd</code> (o strumenti simili per altri sistemi operativi) per scrivere la ISO Fedora nel dispositivo USB, sebbene strumenti specializzati abbiano capacità addizionali come la scrittura non-distruttiva e la persistenza dei dati. <code>dd</code> distruggerà sempre qualsiasi altro dato nella chiavetta e non può fornire un ambiente persistente.
<pre>
<pre>
su -c 'dd if=Fedora-16-x86_64-Live-Desktop.iso of=/dev/sd''X'' bs=8M'
su -c 'dd if=Fedora-16-x86_64-Live-Desktop.iso of=/dev/sd''X'' bs=8M'
</pre>
</pre>
Note that in this specific case you want the device name (e.g. /dev/sdb) not the partition name (e.g. /dev/sdb1).
Notare che in questo caso specifico si vuole il nome del dispositivo (/dev/sdb) e non il nome della partizione (/dev/sdb1).


An equivalent for Windows is the [http://www.chrysocome.net/rawwrite RawWrite for Windows tool]. It should be capable of writing Fedora images much as described above, but this is not regularly tested.
L'equivalente per Windows è [http://www.chrysocome.net/rawwrite RawWrite per Windows]. Dovrebbe essere in grado di scrivere le immagini Fedora come scritto sopra ma non è regolarmente testato.


In Fedora versions prior to {{FedoraVersion|long|17}}, a DVD image written to a USB stick with dd or an equivalent tool will function as a network installation image unless a special kernel parameter is added on boot: it will be capable of performing an installation, but it will need to retrieve packages from network repositories, it will not be able to use the packages present on the stick. To allow the installer to find the packages present on the stick, use the [[Anaconda/Options#repo|anaconda ''repo='' parameter]], pointing to the USB stick by its device node, label or UUID. DVD images of {{FedoraVersion|long|17}} do not suffer from this limitation.
Nelle versioni di Fedora precedenti a {{FedoraVersion|long|17}}, un'immagine DVD scritta su chiavetta USB con <code>dd</code> o strumento equivalente funzionerà come un'immagine per l'installazione in rete senza che venga aggiunto uno speciale parametro kernel all'avvìo: darà la possibiltà di installare ma servirà recuperare i pacchetti dai repository in rete, mentre non potrà usare i pacchetti già presenti nella chiavetta. Per permettere all'installatore di trovare i pacchetti nella chiavetta, usare il [[Anaconda/Options#repo|anaconda paramentro ''repo='']], puntando alla chiavetta attraverso ''device node'', ''label'' o ''UUID''. Le immagini DVD di {{FedoraVersion|long|17}} non hanno questa limitazione.


==== Using the {{command|livecd-iso-to-disk}} tool ====
==== Using the {{command|livecd-iso-to-disk}} tool ====

Revision as of 09:45, 26 July 2012

Stop (medium size).png
La traduzione di questa pagina è incompleta.
This page is not translated completely. Language target: italian

Questa pagina spiega come creare ed usare una Fedora su support0 USB. Una live USB memorizzata in una memoria flash, a volte chiamata stick, permette l'avvìo di qualsiasi computer USB-bootable in un ambiente Fedora senza la scrittura fisica del disco rigido. Il Live USB può disporre di un'area per la memorizzazione delle modifiche di sistema, chiamata persistent overlay (letteralmente, strato persistente). Può anche avere un'area di memorizzazione separata per i dati dell'utente come download e documenti con opzioni per la criptazione. Infine con un'installazione non distruttiva, i file preesistenti e lo spazio in eccesso saranno accessibili dal sistema. Essenzialmente sarebbe un PC tascabile avviabile ovunque possibile.

Con gli attuali rilasci di Fedora è possibile masterizzare le immagini d'installazione non-live di Fedora (DVD ed installazioni in rete) in un dispositivo USB, molti utenti le ritengono più convenienti e veloci rispetto ai CD.

Note.png
Avvìo veloce
Il processo per molti utenti è semplice. Quasi tutte le chiavette USB sono pronte all'uso. Se contengono documenti, non è una cattiva idea farne una copia prima di iniziare.

Successivamente riavviare il sistema ed impostare l'avvìo del PC da dispositivo USB -- solitamente è un tasto speciale da premere all'accensione come F12.

Per i dettagli tecnici o per maggiori informazioni sugli strumenti alternativi e di uso avanzato, continuare nella lettura.
Warning.png
Usare UNetbootin
Dopo ogni release, il volontari per il supporto Fedora ricevono delle segnalazioni di problemi con l'installazione delle immagini con Unetbootin. Usare la più recente versione disponibile assicura migliori risultati. Tuttavia usare liveusb-creator può fornire migliori lavori. Se si riscontrano problemi con Unetbootin, si prega di contattare i suoi sviluppatori; non quelli di Fedora .


Important.png
Creazione dell'immagine ISO Live CD
Un sistema Live USB è creato dalla stessa immagine ISO usata per creare i Live CD/DVD. E' possibile scaricare le immagini Fedora ufficiali dal sito. Consultare How to create and use a Live CD per maggiori informazioni sulla creazione della propria immagine ISO.

Requisiti di sistema

  • Un computer da lavoro con Fedora o Windows. Se si usano altre distribuzioni Linux, considerare l'uso di dd oppure di UNetbootin. Quest'ultimo è anche disponibile per Mac OS X e Windows, così come nei repository Fedora.
  • Un USB flash drive, conosciuto anche come USB stick, thumb drive, penna USB o jump drive, con 1 GB o più di memoria su filesystem vfat (standard per quasi tutti i dispositivi USB off-the-shelf -- di serie)

Possibilità d'avvìo da dispositivo USB

Anche se quelli più moderni ne sono capaci, non tutti i computer possono avviarsi da dispositivi a causa di differenti impostazioni del BIOS o capacità di sistema. Se il PC non ha questa capacità, questa procedura è inutile. Se non se ne è sicuri e si è disposti a scaricare ed installare un immagine nella pennetta USB (possibilmente ripulendola dai dati), il solo rischio sarebbe quello di perder tempo.

Se la chiavetta USB non è in buone condizioni, questa procedura potrebbe non riuscire. Osservare i messaggi di errore durante il processo.

Alcuni flash drive potrebbero non essere avviabili, anche se l'hardware è in grado di farlo. Potrebbe essere necessario marcarne la partizione come avviabile o riformattarla. Vedere Problemi e soluzioni di seguito per maggiori informazioni.

Chiavette USB sufficientemente capienti

Le dimensioni in molte chiavette USB sono indicate sulla confezione o sul corpo esterno stesso.

Se non si conoscono o si vogliono controllare, si dovrebbe essere in grado di montarle automaticamente semplicemente inserendole nella porta USB. E' possibile controllarne il contenuto e la capacità usando il file manager grafico. In Linux, si può anche usare il comando df -h:

$ 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

I drive USB sono usualmente montati in /media o /run/media/username/. In questo caso il dispositivo è /dev/sdb1, ha una capacità di 3.9GB ed è quasi vuoto. Come regola si dovrebbero usare chiavette con almeno 1 GB di spazio libero per scriverci un'immagine live ed una di almeno 4 GB per scrivere un'immagine DVD.

Notare /dev/sdb1 o equivalente; bisogna specificare il dispositivo se si usa il metodo a linea di comando. E' la stringa che sostituisce USBPARTITIONNAME laddove serve nelle istruzioni di seguito.

Opzionale: ripartizione e formattazione della chiavetta USB

Se la chiavetta USB ha una partizione FAT con una discreta quantità di spazio libero, la ripartizione/formattazione può essere saltata continuando a seguire i passaggi seguenti. Questo permetterebbe l'aggiunta dell'immagine live Fedora senza la distruzione di dati già presenti. Tuttavia è altamente raccomandato fare una copia di tutti i dati prima di procedere nel caso qualcosa dovesse andare male.

Se si ha qualche difficoltà con l'installazione non-distruttiva, provare prima a resettare il master boot record (MBR) con l'opzione --reset-mbr.

Occasionalmente un filesystem può essere danneggiato rendendo necessarie sia la ripartizione che la formattazione. In caso contrario è raccomandato mantenere la formattazione di fabbrica del dispositivo.

Come ripartizionare

Warning.png
ATTENZIONE
Questo cancellerà tutti i dati della chiavetta USB! Si prega di leggere attentamente le istruzioni sotto.
Note.png
Saltare se si usa il metodo da riga di comando
Se si intende usare lo strumento livecd-iso-to-disk documentato di seguito, è possibile saltare questo passaggio ed il prossimo Come formattare passando semplicemente i parametri --format --msdos e --reset-mbr

Se il drive non è stato partizionato bene (o se si è insicuri), usare fdisk per ripartizionarlo.

Includere solo il nome del drive nel comando, non il numero della partizione.
Assicurarsi di aver selezionato il disco corretto, c'é il rischio di cancellare dati importanti!
Controllare l'output di df -h per sicurezza. Ad esempio se la partizione sarà /dev/sdb1, allora:

su -c 'fdisk /dev/sdb'

Se fdisk non è installato, avviare il comando su -c 'yum install util-linux-ng'.

La sessione d'output seguente da fdisk mostra le risposte da dare al prompt. La linea che inizia con Last cylinder ... si riferisce alla dimensione del drive quindi potrebbe differire da quella dell'esempio. Il comando d cancella una partizione esistente; il comando n crea una nuova partizione; il comando t ne imposta il tipo; w esegue materialmente le modifiche (in qualsiasi punto prima di avviare il comando w è possibile fermare fdisk senza fare alcuna modifica sul disco).

 Command (m for help): '''d''' 
 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.

Come riformattare

Warning.png
ATTENZIONE
Questo cancellerà tutti i dati sul drive USB! Si prega di leggere attentamente le istruzioni sotto.

Per finire, la partizione deve essere formattata con un filesystem reale usando mkfs.vfat come utente root. Smontare il dispositivo prima usando mkfs.vfat. Nel seguente esempio, /dev/USBPARTITIONNAME potrebbe essere ad esempio /dev/sdb1. Assicurarsi di aver selezionato la giusta partizione; la formattazione distruggerà tutti i dati!

su -c 'umount /dev/USBPARTITIONNAME'
su -c 'mkfs.vfat -F 32 -n usbdisk /dev/USBPARTITIONNAME'

Per installare mkfs.vfat avviare il comando yum install dosfstools come root.

Scaricare una ISO

(Se si intende usare il metodo "Grafico" con un rilascio Fedora supportato, si può saltare questo passaggio. Il programma scaricherà la ISO automaticamente)

Per scaricare la ISO è possibile usare BitTorrent o un browser web.

Collegamenti veloci:

Notare i file con la digitura "Live", solitamente nominati nella forma Fedora-<version>-<architecture>-Live-Desktop.iso. Ad esempio, Fedora-39-x86_64-Live-Desktop.iso è il rilascio F39 per le CPU 64-bit Intel-compatible. Scegliere il file corretto per la propria architettura. I rilasci 32-bit generalmente funzionano su hardware 64-bit ma non saranno ottimizzati.

Queste istruzioni sono utili anche per le immagini Custom Spins di Fedora Live ISO incluse quelle fatte con Revisor (strumento grafico) o con LiveCD Creator (strumento a linea di comando usato da Revisor). Pungi è anch'esso uno strumento a linea di comando usato per creare ISO installabili ma non Live.

Se si usa un LiveUSB con dati persistenti, usare il metodo "yum update" descritto di seguito per ottenere gli ultimi RPM Rawhide (soprattutto per i tester e non per l'uso giornaliero) eccetto il kernel. Vedere Releases/Rawhide per maggiori informazioni sulle daily builds.

Le nightly test composes saranno costruite dai rilasci Branched quando possibile e dalle Rawhide quando non sono disponibili le Branched.

Scrivere sulla chiavetta

Metodo grafico - Windows o Fedora

Le chiavette Fedora USB possono essere create in Windows e Linux usando liveusb-creator. Notare che questo software è in grado di scrivere solo immagini live. Per scrivere immagini non-live, si deve usare uno dei due metodi a riga di comando documentati sotto.

Per Windows seguire i seguenti passaggi:

  • Scaricare liveusb-creator dal sito
  • Doppio click su 'liveusb-creator'

In Fedora, si può usare Add/Remove Programs in cui cercare liveusb-creator oppure da terminale:

su -c 'yum install liveusb-creator'

Per iniziare, avviare nel terminale il comando liveusb-creator oppure dal menu di GNOME selezioanare Applicazioni -> Strumenti di sistema -> liveusb-creator.

Per usare il tool selezionare semplicemente un rilascio Fedora da scaricare dal menu a tendina in alto a destra (o selezionare una ISO già scaricata usando il pulsante Browse in alto a sinistra), selezionare poi la chiavetta USB nella quale scrivere l'immagine dal menu Target Device e premere il pulsante Create Live USB.

Metodo a riga di comando

Negli esempi seguenti rinpiazzare /path/to/ISO con ad esempio Fedora-16-x86_64-Live-Desktop.iso o il percorso completo alla ISO da scaricare, ad esempio /tmp/Fedora-16-x86_64-Live-Desktop.iso.

Rimpiazzare /dev/USBPARTITIONNAME con il nome appropriato della partizione. Per esempio, /dev/sdb1 dell'esempio precedente ("Controllare la dimensione del drive USB"). Assicurarsi di specificare il corretto dispositivo, si potrebbero perdere dati importanti!

Entrambi questi metodi funzionano con tutte le immagini Fedora, non solo con le live: si possono usare dd o livecd-iso-to-disk per scrivere un Fedora DVD o un'installazione in rete su chiavetta USB. Tuttavia per Fedora 15, le immagini non-live non possono essere scritte con dd.

Usare dd per la copia diretta

Warning.png
ATTENZIONE
Questo potrebbe cancellare tutti i dati contenuti nel drive USB! Si prega di leggere attentamente le prossime istruzioni.

Si può semplicemente usare dd (o strumenti simili per altri sistemi operativi) per scrivere la ISO Fedora nel dispositivo USB, sebbene strumenti specializzati abbiano capacità addizionali come la scrittura non-distruttiva e la persistenza dei dati. dd distruggerà sempre qualsiasi altro dato nella chiavetta e non può fornire un ambiente persistente.

su -c 'dd if=Fedora-16-x86_64-Live-Desktop.iso of=/dev/sd''X'' bs=8M'

Notare che in questo caso specifico si vuole il nome del dispositivo (/dev/sdb) e non il nome della partizione (/dev/sdb1).

L'equivalente per Windows è RawWrite per Windows. Dovrebbe essere in grado di scrivere le immagini Fedora come scritto sopra ma non è regolarmente testato.

Nelle versioni di Fedora precedenti a Fedora 17, un'immagine DVD scritta su chiavetta USB con dd o strumento equivalente funzionerà come un'immagine per l'installazione in rete senza che venga aggiunto uno speciale parametro kernel all'avvìo: darà la possibiltà di installare ma servirà recuperare i pacchetti dai repository in rete, mentre non potrà usare i pacchetti già presenti nella chiavetta. Per permettere all'installatore di trovare i pacchetti nella chiavetta, usare il anaconda paramentro repo=, puntando alla chiavetta attraverso device node, label o UUID. Le immagini DVD di Fedora 17 non hanno questa limitazione.

Using the livecd-iso-to-disk tool

The livecd-iso-to-disk is the most capable and often most reliable method of writing a Fedora ISO image to a USB stick, but can only reliably be used from within Fedora. It does not work in Windows and is not supported (and will usually fail) in non-Fedora distributions. Please use the liveusb-creator tool, dd (or an equivalent tool), or a third-party tool such as unetbootin 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.

livecd-iso-to-disk is usually available in the /LiveOS directory of the Live CD .iso file. You may loop mount the .iso, and procede as below, assured that you are using the version intended for your image:

Make a mount point:

$ su -c "mkdir /tmp/live"

Mount the .iso filesystem on your mount point:

$ su -c "mount Fedora-16-x86_64-Live-Desktop.iso /tmp/live"

Confirm the availability of /LiveOS/livecd-iso-to-disk:

$ ls /tmp/live/LiveOS

If the livecd-iso-to-disk script is not listed, your will need to obtain it from another source. Check if the livecd-tools RPM is installed with this 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 PackageKit:

$ 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 su -c 'livecd-iso-to-disk --help'. Basic examples follow.

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:

If livecd-iso-to-disk is available in the .iso filesystem,

$ su -c "/tmp/live/LiveOS/livecd-iso-to-disk Fedora-16-x86_64-Live-Desktop.iso /dev/USBPARTITIONNAME"

otherwise,

$ su -c "livecd-iso-to-disk Fedora-16-x86_64-Live-Desktop.iso /dev/USBPARTITIONNAME"

(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-16-x86_64-Live-Desktop.iso /dev/USBPARTITIONNAME"
Warning.png
CAUTION
The following method 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. This is similar to performing the manual re-partitioning and re-formatting steps described earlier in this guide.

$ su -c "livecd-iso-to-disk --format --msdos --reset-mbr Fedora-16-x86_64-Live-Desktop.iso /dev/USBPARTITIONNAME"

UEFI boot of USB sticks

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 17, all images written using the dd method should be UEFI-bootable, and all images written with livecd-iso-to-disk --format --reset-mbr --efi should also 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.

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 Graphical Method 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-16-x86_64-Live-Desktop.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 2047 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 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 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. 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 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.

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:

su -c "livecd-iso-to-disk /run/initramfs/livedev /dev/USBPARTITIONNAME"
(For versions before Fedora 17, use /dev/live instead of /run/initramfs/livedev.)

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.

Problems and solutions

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-16-x86_64-Live-Desktop.iso /dev/USBPARTITIONNAME"
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...

To mark the partition bootable, run parted, and use the 'toggle X boot' command. 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/sdb: 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/sdb: 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-16-x86_64-Live-Desktop.iso /dev/USBPARTITIONNAME"
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/USBPARTITIONNAME 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-16-x86_64-Live-Desktop.iso /dev/USBPARTITIONNAME"
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-16-x86_64-Live-Desktop.iso /dev/USBPARTITIONNAME"

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 described above.

Testing Live Image on USB

You can test your Live Image on USB using QEMU as shown in the screenshot below.

For example, if your USB flash drive is /dev/sdb, you could type the following commands:

su -c 'umount /dev/sdb1'
qemu -hda /dev/sdb -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 either the /mnt/live or /run/initramfs/live mount point. The new initramfs (such as initramfs-3.3.2-6.fc16.x86_64.img) and kernel (such as vmlinuz-3.3.2-6.fc16.x86_64) should be moved to replace the /mnt/live/syslinux/initrd0.img and /mnt/live/syslinux/vmlinuz0 files, respectively.

  • Note: Beginning with Fedora 17, dracut no longer includes the dmsquash-live module by default. So one should include it in /etc/dracut.conf with, for example,
    # echo 'add_dracutmodules+=" dmsquash-live "' >> /etc/dracut.conf

The following commands will move the new kernel and initramfs files and create symbolic links to them, in case one later wants to perform a full install of the image to a hard disk.

bootpath=run/initramfs/live/syslinux
# bootpath=mnt/live/syslinux
new=3.3.2-6.fc16.x86_64
cd /
mv -f boot/vmlinuz-$new ${bootpath}/vmlinuz0
mv -f boot/initramfs-${new}.img ${bootpath}/initrd0.img
 
ln -fs -T ../${bootpath}/vmlinuz0 boot/vmlinuz-$new
ln -fs -T ../${bootpath}/initrd0.img boot/initramfs-${new}.img

See also

Red Hat Magazine | I am Fedora, and so can you!

References