Software // Operating Systems
News
5/15/2008
04:21 PM
Connect Directly
Google+
Twitter
RSS
E-Mail
50%
50%

How To Run Linux From A USB Flash Drive

Want to run Linux any time, any place? Here's what to do with popular distributions like Puppy Linux, Ubuntu, and Fedora, so you can boot up directly from your thumb drive.

Which Flash Drive?

Flash drives may all seem alike from the outside, but believe me, they're not -- the differences in speeds between any two drives can be startling. What's even more frustrating is that up until very recently there wasn't much word from the manufacturers about the relative speeds of different flash drives.

Thankfully, this has changed, and drive manufacturers are getting savvier about including speed statistics with their drives. A drive that's rated for "100x" speed or higher should work nicely, and most any drive that claims support for Vista's ReadyBoost feature should also work.

One thing that most manufactures have not made terribly clear is the drive's performance with regard to sequential vs. random access. You might think there shouldn't be a difference -- after all, the whole idea with a flash drive is that every byte on the drive has the same access time, right? Not true. Sometimes the manufacturer will mix memory speeds as a cost-saving measure, using a small block of fast flash memory in conjunction with a large block of slower memory. This means heavy variations in performance depending on what's actually being done on the drive. To that end, you might see major differences in performance between two drives that have identical or near-identical manufacturer's ratings.




DamnSmallLinux's "pen drive" installer.
(click for image gallery)

Another interesting thing to note is that flash drives aren't the only removable media that may work -- compact flash cards or digital cameras and music players that can mount as mass storage devices will also work. Again, whether or not Linux or your PC will support booting and running from such a device will depend on how the device advertises itself to the computer, and whether or not the Linux distribution you're using has drivers set up to handle it. Puppy, for instance, can boot from compact flash cards and even has an installer option to specifically allow it.

Enable USB Boot Support

Most computers shipped within the last couple of years will support booting from a USB device. That said, this isn't always enabled by default, and it isn't always enabled for all USB ports on the system.

One of the first places to look for information about USB boot support, apart from the manufacturer's own specifications, is the system BIOS. In my own Dell XPS, for instance, the default USB handling option is to enable booting from attached USB devices -- but I need to press F12 at boot time to select something other than the default boot device, normally the hard drive.

Another important thing is that some of the USB ports in the XPS can be manually disabled from being polled for boot devices. This is done so that you can attach an external USB drive (whether flash or an actual hard drive), and leave it attached between reboots without worrying about it hijacking the computer's boot sequence.

The folks at the PenDriveLinux Web site -- a fantastic resource for all things related to running Linux on USB -- have a quick way to test USB boot support on a given USB drive and computer. They use the SysLinux utility to make the drive bootable and add a copy of Memtest86+ a quick way to see if boot support works. Note that if you're doing this on Vista, open an admin command prompt to run the makeboot.bat file or it won't work.

SysLinux is used widely to make flash drives bootable for Linux distributions, so it's a tool that we'll be coming back to. Note that if you get a "boot error" or other error message when you try to boot a drive processed with SysLinux, you may need to run the DISKPART CLEAN command on the disk (again, from an admin command line) to remove any previous master boot record information, reformat the drive, and then try again.

Previous
2 of 4
Next
Comment  | 
Print  | 
More Insights
Comments
Threaded  |  Newest First  |  Oldest First
pkohler01
50%
50%
pkohler01,
User Rank: Apprentice
11/15/2012 | 9:56:04 PM
re: How To Run Linux From A USB Flash Drive
Geez, talk about giving away all the tricks...

Something that should be considered are the security implications, as well as the data recovery opportunities, that having a USB flash drive that you can boot Linux up from introduces.

I created my first Linux Flash Drive a few years ago and have successfully used it in many instances to bypass security on boxes (all white-hat stuff, mind you) and to recover files from systems that would no longer boot before re-imaging them. That made a tool of this nature invaluable to me.
Register for InformationWeek Newsletters
White Papers
Current Issue
InformationWeek Tech Digest, Nov. 10, 2014
Just 30% of respondents to our new survey say their companies are very or extremely effective at identifying critical data and analyzing it to make decisions, down from 42% in 2013. What gives?
Video
Slideshows
Twitter Feed
InformationWeek Radio
Archived InformationWeek Radio
Join us for a roundup of the top stories on InformationWeek.com for the week of November 16, 2014.
Sponsored Live Streaming Video
Everything You've Been Told About Mobility Is Wrong
Attend this video symposium with Sean Wisdom, Global Director of Mobility Solutions, and learn about how you can harness powerful new products to mobilize your business potential.