GRUB Floppies to boot large kernels

From LQWiki
Jump to: navigation, search
This is from the linuxquestions post

http://www.linuxquestions.org/questions/showthread.php?s=&threadid=237511


Editing GRUB Floppies to boot large kernels

Most new distros have a kernel of the 2.6 series with an initrd that combined is too large to fit on one floppy. Alternatives to GRUB include Isolinux.

EMERGENCY FLOPPIES CAPABLE OF BOOTING LARGE KERNELS

1) Install a 2.6 series kernel and you may also need to use command mkinitrd to make a ramdisk image.

2) To keep it simple create 3 freshly formatted msdos floppies. That way the vmlinuz can fit onto the floppy without space concerns. Or use ext2 floppies if you wish.

3) Install GRUB the bootloader if you haven't already done so.

FLOPPY 1 ----Create with a file structure like this:

/grub
/grub/menu.lst
/grub/stage1
/grub/stage2 

Copy the stage 1 and 2 files from either your /boot/grub or your backup folder /usr/local/share/grub/i386-pc (or any subfolder of grub if you downloaded a different version)

Create MENU.LST file - filename is in lower case---the lst stands for LIST copy and paste this into a text editor and save as /mnt/floppy/grub/menu.lst

title floppy
root (fd0)
pause "insert kernel floppy number 2 then press enter"
kernel /vmlinuz root=/dev/hda5 ro
pause "insert initrd floppy number 3 then press enter"
initrd /initrd.gz

notes

A) Check /etc/fstab to amend in case your / partition is not at /dev/hda5.

B) Check that your /boot/initrd file ends in .gz it may end in img so change to suit the guilty.

C) I am not concerned with eye candy so there are no timeouts or colour map files for your entertainment, the reason for the floppy is your system does not boot from the hd, so don't increase the risk of failure.

D) Delete last 2 lines if you do not need an initial ram disk image to boot. And ignore floppy 3 instructions.

E) Its not kernel /boot/vmlinuz etc as the second floppy has no folder /boot.

6) INSTALL GRUB TO MBR OF FLOPPY (floppy 1)

a) Open a terminal type su then when prompted type your root password

b) type grub and press enter

c) Your prompt should now show grub then the cursor.

d) type root (fd0) and press enter

e) type setup (fd0) and press enter


notes A) You may get errors in the output for step (e) in not finding one or more files, do not be alarmed unless the end line is NOT reading success or succeeded.

B) Feel free to post any errors you get if that last line is not a success.

C) I can ignore my first error - looking for /boot/grub - as the next line solves it

D) I can ignore error - could not find a fat stage 1.5 file - as I have no fat fs. Mine is all reiserfs.

The manual says we do not need ANY stage 1.5 files.....I hear and obey.

7) unmount floppy one and mount floppy 2


FLOPPY 2

8) Copy a real vmlinuz file to floppy and rename it as vmlinuz

9) Unmount floppy 2 and mount floppy 3

NOTES

A) We do not do anything to the mbr of floppy 2 or 3.

B) Do not copy the /boot/vmlinuz file as it is likely a symbolic link to the real file.

Check the reported size of the floppy file..... it should NOT be zero bytes. If it is, you copied a link file. The real one will be about 1.3 Mb. The real file will be /boot/vmlinuz-2.6.7 or something OTHER than vmlinuz. Max free space on a msdos is 1423 Kb.


FLOPPY 3

10) Copy initrd.gz to floppy

11) Unmount floppy 3

Note you may have initrd.img depending on your distro.


12) All done now test it please.

NOTES.

I have tested this with Slackware 10 ...2.6.7 kernel and a initrd.gz The purpose of keeping the initrd and vmlinuz files to separate floppies and the structure of the menu list file is so you can also have the old 2.4.26 on floppy and edit the grub command line to delete the initrd line, neat eh??

Or you can create a new floppy 1 with the initrd deleted and amend the menu.lst to delete the initrd line. And of course, you may end up with several kernel floppies but you will only need one initrd floppy unless you change hardware?

External links