LiveUSB/Guide

This HOWTO explains how to create a Gentoo Linux LiveUSB or, in other words, how to emulate an x86 or AMD64 Gentoo Linux LiveCD using a USB flash drive.

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

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

Prerequisites
In order to use a Gentoo Linux LiveUSB you need the following:


 * Bootable USB flash drive with at least 1GB
 * i686 or x86_64 computer with support for booting from USB

You will also need access to the following for creating the LiveUSB:


 * A computer running Gentoo Linux (or alternatively another Linux distribution)

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

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

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

Mounting the Gentoo Linux Installation CD
Download the Gentoo Weekly Minimal Install CD for your architecture from your local Gentoo Linux mirror site and mount the ISO image on as shown below:

Mounting the Gentoo Linux Installation CD ISO image

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

Copying the files
Copy the files from the Gentoo Linux Installation CD to the LiveUSB. The files need to be reordered a bit as we will be using the  bootloader instead of   :

You can now 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 flash drive to settle upon detection.

Unmounting the drive
Make sure you unmount the USB flash drive before installing the bootloader:

Installing syslinux
Finally install the  bootloader on the USB flash drive:

Booting
Insert the USB flash drive and turn on the computer, making sure the BIOS is set to boot from USB. If all goes well you should be presented with a standard syslinux prompt.

You should be able to follow the generic installation instructions found in the Gentoo Handbook from here on.

Acknowledgements
We would like to thank the following authors and editors for their contributions to this guide:


 * brix
 * neysx