Compressed R/W installation on USB stick

This article describes how to install Gentoo Linux on an USB mass storage device. In contrast to catalyst you will be able install new packages afterwards and make permanent changes to the configuration.

Preparation
Start with download the latest stage3 tarball. Create the / directory, for this tutotial we use ,

Cd to ,

Untar the stage3 tarball here, following the example below,

Copy to your to our custom stage,

Mount(bind), and  to your to our custom stage,

Chroot into your custom stage,

From now on we assume you stay in the chroot.

Update the environment,

Remove the and  lines from  and replace the  line with the following,

Find out the device ID of your USB Mass Storage device and get the UUID,

The output should be similar to the following, note the UUID, /dev/sdb1: UUID="494A-A6DB" TYPE="vfat" Mount the device by UUID,

Kernel Configuration
Emerge

Genkernel
Start with installing ,

Cd to the linux sources,

Run genkernel,

Let the kernel build. When complete, copy over the kernel image and initramfs image to the mounted USB device,

GRUB
In order for your USB stick to be bootable you need to install ,

When installed, setup GRUB using the emerge --config switch,

You should be presented with the following question, * Enter the directory where you want to setup grub: Enter. You can ignore Operation not permitted messages.

Now start GRUB,

Set root to your USB device,

Setup GRUB,

And last, exit GRUB,

Create squashfs image
commands

Cleanup
commands