Creating a Bootable LiveCD
|
URI: |
http://herbert.gandraxa.com/herbert/lfscbc.asp |
|
Link template: |
<a href="http://herbert.gandraxa.com/herbert/lfscbc.asp">Creating a Bootable LiveCD</a> |
|
Link symbols: |
|
Creating a Bootable LiveCD
|
URI: |
http://herbert.gandraxa.com/herbert/lfscbc.asp |
|
Link template: |
<a href="http://herbert.gandraxa.com/herbert/lfscbc.asp">Creating a Bootable LiveCD</a> |
|
Link symbols: |
|
Home »
Articles »
Linux from Scratch »
Creating a Bootable LiveCD
This article is part of the series Linux from Scratch. — To work on a virgin machine we need a simple OS providing some basic commands. This article explains how to create a bootable CD containing a small Linux system.
2007-Dec-30
Since this article is about setting up
Linux on an virgin machine, it is assumed that there will be no (or no relevant) data on your machine's
harddisk. Note, that in this context, data is taken to refer also to programs.
If your machine is new and was purchased at a shop, it is very likely that it comes already preconfigured with some installed
Operating System (OS), probably Windows Vista at the time this article is written. It is important to realize, that in the course of this series, we will get rid of any such preinstalled OS, together with all the other applications and data that may be on the harddisk, whether preinstalled or added later during ordinary machine operation. Make sure you understand the implications of this as you go along with this article series.
The other possibility is to simply buy a new harddisk and install it physically into your machine. In this case, there is most likely no data at all to worry about. However, if such a harddisk is not the only one in the system (i.e. if there is at least one other harddisk in the system), you must be very cautious to address the correct one: it is quite easy to inadvertedly destroy the wrong disk, resulting in a possibly huge damage.
In the remainder of this article, as well as in all following articles of this series, it is assumed that there is only one harddisk in your system, and that this harddisk is brandnew, unpartitioned and unformatted. If this is not the case for you, you are strongly advised to backup all data onto an external storage device before continuing.
Having a machine with a completely empty harddisk implies that we can not
boot the machine, simply because there isn't any OS. In order to be able to work instantly with the computer's essential peripherals (primarily the monitor and the keyboard, later on also the harddisk), we need a certain minimum of functionality.
In earlier times, such basic functionality was provided by a bootable floppy disk, which on system power-up started an application, usually installing an OS onto your harddisk. Today a modern computer's
BIOS settings allow to boot from a CD, if such a CD has the proper layout to make it a bootable CD. This is what we seek to accomplish here.
However, we are not going to setup a predefined Linux system (a so-called
Linux Distribution): if that was our goal, we would just obtain one of the many distributions (for example
Fedora), insert the CD and follow the instructions prompted to the user.
What we want is something different: we want to create a CD on which the OS is contained, but which does not affect our harddisk at all — unless we tell it to. In particular, we do not want to have an OS automatically installed on the harddisk. And because there is no data on the harddisk (or if there is, it shall be ignored), that CD must be bootable, in order to have something to work with immediately after system power-up. Such a CD fulfilling these requirements is called a
LiveCD.
Now, with the advent of CD burning software capable to burn
ISO images of CDs onto blank CDs (such as
Nero Burning ROM), the creation of a bootable CD is a straightforward process, although there are some pitfalls to avoid. The section after the next one will show you how it is done.
But before we burn a CD, it is sensible to first obtain the data to burn. The next section tells what data is needed and where it can be found.
Overall the Web, there are various downloads available leading to a working LiveCD as outlined above. Note, that whereas the finished and ready-to-use bootable LiveCD eventually consists of usually many files within a filesystem, you won't be able to distinguish them before the CD was really burned. Instead, you will be downloading a so-called ISO image. This is a single file, usually with the extension .iso, comprising the whole file system.
The online book Linux from Scratch recommends the following testing versions for download:
Download the Official LFS LiveCD. Note, that as per time of writing none of the listed downloads were considered to be stable.
Don't download just a random file. Instead, analyze the offered files' names and draw the correct conclusions. In my case, having a x86 64-bit system, I downloaded a file named lfslivecd-x86_64-6.3-r2145.iso, where 6.3 refers to the book's actual revision (this is expected to change in the future, so don't worry if your revision number is higher than the one stated here). Furthermore, the aforementioned page states:
«The -nosrc ISO images do not contain source tarballs, but are otherwise identical to the full releases. The -min ISO images contain no source tarballs and no X window system.»
Eventhough considerably smaller in size, I recommend to download neither one of those "crippled" images, in order to be as unrestricted as possible.
Now from the list given on that page first select your preferred downloading method, and then the server closest to you. Make sure, that you have the adequate space on your harddisk: some of the offered choices exceed 600 MB. Then start the download (and remember in which directory you save the download).
Note, that depending on your Internet connection type, the available bandwidth at your end as well as at the selected mirror site, and also on the size of the selected file, the download may take quite a while. If there are other things to do it might be the right moment now to do them.
Now that we are in the possession of an ISO image file (the large file downloaded as per the previous section), we need to transfer it to a blank CD such, that we can boot from it on system power-up. Do not just copy the image file to the CD like you would do with data of any sort: it won't work..
Using the last release of version 6 (namely 6.6.1.15), the correct settings look like this:
Screenshots uploaded soon
Now that we have a (hopefully) bootable CD, we need to tell the BIOS to attempt the booting process for the CD-ROM device first. As was already pointed out, in most machines, the default is to boot from harddisk.
The first task might seem trivial but is not necessarily so, namely to enter the BIOS. There are literally hundreds of different BIOSes, and while many use some kind of de-facto standard-keys, many others do not.
However, in the vast majority of cases, when booting the machine, the BIOS will tell you which key will give you access to it. Such a message could be displayed in the normal text flow in the middle of several hardware-related outputs, or it could be displayed as a "sticky" near the bottom of your screen. As an example, such a message could read:
Press DEL to enter SETUP, F12 to Enter Boot Menu
So far, so good, alas...
Sometimes the BIOS does not wait for your lazy eye to really catch the hint. The problem is, that you need to press that hinted key before the BIOS transfers control to the actual boot device. This means, that if you are not able to catch the hint and react in a quite short time, you might rely on some guesswork, each guess probably necessitating a new power-up. To facilitate the guesswork, here are some typical keys (in no particular order): F12, F2, F8, and DEL (Delete).

Fig. 1: Advanced BIOS features
Assuming that you managed to enter your particular BIOS, we want to change the booting sequence to first try the CD-ROM device, and only if that fails (due to no media or a non-bootable media in the device's slot) the harddisk.
This sequence oftentimes is stored in a screen which can be accessed by a menu entry labelled Advanced BIOS Features or similar.
Look for entries called Second Boot Device and Second Boot Device or similar, and select the devices such, that first the CD-ROM is booted, and only secondly the harddisk (see fig. to the left). This will ensure the behaviour as desired.
Do not forget to save your changes (typically by pressing a function key like F10, often labelled as Save and Exit). Leave the new CD in the device while pressing this key: most BIOSes will reboot after exiting, which means that you will be told very soon if everything went well.

Fig. 2: Start screen of the LiveCD
If you see a start screen reading Linux from Scratch (fig. 2) you know that everything worked out fine: your LiveCD is functionable and with it we have what we need to setup a Linux system on our harddisk.
After pressing the Enter key you are guided through a dialogue of a few pages concerned with your timezone and your locale, used to set your keyboard appropriately.
Having answered these questions, a welcome screen is printed, containing some useful hints about support questions.
It ends with the instruction:
Press Enter to activate this virtual console...
After doing so, you will see your first Linux console prompt:
root [ ~ ]# _
The tilde ~ stands for your home directory. The flashing underscore is the prompt at which you enter Linux commands.
Unfortunately, not always is the desired way without any troubles. This subsection deals with potential error sources and provides solutions and fixes for them, as far as available.
Should you during boot from CD-ROM see several lines relating to Caldera, terminating with the lines
Caldera DR-DOS 7.03 Copyright (c) 1976, 1998 Caldera, Inc. All rights reserved. [DR-DOS] A:\> _
then your CD was not burned appropriately. Because there are messages (the lines above) which have nothing to do with whatever was on your harddisk (if anything at all), you know at least, that you managed to create a bootable CD. So far so good.
The only problem is, that the burning process did not interpret the provided ISO file correctly, causing the CD to basically behave like a 1440 kB floppy disk with a rudimentary DOS (try it out by typing DIR and Enter).
This behaviour is due to wrong settings within your burning software: you must tell your software to interpret the ISO file as a CD image. If you are using Nero Burning Rom 6, find the appropriate settings above. If you are using something else: I am sorry – I can not give you details for software I do not have. If you run into such troubles with another software and manage to find the correct settings, I would appreciate the details in order to upload them for the next ones having the same problems.