Jump to content

IM-13 How To Make a Boot CD

Recommended Posts

Browse: [About the FAQ Forum] [Table of Contents] [FAQs] [Contribute] [IM: Installing and Configuring Mandrake]


IM-13: How To Make a Boot CD


Like many recent distros, the kernel for mdk9.2 is too large to make a bootable floppy. My previous post dealt with how to get around this problem by making extended floppies using fdutils:




This is an alternative method for creating a bootable cd for kernels that won't fit on a standard floppy. It works by creating a 2.88MB image on your hard drive to which you copy the necessay files like you would normally have on a bootable floppy then converting that image to a bootable iso image which you can burn with k3b just like any other bootable cd.

Here's how:


1. Open a console and creat a directory in /home/<username> called test and navigate to test:


$ mkdir test
$ cd test


2. "su" to root and create an empty 2.88MB floppy image called 288boot.img:


$ su
# <enter root password>
# dd if=/dev/zero of=288boot.img bs=1k count=2880


3.Format the image you just made to msdos:


# mkfs -t msdos 288boot.img


4. Install the bootlader, syslinux on the image:


# syslinux -s 288boot.img


4. Create a directory in test called "floppy" to mount the image:


# mkdir floppy


5.Mount the image using loop:


# mount -t msdos -o loop 288boot.img floppy


6. Open another console, su to root and fire up konqueror:


# su
<enter root password>
# konqueror


7. Navigate in konqueror to /home/<username>/test/floppy. If the above went correctly you should see a file called "ldlinux.sys". That's the syslinux bootloader that you installed to 2.88boot.img which is now mounted on /home/<username>/test/floppy. The way 288boot.img was created with the "dd" command makes it act like a simulated 2.88MB floppy drive. That's why you were able to format the image file and mount it, just like an ordinary floppy drive.


8.From konqueror, copy and paste the vmlinuz and initrd files from /boot to the floppy directory in test. The ones that came with the download edition are "initrd-2-4.22-10mdk.img" and "vmlinuz-2-4.22-10mdk". if you've updated your kernel or are using a nonstandard kernel, you'll have different numbers.


9. In your /home/<username>/test/floppy directory rename the initrd and vmlinuz files to simply "initrd.img" and "vmlinuz".


10.Create two empty text files in floppy and name them "syslinux.cfg" and "boot.msg". These will be your text configuration files for the bootloader. In boot.msg copy and paste the following text:


Press <return> (or wait 10 seconds) to boot your Mandrake Linux system from

/dev/hdxx. You may override the default linux kernel parameters by typing

"linux <params>", followed by <return> if you like.


In syslinux.cfg, copy the following text:


default linux
prompt 1
display boot.msg
timeout 100
label linux
kernel vmlinuz
append initrd=initrd.img root=/dev/hdxx


In both instances "xx" should correspond to the location of your root partition for mdk9.2. also, if you have any drives running under scsi emulation you should add "hdx=ide-scsi" to the append line in syslinux.cfg for each drive. Do not put the append line in quotes like you do for lilo's append line.



11. Close konqueror and the console that opened it and unmount 288boot.img in the remaining open console:


# umount floppy


12.Delete the floppy directory in test:


# rmdir floppy


13. Make the iso from 288boot.img:


# mkisofs -r -b 288boot.img -o bootcd.iso /home/<username>/test


Note, you must be in the "test" directory when you run mkisofs and you must designate the full path after "bootcd.iso". This will create the bootable iso "bootcd.iso" in the /home/<username>/test directory.


14. Burn bootcd.iso just like you would any iso with your favorite cd burning program. If all went well, the cd you burn should work just like a boot floppy but it will load much faster. The above procedure is adaptable to any linux distro that has a kernel too big to fit on a floppy.

Link to comment
Share on other sites

  • 1 month later...

That's good to know, but wouldn't it be easier to use the mkrescue script?


/sbin/mkrescue --iso


From the manpage:


mkrescue takes its specifation for the kernel from  the  default  image
      specified in /etc/lilo.conf.  If the actual default is an other= speci-
      fication, then use the first image= specification.  Any associated ini-
      tial  ramdisk  (initrd=),  and  append= options will also be used.  The
      root directory will be taken to be the current root.  A bootable floppy
      or CD-image will be created using LILO version 22.5.5 or later.  mkres-
      cue normally requires no options, unless a CD-image is desired (--iso).

Link to comment
Share on other sites


  • Create New...