Make your own free website on

Creating a boot floppy

There are a few situations that you will run across when you are making a boot floppy for Linux

  • You want to use lilo
    1. Your kernel has everything required for boot compiled in
    2. Your kernel has modules but none required for boot
    3. Your kernel has modules that are required for boot
  • You want to use loadlin

If you are in situation 1) or 2) you can make a simple boot floppy. If you are in situation 3) you will need an initial ramdisk image. If you are a great believer in DOS you can use loadlin on a DOS boot floppy instead of lilo to boot your computer.

The typical method for booting Linux from a floppy disk uses lilo to install the boot image on the floppy. This boot image will then know where on the floppy the kernel is and passes the system boot process to it. You can also boot to Linux from a bootable DOS floppy using loadlin. I will describe how to create a boot floppy using lilo and also using loadlin.

A) Using lilo on your boot floppy

If your Linux kernel does not need any modules to boot your system you can create a lilo based boot floppy easily. If your system will not boot without specific modules you can recompile your kernel with the required drivers compiled in statically or you can create an initial ramdisk. If you would like to recompile your kernel you should point your web browser to the Kernel-HOWTO at the web site.

Boot floppy with no ramdisk

Insert a blank high density double sided floppy disk (1440KB) into the floppy drive and run the following commands (this works for the first floppy device under /dev/fd0, if the floppy drive you use is the second use /dev/fd1)

 	bash# fdformat /dev/fd0H1440
 	bash# mkfs.ext2 /dev/fd0

This will format the disk and create the ext2 file system on the floppy. Mount the floppy (e.g. bash# mount -t ext2 /dev/fd0 /mnt/floppy) and erase the lost+found directory (it only takes up space on a floppy). The format command will erase anything that was previously found on the floppy. Copy the following files from the /boot directory onto the floppy


Edit the lilo.conf file to contain the following

 #global definitions
 boot=/dev/fd0				#boot from floppy
 map=/mnt/floppy/map			#map file is on floppy
 install=/mnt/floppy/boot.b		#boot.b file on floppy
 prompt					#always display prompt (needs timeout)
 timeout=50				#5 second delay to display prompt
 #kernel image specific definitions
 image=/mnt/floppy/vmlinuz-2.2.14-5.0	#kernel is on floppy
         label=linux			#label shown under prompt (hit TAB)
         root=/dev/hda1			#root filesystem (e.g. where is /bin)

This tells lilo to boot off of the floppy (boot=/dev/fd0) using the map, boot.b and vmlinuz files found on the floppy disk. The prompt line makes lilo display the LILO: prompt on every boot without user interaction. If there is no timeout line the machine will proceed beyond the LILO: prompt. The timeout line tells lilo how many deciseconds (0.1 sec) to display the prompt before booting with the default image. If you leave out the prompt and timeout lines then lilo will boot without any pause. This will gain you a few seconds but it is best to leave them in. Having the LILO: prompt available gives you a chance to pass kernel parameters to lilo for loading. You might not think this will be necessary, but if you reconfigure you system and forget to update lilo.conf appropriately you might not be able to boot without passing kernel parameters.

The image line tells lilo where to find the kernel image. The label is what lilo will show at the prompt when you hit the TAB key. And root tells lilo which partition the root (/) file system is located on (this is especially important because the mount program is in the /bin directory and is needed early during boot to mount the file systems).

If you have more than one kernel on the floppy you will need to add other image specific definitions.


 #global definitions
 #kernel image specific definitions
 image=/mnt/floppy/vmlinuz-2.2.14-5.0	#original kernel
         label=linux			#and its label
 image=/mnt/floppy/vmlinuz-2.2.17-14	#updated kernel
         label=linux2217			#and its label

Here the default=linux2217 line changes the default behaviour of lilo. Typically lilo would make the images available in the order that they are listed in lilo.conf. Using the default line you can select any image for default boot.

Now run lilo to make the floppy bootable

 	bash# lilo -v -C /mnt/floppy/lilo.conf

This tells lilo to be verbose (-v) and to use the specified lilo.conf (-C) file. Your floppy will now boot your machine as long as your root (/) directory is on device hda1 (change it if it is different).

Once you have installed lilo, unmount the floppy (umount /mnt/floppy will do it) and remove it from the drive. Now you are ready to boot your Linux machine with your new boot floppy.

Boot floppy with ramdisk

If your system will not boot without certain kernel modules, you will need to include an initial ramdisk image as a part of the boot disk.

Creating a lilo based boot floppy with an initial ramdisk is not very difficult. All you need to do is copy the existing ramdisk image from the /boot directory to the floppy disk and include the appropriate line in the lilo.conf file. The ramdisk image is usually name initrd- (e.g. initrd-2.2.14-5.0 on the default Red Hat Linux 6.2 installation).

If you want to make a new initial ramdisk image then you can create one by running the command

 	bash# /sbin/mkinitrd --with=module-name image-name 


 	bash# /sbin/mkinitrd --with=raid1 --with=ne raid-ne-ramdisk 2.2.14-5.0

This command has to be run as the root user. This line tells mkinintrd to name the image raid-ne-ramdisk, to include the modules raid1.o and ne.o in the ramdisk image and to use kernel version 2.2.14-5.0 for this ramdisk.

When creating a ramdisk, mkinitrd will look in /etc/conf.modules and use all SCSI adapter information. The /etc/fstab file is also used by mkinitrd to determine what type of filesystem the root device is on. Read the mkinitrd man page for more options.

The appropriate line in the lilo.conf file is initrd=


 	initrd=/mnt/floppy/raid-ne-ramdisk	#the initial ramdisk image

This just passes the location of the ramdisk image to lilo when it loads the boot sector.

B) Using loadlin and DOS on your boot floppy

