Toward The New Bootdisk Howto, part 6
(Making a GRUB rescue disk)
It is time to make something almost useful. This is the explanation how to make your own GRUB (version 1) boot disk.
By downloading the next version of the package Strelka (0.5.2) you will get a script which would download GRUB, unpack it, compile it and generate 98K big (or small 😉 ) GRUB boot image. You should just run the program
./getsoftware-stable.py inside of unpacked directory and after the process you will get disk image at
After that you may run it by using qemu:
qemu -fda disks/disk0.img -no-kqemu -m 256 -boot a.
Here is the short explanation of what program is doing (note that this is not an explanation of the whole program which may do a couple of more and not so important things):
- It is downloading GRUB from ftp://alpha.gnu.org/gnu/grub/grub-0.97.tar.gz.
- Then it is unpacking it inside of the directory build/grub-0.97.
- After that script
- The same script is generating disk image by using the command
cat build/grub-0.97/stage1/stage1 build/grub-0.97/stage2/stage2 > disks/disk.img.
If you don’t know how to use programs
tar, please read documentation. Both of the programs are the part of GNU system and you may choose one of the manual variant: wget manual page and tar manual page.
If you don’t know to use GNU configure and build system, please read the Ian Lance Taylor’s manual.
There is a good manual for the first generation GRUB, also at the GNU’s site. However, there is no any useful documentation for the second generation GRUB. Because of that I decided to use the first generation GRUB for the beginning. At the some stage of the drive we will switch to the second generation GRUB again.
If your distribution is using GRUB you may just cat
/boot/grub/stage2 files into one disk image. However, we want to build the system independent of the architecture or boot loader and even independent of kernel. So, basically, the first goal was to make those to files by compiling.
stage1 contains boot sector and file
stage2 contains the rest of the GRUB. Actually, it contains GRUB itself.
As you could see, making simple rescue GRUB disk is quite simple. If you want to put it on floppy disk, you should do just
cat disks/disk0.img > /dev/fd0 (of course, with floppy disk inside of your disk drive).
However, making disk with grub, kernel and busybox is somewhat more complex.
You may join the discussion group (which is still not active), as well as you may contact me (firstname.lastname@example.org).
- Toward The New Bootdisk Howto, part 1 (The Beginning of The Road)
- Toward The New Bootdisk Howto, part 2 (A Scratch for The Road, part 1)
- Toward The New Bootdisk Howto, part 3 (A Scratch for The Road, part 2)
- Toward The New Bootdisk Howto, part 4 (A Scratch for The Road, part 3: kernels 1)
- Toward The New Bootdisk Howto, part 5 (A Scratch for The Road, part 4: kernels 2)
- Toward The New Bootdisk Howto, part 6 (Making a GRUB rescue disk)