Linux: How to get Mandrake 10.0 to boot from floppy

I recently upgraded one of the five machines at home from Mandrake 9.1 to Mandrake 10.0 Official Download. This machine is a sluggish Celeron 300 used by my daughter, Sarah.

The upgrade went fine, although it was slow (this machine is not the fastest thing around).

Background

This machine has a BIOS quirk in it. It auto detects the hard disk correctly (4 GB), but saves its info in the BIOS as 495MB.

Once Linux is booted, this is not an issue though, because Linux does its own mapping overriding the BIOS settings. However, getting Linux to boot from that disk is a challenge, since /boot is not on a partition of its own, grub cannot load kernel, saying cylinder is not accessible.

The "proper" solution for this is to repartition the drive, and make a small (say 10MB) partition and make it /boot. However, since there is data already on this disk, I did not want to go through all this trouble, wasting time and effort.

Mandrake 9.1 Solution

I tried to make it work the same way that Mandrake 9.1, that is, by having a syslinux floppy disk to boot from.

The normal way to create a syslinux floppy is by using the following commands:

# Format a floppy
fdformat /dev/fd0

# Create an MS DOS file system on it
mkfs -t vfat /dev/fd0

# Make it bootable using syslinyx
syslinux -s /dev/fd0

# Prepare to copy by doing a mount first
mount /dev/fd0 /mnt/floppy

# Copy the kernel
cp /boot/vmlinuz /mnt/floppy

# Copy the the initrd image
cp /boot/initrd.img /mnt/floppy

# Create a syslinux.cfg file. Change hdb5 to your appropriate disk and partition
# that has Linux on it
cat > /mnt/floppy/syslinux.cfg
default linux
prompt 1
timeout 10
label linux
kernel vmlinuz
append root=/dev/hdb5 initrd=initrd.img quiet devfs=mount acpi=off

# Hit Ctrl-D to create the file after you type the above

# Unmount
umount /mnt/floppy

Your floppy is now ready.

Mandrake 10.0 Challenge

This worked fine on Mandrake 9.1, and any other distribution that uses 2.4 kernels. With Mandrake 10.0, or any other distribution with 2.6 kernel, there is a serious issue, which is that the kernel and the initrd image do not fit on a 3.5" 1.44 MB floppy!

After evaluating several solutions, I decided that repartitioning was not worth the trouble, since it is a reinstall, and will take a lot of time. I found a neat trick that will make the files fit on the floppy: formatting it as a 1.68 MB or 1.72MB instead of 1.44 MB, by using the special device file /dev/fd0u1680 (1.68MB) or /dev/fd0u1722 (1.72 MB).

This can be done using the following commands, even if you are booting from the rescue mode of the first CD:

# Format the floppy with a higher density of 1.72 MB
fdformat /dev/fd0u1722
# Create a file system
mkfs -t vfat /dev/fd0u1722
# Make it a syslinux disk
syslinux -s /dev/fd0u1722
# Mount the floppy
mount /dev/fd0 /mnt/floppy
# Copy the kernel
cp /boot/vmlinuz /mnt/floppy
# Copy the the initrd image
cp /boot/initrd.img /mnt/floppy
# Create a syslinux.cfg, change hdb5 to your correct disk
cat > /mnt/floppy/syslinux.cfg
default linuxprompt 1
timeout 10
label linux
kernel vmlinuz
append root=/dev/hdb5 initrd=initrd.img quiet devfs=mount acpi=off
# Hit Ctrl-D to create the file after you type the above
# Unmount the floppy
umount /mnt/floppy

If the command syslinux does not work, you can try using the syslinux-old command instead.

Now the PC boots from the floppy just fine. A bit slow, but does the trick.

Adding More Features

You optionally add other menu entries so you can do different things, for example, boot Linux in multi user text mode (runlevel 3), using a syslinux.cfg file that contains the following:

default gui
prompt 1
timeout 100
display menu.txt
label gui
kernel vmlinuz
append root=/dev/hdb5 initrd=initrd.img quiet devfs=mount hdc=ide-scsi acpi=off

label text
kernel vmlinuz
append root=/dev/hdb5 initrd=initrd.img quiet devfs=mount hdc=ide-scsi acpi=off 3

label failsafe
kernel vmlinuz
append root=/dev/hdb5 initrd=initrd.img quiet failsafe devfs=nomount acpi=off

The menu.txt file is a plain text file that contains instructions to the user, for example:

Type 'gui' to boot in X11 mode, 'text' to boot in text mode, or 'failsafe' to boot in failsafe mode.

Feedback

It is always nice to get feedback that something you wrote did help someone out there.

Richard Fearon writes from Scotland saying:

Thanks for your excellent contribution, which of the many I tried was the only one to work. It hung on the graphics, but by adding vga=788 to syslinux.cfg - worked fast and well!

My system is an ancient HP upgraded tp 1.8Ghz with dual booting via Grub to Fedora Core 2 and Mandrake 10 Community download version.

Thanks again.

Daniel Sadoc write from Brazil saying:

Great article! I've succeeded creating the boot floppy disk after reading your notes.

Contents: 

Comments

lussy

thanks