Create a SL6 Live USB


IMPORTANT: This description is valid for SL6 only. For SL4 and SL5 LiveCD please see Install LiveCD SL4 or SL5 to USB stick


Either use the GUI liveusb-creator or do it manually with the command livecd-iso-to-disk from livecd-tools. Where livecd-iso-to-disk is more flexible and supports more features (like a persistent /home).

You can reserve space on your USB stick for data persistence. Data persistence means that your files and settings will remain persistent even after you reboot your Live USB system. Please note that there are some limitations for data persistence. The most important, in case all free persistence space is used up, your USB Live System will no longer boot !

It is also possible to create a Live USB directly from a running LiveCD.

Your USB stick has to be formatted with FAT32 or EXT2, EXT3.

The minimum space requirement is

USB stick size = "ISO image filesize" + 30MB + "size of persistent overlay"

Please see also Troubleshooting Live USB.


liveusb-creator GUI

Install liveusb-creator on Scientific Linux 6.4:

yum --enablerepo=sl-addons install liveusb-creator

Or download liveusb-creator for Windows liveusb-creator-3.11.7-setup.exe (SHA1: 3e874c62c576a90a18f060ff87f5a8d974a9ac75).

IMPORTANT: The USB stick should be formatted with FAT32 when using liveusb-creator !

In the liveusb-creator GUI you can either select a LiveCD from the drop-down menu or you can first download the LiveCD iso file and choose "Use existing Live CD". In this case select the iso file by pressing on "Browse".

Furthermore, specify the amount of space you would like to reserve for persistence storage. Finally press Create Live USB.

Please note the limitations for persistence overlay.


livecd-iso-to-disk

Use the command line tool livecd-iso-to-disk included in livecd-tools. First install livecd-tools

yum --enablerepo=sl-addons install livecd-tools

Assuming the iso image is SL-64-i386-2013-04-17-LiveCD.iso and your USB stick is on device /dev/sdb1 run

livecd-iso-to-disk SL-64-i386-2013-04-17-LiveCD.iso /dev/sdb1

To reserve space for data persistence use option --overlay-size-mb

livecd-iso-to-disk --overlay-size-mb 1024 SL-64-i386-2013-04-17-LiveCD.iso /dev/sdb1

Please note the limitations for persistence overlay.

Further you can create a persistent (and encrypted) /home for your personal data with the option --home-size-mb

livecd-iso-to-disk --home-size-mb 200                    SL-64-i386-2013-04-17-LiveCD.iso /dev/sdb1
livecd-iso-to-disk --home-size-mb 200 --unencrypted-home SL-64-i386-2013-04-17-LiveCD.iso /dev/sdb1

In constrast to the primary system overlay image, the home.img (EXT3 filesystem image) can be re-used and loop mounted outside of the liveusb environment:

mount -o loop /LiveOS/home.img /mnt

To see more options of livecd-iso-to-disk use --help or have a look at the manpage

livecd-iso-to-disk --help
man livecd-iso-to-disk

Create Live USB directly from LiveCD

If possible, first update livecd-tools

yum update livecd-tools

To create a Live USB from a running LiveCD use livecd-iso-to-disk command

livecd-iso-to-disk /dev/sr0 /dev/sdb1
livecd-iso-to-disk --overlay-size-mb 500 /dev/sr0 /dev/sdb1 
livecd-iso-to-disk --overlay-size-mb 500 --home-size-mb 200 --unencrypted-home /dev/sr0 /dev/sdb1 

where /dev/sdb1 is the FAT32 partition of your USB stick. And /dev/sr0 is the CDROM device containing the LiveCD

The command df will show you the CDROM device

df | grep /mnt/live

To find out the device name of the USB FAT32 partition run as root

fdisk -l

This will list the attached hard drive and USB devices and partitions


Data Persistence and its Limitations

On FAT32 formatted USB sticks the overlay size can not be greater than 2047 MB. In case you want larger overlay size use EXT2 or EXT3.

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 subtracts from its free space. Even if you delete a file, disk space will not be released. In case all free space is used up, your USB stick will no longer boot!

The persistent overlay status can be queried by running the following command:

dmsetup status

You should see something like

live-osimg-min: 0 8388608 snapshot 2392/2392 24
live-rw: 0 8388608 snapshot 47640/2086912 200

were the numbers are in 512-byte. In this case the snapshot has a total size of 2086912 / 2 = 1043456 KB = 1019 MB and 47640 / 2 = 23820 KB = 23.3 MB are used.


Links




Last modified: Saturday, 20-Apr-2013 22:28:54 CEST by Urs Beyerle