#include <infodrom.style>
#include <debian.style>

<page title="Debian Tips">

<h1 align=center>Howto install Debian on a USB stick</h1>

<p>Installing a GNU/Linux system on a USB stick is easy, but booting
from a stick is not.  The overall installation of the GNU/Linux system
on the USB stick is similar to any other storage medium.  Today USB
sticks are recognised as <code>/dev/sdX</code> just like regular hard
disks.</p>

<p>Since USB sticks tend to be slow it is wise to reduce disk access
as much as possible.  This is best done during the installation but
can be done later as well if it is forgotton first.</p>

<p>You should select <code>ext2</code> instead of <code>ext3</code>
and add both options <code>noatime</code> and <code>relatime</code> to
the list of filesystem options.  The rest of the installation is as
usual.  You might want to skip a swap partition, though.</p>

<p>After the installation is done, switch to the second console (using
<code>Alt-F2</code>) to adjust the boot system.  Switch to the
installed system with <code>chroot /target</code> and edit
<code>/boot/grub/menu.lst</code> using VI or any other editor you have
installed already.  You'll need to add <code>rootdelay=8</code> to
both kernel commandlines and to the <code>kopt=</code> line.  This
allows the initial ramdisk to to wait a few seconds until the USB
stick is recognised as such before the root filesystem is mounted.
Without this option Linux won't fine a root filesystem and will panic
with a VFS error.</p>

<p>The Linux kernel names disk drives and usb sticks automatically.
It is possible that <code>sda</code> on one system becomes
<code>sdc</code> on another system.  Therefore it is not reliable to
keep such a setting on the kernel commandline.  However, modern
GNU/Linux systems create a unique UUID for every new filesystem.</p>

<p>For USB sticks that may be named differently on the next boot it is
helpful to use the UUID instead of the device name.  Therefore edit
the <code>menu.lst</code> file again and exchange all occurrences of
<code>/dev/sda1</code> with <code>UUID=XXX</code> where XXX is what
<code>blkid /dev/sda1</code> emits as the UUID for the root
filesystem.  You should alter your <code>/etc/fstab</code> file as
well.</p>

<p>With these few adjustments your Debian GNU/Linux system is able to
boot off of a USB stick including X11 and GNOME or KDE.</p>

</page>

# Local variables:
# mode: indented-text
# end:
