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 PC World newsletter!

Error: Please check your email address.

Our Back to Business guide highlights the best products for you to boost your productivity at home, on the road, at the office, or in the classroom.

Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Alastair Cousins

PC World
Show Comments

Most Popular Reviews

Latest News Articles


PCW Evaluation Team

Azadeh Williams

HP OfficeJet Pro 8730

A smarter way to print for busy small business owners, combining speedy printing with scanning and copying, making it easier to produce high quality documents and images at a touch of a button.

Andrew Grant

HP OfficeJet Pro 8730

I've had a multifunction printer in the office going on 10 years now. It was a neat bit of kit back in the day -- print, copy, scan, fax -- when printing over WiFi felt a bit like magic. It’s seen better days though and an upgrade’s well overdue. This HP OfficeJet Pro 8730 looks like it ticks all the same boxes: print, copy, scan, and fax. (Really? Does anyone fax anything any more? I guess it's good to know the facility’s there, just in case.) Printing over WiFi is more-or- less standard these days.

Ed Dawson

HP OfficeJet Pro 8730

As a freelance writer who is always on the go, I like my technology to be both efficient and effective so I can do my job well. The HP OfficeJet Pro 8730 Inkjet Printer ticks all the boxes in terms of form factor, performance and user interface.

Michael Hargreaves

Windows 10 for Business / Dell XPS 13

I’d happily recommend this touchscreen laptop and Windows 10 as a great way to get serious work done at a desk or on the road.

Aysha Strobbe

Windows 10 / HP Spectre x360

Ultimately, I think the Windows 10 environment is excellent for me as it caters for so many different uses. The inclusion of the Xbox app is also great for when you need some downtime too!

Mark Escubio

Windows 10 / Lenovo Yoga 910

For me, the Xbox Play Anywhere is a great new feature as it allows you to play your current Xbox games with higher resolutions and better graphics without forking out extra cash for another copy. Although available titles are still scarce, but I’m sure it will grow in time.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?