LiveUSB/Guide

This article explains how to create a Gentoo LiveUSB or, in other words, how to emulate a or  Gentoo LiveCD using a USB drive. This is particularly useful for installing Gentoo on a modern laptop with no CD-ROM drive.

Although the instructions found in this document aim at emulating a Gentoo LiveCD using a USB drive, they should work for any arbitrary block device as long as the device names are adjusted accordingly.

Prerequisites
In order to use a Gentoo LiveUSB the following will be needed:


 * Bootable USB drive with at least 1GB (the bigger the better);
 * i686 or x86_64 computer with support for booting from USB

Access to the following is needed for creating a LiveUSB:


 * A computer running Gentoo (or alternatively another Linux distribution);
 * A computer running Microsoft Windows with the appropriate software (see the Windows section below)

dd
When using the latest install ISOs (installcds or livedvd), it is sufficient to directly copy the ISO contents on the USB device. The command can be used to accomplish this. For instance, assuming the USB device is at :

On Windows, the command is also available through various projects, such as GNUWin32 or Chrysocome.

The remainder of this document explains how to setup a manual vfat partition that is writable using the syslinux bootloader instead of isolinux.

Automatic drive-wide installation
The script will make an USB stick suitable for both BIOS and UEFI systems.

Partitioning the drive
Create a FAT16 partition on the USB drive and mark it bootable using. An example partitioning scheme can be seen below:

Creating the filesystem
Create a FAT16 filesystem on the USB drive using :

Installing a Master Boot Record (MBR)
Install the precompiled Master Boot Record (MBR) from on the USB drive:

Mounting the Gentoo Minimal Installation CD
Download a Gentoo Minimal Installation CD for the system's architecture from a the main site's download page and mount the ISO image on as shown below:

Adjust the  as necessary to the location of the downloaded Minimal Installation CD ISO.

Mounting the LiveUSB
Mount the newly formatted USB drive on as shown below:

Copying the files
Copy the files from the Minimal Installation CD to the LiveUSB. The files need to be reordered since will be used as the bootloader instead of :

Unmount the ISO image:

Adjusting the bootloader configuration
Adjust the syslinux configuration file using as shown below. The  parameter will introduce some extra delays before attempting to mount the filesystem. This is needed to allow the USB drive to settle upon detection.

Unmounting the drive
Make sure the USB drive has been unmounted before installing the bootloader:

Installing syslinux
Finally install the bootloader on the USB drive:

Rufus
Rufus is a free and open source project created to successfully image USB drives with a variety of operating systems. It tends to be faster than the Universal USB installer (see in the next section).

Rufus can be downloaded from the project's homepage.

Rufus is so easy to use that instructions for its use are not needed for this article. Seriously, go check it out! If questions do come up, check out Rufus' FAQ page.

Universal USB Installer
Universal USB installer is one of the oldest Linux-capable LiveUSB creators for Windows systems. It supports most Linux distributions, and has a simple, helpful wizard for selecting the Linux distribution. For Gentoo Minimal Installation CDs, however, select the which is at the very bottom of the list. Select the proper USB drive to format and extract Linux to, and click.

Universal USB installer can be downloaded from its homepage.

Booting
Insert the USB drive and turn on the computer, make sure the BIOS (or EFI firmware) has been set to boot from USB. If all goes well a standard syslinux prompt should appear on the screen.

Follow the generic installation instructions found in the Gentoo Handbook appropriate to the system's architecture from here on to install Gentoo!

External resources

 * Installing SystemRescueCd on a USB stick — The very popular alternative