How To Run Linux From A USB Flash Drive - InformationWeek

InformationWeek is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them.Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Software // Operating Systems
04:21 PM
Connect Directly

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.

We welcome your comments on this topic on our social media channels, or [contact us directly] with questions about the site.
2 of 4
Comment  | 
Print  | 
More Insights
Threaded  |  Newest First  |  Oldest First
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.
IT Employment Trending Up; Data, Cybersecurity Skills in Demand
Jessica Davis, Senior Editor, Enterprise Apps,  11/11/2020
The Ever-Expanding List of C-Level Technology Positions
Cynthia Harvey, Freelance Journalist, InformationWeek,  11/10/2020
How to Approach Your Mission-Critical Big Data Strategy
Mary E. Shacklett, Mary E. Shacklett,  11/17/2020
White Papers
Register for InformationWeek Newsletters
Current Issue
Why Chatbots Are So Popular Right Now
In this IT Trend Report, you will learn more about why chatbots are gaining traction within businesses, particularly while a pandemic is impacting the world.
Flash Poll