Have you ever been in a situation where your machines have been rendered unbootable, only to find that you skipped the creation of a boot disk at installation? Even worse, have you ever attempted a Linux installation only to find that your CD-ROM was unbootable? What can you do in such a situation? You can create all sorts of boot and rescue disks.
There are a number of ways to create boot and rescue disks as well as a number of types of boot disks to create. In this Daily Feature, I’ll walk you through the creation of boot disks from both a Linux and a DOS environment so that you will have all the help you need—in most situations.
Creating disks from within Linux
Creating an installation disk within Linux depends on the dd command. The various types of installation floppies you’ll create are:
- Boot.img—Needed when performing an installation from a nonbootable CD-ROM.
- Bootnet.img—Needed when performing an installation via the network.
- Pcmcia.img—Needed when performing a network installation on laptops.
- Rescue.img—Needed for recovery.
To create an installation disk, insert an empty floppy in the floppy drive and the Linux distribution CD in the CD-ROM drive, open up a console, and run the following commands (do not run anything preceded by #):
#mount the cdrom
#change to the /mnt/cdrom/images directory
#run the dd command on the specified files
dd if=image_file of=floppy_device
Pay special attention to the image_file and floppy_device sections. Where you see image_file, you will insert the name of one of the specified installation floppies from above. For example, if you want to create a standard installation floppy for installing with a nonbootable CD-ROM, you’d run the command
dd if=Boot.img of=/dev/fd0
If you want to create an installation disk for installing over a network (with NFS, FTP, HTTP, etc.), you’d run the command
dd if=Bootnet.img 0f=/dev/fd0
To perform a network installation on a laptop, run the command
dd if=Pcmcia.img of=/dev/fd0
Finally, for a rescue disk you’d run
dd if=Rescue.img of=/dev/fd0
Creating disks from within DOS
Creating the above disks from within DOS is just as simple. You’d use the rawrite.exe command to create Linux installation/rescue disks from within DOS. The rawrite command comes with Red Hat, Mandrake, and many other distributions.
The steps for creating installation/rescue floppies from within DOS are as follows:
- Insert the Linux CD.
- Insert a blank floppy.
- Open up a DOS prompt.
- Change to the D:\dosutils directory.
- Run the rawrite command.
- Enter the name of the file you want to create (from the list above).
- Enter the name of the floppy device (more than likely, this will be a:).
The above steps are fairly simple. The biggest differences from creating such disks in Linux (other than being in a completely different environment) are:
- The filenames (the names listed above) are in the D:\images directory, and the capitalization is different (generally, all characters but the extension are capped).
- The floppy device is called a: as opposed to /dev/fd0.
So let's say you want to create a Boot.img floppy from within DOS. You will cd into the D:\images directory and then run
You will then be asked for a filename. At the filename prompt, type
Now press [Enter], and you will be prompted for the floppy device name. At this prompt, enter
followed by [Enter].
At this point, your floppy will be created (which takes only a matter of seconds). Once it is done, you can safely remove it (no umount necessary).
With the above tools, you will be able to create an installation disk for most circumstances. Whether your only chance to create a boot disk is from DOS or whether you are preparing for things to come (such as a network installation or a total meltdown), these tools should aid you in your quest for a Linux installation.
Jack Wallen, Jr., editor in chief of Linux content, was thrown out of the "Window" back in 1995, when he grew tired of the "blue screen of death" and realized that "computing does not equal rebooting." Prior to Jack's headfirst dive into the computer industry, he was a professional actor, with film, TV, and Broadway credits (anyone see “The Great Gilly Hopkins”?). Now, Jack is determined to use his skills as a communicator to spread the word—Linux. Ladies and gentlemen, the poster boy for the Linux Generation!The authors and editors have taken care in preparation of the content contained herein, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for any damages. Always have a verified backup before making any changes.
Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website jackwallen.com.