A Weird Imagination

Booting off flash drives

Posted in

The problem#

So you've built a new computer with fresh blank storage. How do you actually do anything with that computer that has no software? Navigating the BIOS menus can only hold your interest for so long.

The solution#

The old way of doing things was to have a bootable CD or DVD, but now that most computers don't even have an optical drive, the common way to handle this with bootable USB flash drives.

Most Linux distributions' default download is an image for a bootable "live" flash drive (or DVD) that runs the OS in addition to having an option to perform a permanent install. Some of the most popular ones are Debian, Ubuntu, Mint, and Fedora.

You can boot Windows off a flash drive using Hiren's BootCD, which also includes a lot of recovery and diagnostic tools.

While most boot drives will boot into Linux or Windows, there's a small set of specialized lower-level tools. One very useful one is Memtest86+ (included in many Linux distros), which will determine if your RAM is functional. As bad RAM can cause very weird and different to track down problems, you should always test new RAM.

The details#

Creating a bootable flash drive#

Important first steps are:

  1. Make sure you don't want any files currently on the drive. As with any major disk operation, assume the drive will get wiped, even if that isn't necessarily the case.
  2. Identify the drive you intend to write to. Double check the identity (/dev/sdX on Linux or X: on Windows) to make sure you are doing your potentially destructive operation to the right drive. Software for creating bootable flash drives will display the drive name and/or capacity to help you verify you have selected the right one.

There's a lot of software for creating bootable USB flash drives. The most basic is dd, which just writes a stream of bytes wherever you tell it to put it which, needless to say, is both error-prone and often not quite what you want anyway.

Multiboot#

Last week I wrote about acquiring multiple cheap flash drives partially because each one can only be set up to boot a single thing and the space requirements for a bootable flash drive are relatively small compared to the capacity of even very cheap flash drives available today. Which means it's useful to have a few flash drives to boot different things.

But you can also use YUMI or other "multiboot USB" creators to make the "one thing" the flash drive boots be a menu of options of different things to boot into. Then your one drive can boot both Linux and Windows, for example.

Storage on bootable drives#

Unless you are using a very old drive, most likely the OS takes up only a fraction of the space. You can add whatever files your want to the drive and it will still boot just fine. That way you don't have to have separate flash drives for booting and transferring files.

Depending on how you created it, it may be formatted with the ISO 9660 filesystem originally intended for CDs which generally can't be easily modified. But that's not the only filesystem choice; you can use UUI or any multiboot USB creator and give it the .iso file to make a bootable flash drive with a mutable filesystem.

Network booting#

You can also boot off the network if you have another computer set up to act as a server for PXE. I've never used it myself, so I don't know the details, but it's commonly used in corporate environments and data centers where you have a lot of computers, and don't want to have to manually plug a flash drive into each one.

Comments

Have something to add? Post a comment by sending an email to comments@aweirdimagination.net. You may use Markdown for formatting.

There are no comments yet.