Jump to content

How to install GRUB without a floppy disk

0
  carlaschroder's Photo
Posted Aug 24 2009 11:57 AM

If you would like to install GRUB, but your system does not have a floppy drive. Or you have a floppy drive but can't find a usable floppy disk, use GRUB's own command shell to set it up.

First, install GRUB, or upgrade to the latest version. To get the version number, use:

$ grub —version
grub (GNU GRUB 0.94)

Next, take a few preparatory steps:
  • Make a hard copy of your partition table (fdisk -l | lpr).
  • Make a hard copy of lilo.conf.
  • Back up your data and have a rescue disk, like Knoppix, at hand.
  • Leave your LILO installation intact, in case you want it back.
Then open a root shell on your Linux system, and start up a GRUB shell:

# grub

Probing devices to guess BIOS drives. This may take a long time.

GNU GRUB version 0.94 (640K lower / 3072K upper memory)
[ Minimal BASH-like line editing is supported. For the first word, TAB lists possible
command completions. Anywhere else TAB lists the possible completions of a
device/filename. ]

grub>

Find the stage1 loader:

grub> find /boot/grub/stage1
(hd0,0)

Now run these three commands:

grub> root (hd0,0)
grub> setup (hd0)
grub> quit


Reboot, and you will be greeted by the GRUB command shell.

You'll probably want to boot into Linux and create a GRUB boot menu.

This is what happened with those three little commands:

grub> root (hd0,0) Set the root device.
grub> setup (hd0) Install GRUB to the MBR.
grub> quit Exit GRUB.

You will see output similar to this:

grub> root (hd0,0)
Filesystem type is reiserfs, partition type 0x83

grub> setup (hd0)
checking if "/boot/grub/stage1" exists...yes
checking if "/boot/grub/stage2" exists...yes
checking if "/boot/grub/e2fs_stage1_5" exists...yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 15
sectors are embedded.
Succeeded.
Running "install /boot/grub/stage1 (hd0) (hd0)1+15 p
(hd0,0)/boot/grub/stage2 /boot/grub/menu.lst"...Succeeded

grub> quit

Tags:
0 Subscribe


0 Replies