Knoppix in your pocket

USB keys have become a really cheap method of stor­age, and have reached sizes up to 2GB. In this month's column, I'll show you how to install Knoppix - a distribution of Linux that runs entirely from CD - on a USB Key drive, making it even more portable.

These instructions will work for any Knoppix-based Linux distribution ( There are many variants on Knoppix, including Damn Small Linux (, a tiny 51MB version of Knoppix intended for use on a CD business card. As luck would have it, Damn Small Linux is perfect for use on smaller 128/256MB USB keys, and I've included a copy of the latest Damn Small Linux CD Image on this month's cover CD.

Before proceeding with the Knoppix installation, back up and erase all of the data from your USB Key. The chances are that the Knoppix installation will take up most of the space on the key, and the process is much easier to perform on an empty drive.

Installation from CD

I have carried out the entire installation for this article while running Knoppix directly from a CD. This article assumes you will do the same. First, attach the USB key to your computer and wait a few seconds for it to be detected. Many keys have a light that will flash when the key is initialised by the operating system. To confirm the key is detected, type the following command in a shell and look for a message similar to the one below:

$ dmesg Attached scsi removable disk sda at scsi2, channel 0, id 0, lun 0

This message tells me that my USB key has been detected and its name will either be /dev/sda or /dev/sda1 depending on the model of the key. In my case the key is /dev/sda, but it may be /dev/sda1 in your case.

To carry out the Knoppix installation, you will need to be root to execute most commands. To become root, type the following command and the prompt will change to a # character, as indicated for the rest of this article.

$ su

The first step is to copy the Knoppix CD to the USB key. First mount the key by typing:

# mount /dev/sda /mnt/sda # cd /mnt/sda

If the mount command fails, try a different device name such as /dev/sda1.

Next, copy the Knoppix CD to the USB key with the following commands. This will probably take some time as you will be copying around 700MB of data.

# cp /cdrom/boot/isolinux/* /mnt/sda # cp -r /cdrom/KNOPPIX/ /mnt/sda

The following step is the hardest part of the installation process. We need to modify Knoppix to detect and boot from the USB key instead of a CDROM, which it has been designed for. To perform the modification, first make a copy of the 2.4 kernel root environment with the following commands:

# mkdir /mnt/miniroot # cp minirt24.gz /tmp

This environment is compressed in the GZip format, the file must first be decompressed before it can be accessed. Type the following to decompress the environment:

# gunzip /tmp/minirt24.gz

Now we can mount the environment as if it is another disk on the computer. Use the following command to mount the file as a live file system.

# mount -o loop /tmp/minirt24 /mnt/miniroot

To perform the modification, open the file /mnt/miniroot/linuxrc in a text editor (for example type # vi /mnt/miniroot/linuxrc). Under Knoppix version 3.7 (released 08/12/2004) the line we need to go to is #326 and contains the following text. To skip to this line in vi, type :326

line 326 test -n "$FOUND_SCSI" -a -z "$NOSCSI" && DEVICES=" $DEVICES /dev/sd?[1-9] /dev/ sd?[1-9][0-9]"

Immediately after this line, add the following text. To do this in vi press A once you have highlighted the end of this line using the arrow keys, next hit and type the line below. When you are done in vi hit and type :wq to save the changes to disk.

test -n "$FOUND_USB" -a -z "$NOUSB" && DEVICES=" $DEVICES /dev/sd?[1-9] /dev/ sd?[1-9][0-9]"

Now that the modification has been completed, we need to recompress the root environment and copy it back to the USB key. Use the following commands:

# cd /tmp # umount /mnt/miniroot # gzip minirt24 # cp minirt24.gz /mnt/sda

You can perform the same operation on the minirt26.gz file contained in /mnt/sda if you want, this environment is for the 2.6 kernel included with Knoppix 3.7. We're almost there! The last step is to make the USB Key bootable. First, some housekeeping with the following commands:

# cd /mnt/sda # mv isolinux.cfg syslinux.cfg # rm isolinux.bin

Finally, enter the following commands to make the USB key bootable:

# cd / # umount /mnt/sda # syslinux /dev/sda

To try the USB key, shut down your computer and enter the BIOS menu (you can access this by pressing or on most computers during the first screen that appears immediately after turning your computer on). In the BIOS menu go to the boot menu and adjust the boot order to feature any item with USB in it toward the top. Most commonly, a USB key will boot from the device named USB-Zip or similar.


In researching for this article I came across A style Web site devoted entirely to new Linux distribution news. is the ultimate directory for Linux distributions and contains excellent information on the major software and features of every distribution you can imagine. This Web site is a great resource for uncovering weird and esoteric versions of Linux devoted to tasks such as firewalls and business card CD demonstrations.


Damn Small Linux is a tiny Knoppix derived distribution intended for use on 3in business card CDs. The distribution includes a basic set of desktop applications, the names of which may not be familiar as size rather than features has been the main reason for the choice of each, designed to cover most day-to-day uses of a computer.

A word processor is included, but the feature set is more akin to Microsoft Write than Word. Media players and IM clients are well supported, as are many standard network tools such as a Web browser (Firefox) and FTP clients.

The GUI for DSL is Fluxbox, a unique window manager based on Blackbox, an old window manager known for its amazing speed and futuristic looks. While attractive. Blackbox wasn't the easiest system to use, especially for new users migrating from Windows or Mac. Fluxbox improves the user experience of Blackbox somewhat, but it's still a work in progress and will take some getting used to.

After starting Damn Small Linux you'll see the Fluxbox desktop. At the bottom is the virtual desktop navigator and a bar indicating the currently focused application. Right-clicking on the desktop will bring up a menu of available applications and tools. Icons have also been setup for many common tools.

Fluxbox has an excellent documentation section, especially for advanced users, available at:

Join the newsletter!


Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.
Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Alastair Cousins

PC World
Show Comments

Cool Tech

Toys for Boys

Family Friendly

Stocking Stuffer

SmartLens - Clip on Phone Camera Lens Set of 3

Learn more >

Christmas Gift Guide

Click for more ›

Brand Post

Most Popular Reviews

Latest Articles


PCW Evaluation Team

Aysha Strobbe

Microsoft Office 365/HP Spectre x360

Microsoft Office continues to make a student’s life that little bit easier by offering reliable, easy to use, time-saving functionality, while continuing to develop new features that further enhance what is already a formidable collection of applications

Michael Hargreaves

Microsoft Office 365/Dell XPS 15 2-in-1

I’d recommend a Dell XPS 15 2-in-1 and the new Windows 10 to anyone who needs to get serious work done (before you kick back on your couch with your favourite Netflix show.)

Maryellen Rose George

Brother PT-P750W

It’s useful for office tasks as well as pragmatic labelling of equipment and storage – just don’t get too excited and label everything in sight!

Cathy Giles

Brother MFC-L8900CDW

The Brother MFC-L8900CDW is an absolute stand out. I struggle to fault it.

Luke Hill


I need power and lots of it. As a Front End Web developer anything less just won’t cut it which is why the MSI GT75 is an outstanding laptop for me. It’s a sleek and futuristic looking, high quality, beast that has a touch of sci-fi flare about it.

Emily Tyson

MSI GE63 Raider

If you’re looking to invest in your next work horse laptop for work or home use, you can’t go wrong with the MSI GE63.

Featured Content

Product Launch Showcase

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?