Linux in your pocket: Run SLAX from your USB keychain

You can run some Linux distributions entirely from CDs and now, from a tiny USB keychain. Vincent Danen gives you the basics on running the SLAX distro from this handy-sized device.

The ability to carry around a Linux distribution in your pocket has been available for some time with the advent of so-called "Live CDs," which are Linux distributions that run entirely from a CD-ROM. The availability of such distributions, like Knoppix, is invaluable from a recovery standpoint and just plain cool from a geek standpoint.

With the cheap availability of USB keychain drives, running Linux off of a USB keychain makes carrying around a recovery installation even easier. While they are more expensive than a CD-ROM, USB keychains are a fraction of the size.

There are a few distributions that will run from CD-ROM or a USB keychain device; one is SLAX, available at To install it, download the ISO for your chosen "edition;" for instance, the SLAX Standard Edition is currently at version 5.1.6 and contains KDE and a number of applications.

Once the ISO is downloaded, plug in the USB keychain device you plan to use. Most distributions will automount it, so unmounting it will allow you to format the device and copy the contents of the SLAX ISO to it:

# umount /mnt/removable
# mkdosfs -F 16 /dev/sda1
# mount -o loop slax-5.1.6.iso /mnt/cdrom
# cd /mnt/cdrom
# ./ /dev/sda1

Newer versions of SLAX provide the script; a batch file is also included for Windows users. This script makes previous requirements of manual setup obsolete and does it all in one step. However, depending on the USB keychain device you use, you may need to set the primary partition bootable or active, which can be done in fdisk:

# fdisk /dev/sda

Type a and select partition 1, which will toggle the bootable flag. Finally, type w to write the changes to the device. All of this, of course, assumes that /dev/sda is the USB device; be sure to verify the device name before formatting!

Once this is complete, reboot and change the boot order in your BIOS to boot from the USB device. When SLAX boots, you will be able to log in, start the X window system and KDE, and enjoy a number of applications.

Delivered each Tuesday, TechRepublic's free Linux NetNote provides tips, articles, and other resources to help you hone your Linux skills. Automatically sign up today!

About Vincent Danen

Vincent Danen works on the Red Hat Security Response Team and lives in Canada. He has been writing about and developing on Linux for over 10 years and is a veteran Mac user.

Editor's Picks

Free Newsletters, In your Inbox