September 8, 2009

How-to: Create a Live USB Distro

For quite some time, I have been meaning to try Skype, the Voice/Video over IP service. It runs on Linux pretty well, I'd heard. Prompting this is desire, too, was the fact that most of my co-workers use Skype and I seemed to be the odd man out for Skype at the Linux Foundation.

One big thing was holding me back: I wanted to write an article about installing and running Skype, but I only have one working Linux box right now, and I like to write articles about at least the top three desktop distros besides my own openSUSE. But I'd never gotten around to tri-booting my machine with Fedora and Ubuntu.

At last week's Red Hat Summit, I received a Live USB version of Fedora on a 1-Gb stick that came with my event badge. This proved handy at the show, as several folks gave me their presentations and press releases via the memory device. And, it would prove handy later.

With the Fedora Live USB stick, I knew I was two-third of my way to having a trio of distros to use as testbeds for any tutorial article I wanted to write, not just about Skype. But, how to make an Ubuntu Live USB stick?

I knew about usb-creator, an Ubuntu app that writes ISOs to memory sticks, but I needed Ubuntu to run it. And, I'd seen the Ubuntu Live Imager for Windows that does the same thing, but that was not my favorite choice, given the Windows part of the ingredient list.

Besides, what I wanted was a more universal solution: a way to create a live USB version of any distro--not just Ubuntu. A little more Googling around and I found a great way of doing it. And the cool thing is, it was a solution found by someone I already knew.

Manuel Amador (Rudd-O) is a vocal Linux advocator, who does a lot of community writing I've read over the years. Turns out he's given a lot of thought to this same problem. He's written a very good set of instructions about how to manually create a USB-drive distro (in this case, Ubuntu).

If you like to play on the command line, these instructions are clear and straightforward. But if you are more interested in getting it done quickly, give Amador's Portable Linux 0.9.3 a try. It's basically a Python script that runs through all of the steps used in the manual instructions.

Portable Linux comes in Red Hat and Debian packages, so I downloaded the tarball and ran the portablelinux binary within (using sudo). Using the simple interface, you choose where your source ISO file is, specify which USB device you want to use, and then specify the size of the persistent data area. Modern Live USB distros now have persistence, which basically lets you save data from session to session. This is very handy because, after some configuration, you can create a virtual copy of your optimum work environment, then plug it into any computer and one boot later, have that same environment up and ready to go.

Portable Linux allocates memory for the actual distro files, plus the persistent memory area you specify. The rest of the stick's memory is set off in a Windows fat32 partition for general file sharing.

While Portable Linux worked well for me, a little caution should be used. The first memory stick I used (a Sony I had lying around) gave me errors that, upon investigation on the Rudd-O site, were part of a long list of unresolved and unconfirmed errors. I was about to go to the manual method when I found another stick, plugged it in, and off I went. I think the Sony's problem was that it already had been partitioned to make room for some Windows utility, and Portable Linux didn't like it. Still, the lesson here might be: use a generic stick.

I have tested both the Fedora and the Ubuntu sticks and they work very well. The persistent mode on the Ubuntu stick worked perfectly, remembering my WiFi connections and application preferences.

In theory, this tool should allow you to make a Live USB stick out of any distro with a Live CD ISO file. Give it a try and see.