How I made a Grub backup floppy

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
Crash
Posts: 453
Joined: Fri 09 Dec 2005, 06:34
Location: Melbourne, FL

How I made a Grub backup floppy

#1 Post by Crash »

The Grub floppy that Puppy's Universal Installer makes is very fast and efficient. It only has Stage1 on it, and relies on Stage2 and menu.lst to be on the hard drive.

For backup purposes, it is nice to have Stage2 and menu.lst on the floppy. Then if you accidently do something to menu.lst on the hard drive, you can simply insert the floppy drive and boot up as if nothing happened.

I tried to make such a floppy myself several months ago, but was never successful. I did find a .img version of it on an Internet site, and that's what I have been using for a while.

The other day, I noticed that Gnu Grub's FAQ web site has the general instructions for making such a floppy along with some specific Grub code. Using their instructions, I made up the following shell script:

mkdir /mnt/fd0
mke2fs /dev/fd0
mount /dev/fd0 /mnt/fd0
mkdir /mnt/fd0/boot
mkdir /mnt/fd0/boot/grub
cp /boot/grub/stage1 /mnt/fd0/boot/grub/stage1
cp /boot/grub/stage2 /mnt/fd0/boot/grub/stage2
cp /boot/grub/menu.lst /mnt/fd0/boot/grub/menu.lst
umount /mnt/fd0
/usr/sbin/grub --batch --device-map=/dev/null <<EOF
device (fd0) /dev/fd0
root (fd0)
setup (fd0)
quit
EOF

This may be old hat to some, but for me it was an excellent learning experience. I used Geany, ROX, MUT, and Rxvt to generate and test this code - all on Puppy Linux. If it wasn't for Puppy, I would never have gotten this far in my understanding of Linux.

Post Reply