USB Pendrives and Distributions for Them

A look at three distributions you can use to boot Linux from a USB pendrive.

A pendrive is a USB storage device. You plug it in to a USB port, and if the pendrive is compatible with your operating system, it should look exactly like another disk on your system. These days, it is easy to find pendrives with 1GB of storage.

It so happens that there has been an explosion of bootable live CD versions of Linux. Both commercial and noncommercial Linux distributions are providing live CDs (including Linspire, SUSE, Ubuntu, Kubuntu, Knoppix and Mepis, to name only a few—there are many more).

Imagine a mixture of both concepts—a USB storage device and a live CD version of Linux. You can pack a lot of features of a GNU/Linux live CD into 1GB. The USB pendrive has the advantage of being writable, which the live CD lacks. So, you can boot Linux from a pendrive and store data on it too. The end result is that, as long as you can find a machine that will boot from a pendrive, you have a fully portable version of Linux that carries your applications, settings and data.

The Choices

I cover three LiveUSB distributions in this article: SLAX, Damn Small Linux (DSL) and Flash Linux. Each one has different window managers and different apps.

SLAX works with tmpfs and Unification fs (UFS), which gives it some nice advantages. SLAX is based on Slackware Linux with the 2.6 Linux kernel.

DSL is a little distribution of 50MB. DSL configures Fluxbox very nicely. Some of the apps included are Mozilla Firefox, the Slypheed mail client, xmms, text editors, graphics viewers and more. It includes a 2.4 Linux kernel with good hardware detection, but it doesn't have the big apps other distributions have, such as The GIMP. It is a compact distribution with a script to install it to LiveUSB.

Finally, Flash Linux is a solid distribution that uses the 2.6 kernel and the fast JFFS2 filesystem. It has good speed, both as a live CD and LiveUSB, and it includes large applications, such as The GIMP and OpenOffice.org. It uses grub, bootsplash, framebuffers and GNOME, and is based on Gentoo.

Boot from USB

The biggest challenge in using a USB pendrive for your Linux distribution is booting the pendrive. Old motherboards do not support the ability to boot from USB hardware, so you may need to use a floppy disk to boot your USB-based distribution. Newer motherboards let you boot drives usually referred to as USBHDD, USBZIP, USB-FDD and others, such as USB-CDROM.

The first step to using a pendrive is to delete the original pendrive partitions, if there are any. Then, add a FAT16 partition, and format it with mkdosfs. I used cfdisk to do the work, but you can use fdisk too.

Check your dmesg log when you plug in the device to see if it is working:

dmesg | tail

You should see a message similar to the following:

sda: assuming drive cache: write through
sda: sda1

Format the partition you created with the following line:

mkdosfs -F 16 /dev/sda1

(Change sda1 to whatever partition is appropriate for your system.)

Unplug the hardware, and plug it in again. You now are ready to install the distribution.

Damn Small Linux

Go to the DSL Web site (see the on-line Resources) and download the ISO image file for the current version of DSL, and burn the ISO to a CD or DVD. Boot from this CD or DVD. The boot starts with a welcome screen, like most live distributions.

DSL looks for hardware, and then it installs and configures it. Depending on your machine, it will bring up an X server running Fluxbox in less than two minutes.

After booting from the DSL live CD, right-click on the Fluxbox desktop to open the Fluxbox menu. Go to Apps→Tools→Install to install it to your USB pendrive. Here, you have two options for installing the distribution: install to USBHDD or USBZIP hardware. DSL will ask about the location of the pendrive, and it also asks if you want to install DSL from the live CD, from a file or from the Web.

I suggest you use your broadband connection to download the files. In fact, if you have a router that supports DHCP, DSL should recognize your Ethernet card and have no problems accessing the Internet at boot time. DSL supports PPPoE too, if your Internet connection requires it.

I missed the features of the 2.6 kernel (the next release of DSL should support 2.6), but it's still a good little distribution. I think DSL is fine as it is, but if you need a big office suite, you should use SLAX. Resources that you must read if you use DSL are the Wiki and the complete DSL forums. You will find many tips and tricks with plenty of information that will be helpful if you run into problems.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

IMPORTANT

Rev. rob's picture

Dear customer service,

My name is REV.Rob .Heisler .I'm writing from Illinois,in the U.S.A and i'm looking to make some purchases of some particular products for a local church school as the first step towards our aim to help our unable brother's and sister in the work of the Lord.

Please do let me know if you can make available pendrives .I'm looking to make a purchase of about 250 pcs.Please inform me on your stock rates.

please let me know if you have some or more in stock and also please inform/advise me on your forms of payment.
I will like to pay by credit card.Also would like to use my own means of shipping.Hope to hear back from you soon.

BEST REGARDS,

REV.ROBERT HEISLER.

syslinux not available in linux

albramos's picture

The article says:

And, use syslinux to finish the process:

syslinux -s /dev/sda1

I tried to use syslinux while I was running SLAX but I didn't found the it. I had to boot to windows and run the syslinux command (availble in SLAX) under windows.

Alberto

please show grub instructions

moschlegel's picture

The article says:

"Finally, install and update MBR with LILO or GRUB:
lilo -M /dev/sda"

But oddly the command shown is only the one for LILO,
What's the commands needed to do the similar thing with grub?
Many linux distros don't install lilo at all anymore.
I have Fedora Core 5 and it doesn't have lilo in /sbin but
only /sbin/grub so I'm stuck not know how to setup grub
for my pendrive for SLAX.

Mark

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix