...making Linux just a little more fun!

<-- prev | next -->

Knoppix with 2.6.7 kernel from non-bootable CD-ROM

By Anonymous

Introduction

You want to start Knoppix and your CD-ROM cannot boot either for technical or administrative reasons. You can try to start the Knoppix CD from a floppy drive. For that you need a Knoppix boot diskette.

The recent Knoppix 3.4 of May 2004 relies on kernel 2.4.x but has kernel 2.6.6 as an option. Likewise, Knoppix 3.7 of August 20 has the 2.6.7 kernel as an option. This last release is - for the time being - only available in Germany as a CD from a computer magazine. However, a general release, possibly with kernel 2.6.8, is coming and so it is sensible to refer to the new kernel because its size is growing and growing and causing diskette distress.

We will refer to the new Knoppix kernel as knoppix26 using the same name as in the CD boot configuration. Unfortunately, knoppix26 does not boot from one diskette, it needs two.

When running, knoppix26 has a script in

    /KNOPPPIX/usr/sbin/mkbootfloppy

that does make these two floppies - despite the singular name. However, the diskettes so generated depend on the kernel in use. If you want them in order to be able to boot 2.6.x, you have to write them while running 2.6.x - which is a bit of a catch-22. Modifying the script is catch-22 again since the script is not directly accessible on the Knoppix distribution CD and becomes only readable when Knoppix is running. It can be found on the web in editable form but making sensible use of it will be more laborious than the advice found in this article, especially in respect to kernel 2.6.7 which does not fit on a 1.4M diskette at all.

So if your CD-ROM will not boot, how are you going to boot knoppix26 from the floppy drive?

Pre-requisite

You must have some familiarity with syslinux. Fortunately, it can be acquired on the fly, check http://syslinux.zytor.com.

Option 1

Consider the following (chain) boot loaders:

    http://bootcd.narod.ru/bcdw150z_en.zip
    http://btmgr.sourceforge.net/download.html

Both of them can create a boot diskette that starts a (bootable) CD even if the CD-ROM is unable to boot. In the particular case of the Knoppix CD, the good news is that they both will boot it from a non-bootable CD-ROM.

This is your friend if you want to minimize preliminary work. Unfortunately, if you are not installing Knoppix to hard disk, you may end up doing quite a lot of typing at the command line every time you boot.

[Please do not misunderstand the remark above as a criticism of the two boot loaders. They come in very handy in other situations as well.]

Option 2

The biggest hurdle is the kernel size starting with release 2.6.7. In the 2.6.6 release, the Knoppix kernel would fit on a 1.4M diskette. Now you need to format the diskette to 1.68M - the same size Microsoft uses occasionally for its diskettes. For that purpose, you can use winimage under Windows, fdformat under DOS or superformat/fdformat under Linux. Good luck to you because diskettes sold for the 1.4M capacity do not necessarily agree to a flawless format at higher capacity. My experience is that you need a box of ten to get one such tolerant diskette. If you want strict verification, use winimage and you will see the massacre.

When you have formatted the diskette, make it a syslinux boot diskette. This can be done from DOS, Windows, Linux - it's up to you. No further help is offered here for it. This boot diskette will contain only one small file, ldlinux.sys.

In the Knoppix CD 3.7, there is a directory /boot/isolinux where you will find the following files among others:

    boot.msg              141
    f2                  1,561
    f3                  1,688
    isolinux.cfg        2,642
    linux26         1,458,194
    minirt26.gz       791,321

Copy everything but the last file to the syslinux diskette above. Rename isolinux.cfg to syslinux.cfg and edit it as follows:

DEFAULT knoppix26
TIMEOUT 300
PROMPT 1
DISPLAY boot.msg
F2 f2
F3 f3
LABEL knoppix26
KERNEL linux26
APPEND load_ramdisk=1 prompt_ramdisk=1 root=/dev/fd0 rw init=/etc/init lang=us apm=power-off nomce BOOT_IMAGE=knoppix
LABEL expert26
KERNEL linux26
APPEND load_ramdisk=1 prompt_ramdisk=1 root=/dev/fd0 rw init=/etc/init lang=us apm=power-off nomce BOOT_IMAGE=expert

This is now a boot diskette for the 2.6.x kernel, the initial ramdisk being read from a second diskette. Type knoppix26 at the boot prompt. It will quickly ask you to insert the second diskette so you must have it ready.

The second diskette must be a raw copy of minirt26.gz. Which is to say, you cannot format it with a file system and put minirt26.gz into the file system. When syslinux reads the diskette it expects the binary content of minirt26.gz and nothing else. It won't assume a file system and look for a file in it.

The question is: how do you copy the file raw to the floppy? Here is the command (run under Linux from the Knoppix CD, /boot/isolinux directory):

    dd if=minirt26.gz of=/dev/fd0 bs=18k

The bs value is not essential, it just determines the size of portions read and written. (A high-density 3.5" diskette has a track of 18k.) The floppy may or may not be mounted. If not mounted, it does not even need to be formatted since the formatting will be destroyed anyway.

By the way, the raw copy can also be done under DOS/Windows with a utility that can write to a physical sector disregarding the file system. One such utility is the Norton Disk Editor.

After inserting the second boot diskette, knoppix26 will boot.

The shape of things to come

Evidently, option 2 cannot be recommended to anybody, too much of a hassle. The chain boot loaders listed above are the way to go. Note that Microsoft has just turned to a chain boot for their XP CDs' to handle non-bootable CDROMs.

Still, we have here some developments to watch. With the Linux kernel too big for a normal 1.4M diskette, syslinux is going to be relegated to rescue diskettes, it won't help any longer for the current Linux releases.

And even lilo gets an encouraging kick to the exit. With kernel 2.4.x, a lilo diskette could still quickly boot a Knoppix installed to a non-bootable partition: you had Windows as normal straight boot from hard disk, Knoppix also on hard disk but booted from diskette, no clashes. This may still be doable for kernel 2.6.x if the hardware does not require any special drivers at boot time and the initial ram disk can be dispensed with. If you need an initial ram disk, expect its size to be in the region of 4M: you will have to customize it so as to fit it on a diskette, in which case you have again an approach like Option 2. If not possible then the initial ram disk would have to be on the hard disk and lilo is simply not able to find it.

Exit syslinux, exit lilo, everything points to grub. And maybe they will throw in a CD boot from diskette as a bonus?

 


Copyright © 2004, Anonymous. Released under the Open Publication license

Published in Issue 107 of Linux Gazette, October 2004

<-- prev | next -->
Tux