If you want to boot Linux from a bootable DOS floppy using loadlin you will need to copy the kernel and possibly the ramdisk image onto the floppy, you will need to copy loadlin.exe onto the floppy, you will need to modify the and autoexec.bat file and create a batch file to run loadlin. These instructions start from the assumption you have a bootable DOS floppy.

Under Linux, mount the DOS floppy (e.g. mount -t fat /dev/fd0 /mnt/floppy) and copy the kernel image (/boot/vmlinuz-2.2.14-5.0) onto it. Copy the ramdisk image if needed and copy loadlin.exe as well. You can now create the loadlin batch file and edit the autoexec.bat file.

In the loadlin.bat batch file put

   @echo off
   A:\loadlin.exe A:\vmlinuz-2.2.14-5.0 root=/dev/hda1 ro

if you do not require a ramdisk and use

   @echo off
   A:\loadlin.exe A:\vmlinuz-2.2.14-5.0 initrd=raid-ne-ramdisk root=/dev/hda1 ro

if you do require a ramdisk. The root=/dev/hda1 line is the same as for the lilo.conf file above and tells loadlin where the root partition is located. The ro switch tells loadlin to mount the root filesystem as read-only initially (e.g. so that it can be fsck'ed). It will be remounted read-write at a later point in the boot.

In the autoexec.bat file include the following as the last line


That is all that is needed. At the end of the DOS boot process it will look in the autoexec.bat file, call the loadlin.bat batch file and loadlin will boot the Linux kernel.

Further Reading

If you have a desire to learn more about these topics, a good place to start is to read the HOWTO's and other documents at the Linux Documentation Project's website. Don't forget that reading the source code to programs is also one the best ways to learn about the Linux (and any) system.

(C) 2001 Petar Knezevich


Every attempt has been made to ensure that the information presented in this mini-HOWTO is safe and accurate. However, this information is given without any warranty, either expressed or implied, as to its suitability for a particular use. It is generally considered a GoodThing(TM) to make backups of your system files before changing system configurations and/or files. I suggest you take this precaution "just in case".