Re: GRUB boot floppy creation

From: Leonard Evens (len_at_math.northwestern.edu)
Date: 01/31/05


Date: Sun, 30 Jan 2005 18:42:57 -0600

thufir wrote:
> I can't boot into Fedora linux, only win2k, on a dual boot system. I
> don't want to effect the MBR or similar on the hard drive, therefore I
> want to create a GRUB boot floppy.
> <http://grub4dos.sourceforge.net/wingrub_examples.html#q2> describes
> how to do this, but I have some question. based on
> <http://grub4dos.sourceforge.net/wingrub.html#q4> my values for the
> grub list manager:
>
> Key p12
> Desc p12 dsk eng (nsfS)
> path C:\grubStuff\
> or
> path A:\
>
> clicking on "system" has no effect, while "output" simply brings up a
> browse list of directory's to change the path. Where's the step to
> actually create the boot floppy, please?
>
>
> thanks,
>
> Thufir Hawat
>

The following should work. Boot into rescue mode from the Fedora CD.
As indicated do chroot /mnt/sysimage.

Put a floppy disk in the floppy drive.

Do
dd if=/usr/share/grub/i386*/stage1 /dev/fd0 bs=512 count=1
dd if=/usr/share/grub/i386*/stage2 /dev/fd0 seek=1

You can then boot into native grub from that floppy.

Having done that, in grub do

grub> root (xxx,y)
where xxx is the disk containing your linux and y represents the partion
on which /boot gets mounted. But remember grub counts from 0. So if
you have only one disk, and /boot gets mounted on the second primary
partition, use root (hd0,1)

If you have had grub installed by the Fedora installation file, there
should be relevant files in /boot/grub. Try

grub> configfile (xxx,y)/grub/grub.conf
with the same rules about xxx and y. That should bring up the usual
grub boot menu and allow you to boot. If you don't have such a
configuration file already present on that disk, you will have to
eventually make one. Someone else suggested how to go about it.

But to boot right now you need a
grub> kernel /vmlinuz-.... ro root=...
where you need to fill in the appropriate ... s for your system.
You probably also need
grub> initrd /initrid-...
again filling in the specificaiton for the kernel on your disk,
Then
grub> boot
should boot you into Linux. Once you are there, you can create a
configuration file, and a grub boot floppy containing it. The other guy
explained how to do that. Roughly, you make a file system on the
floppy disk, mount it, make a /boot/grub directory on it, copy the grub
stage1 and stage2 and your configuration file, which should be called
grub.conf to that directory on the floppy, and then umount the floppy.
Finally, you run /sbin/grub and do
grub> root (fd0)
grub> setup (fd0)

That should do it. It did for me.

If you don't already have a configuration file, here is a copy of mine,
which you will probably have to make changes to. I have two scsi disks,
so you will have to adapt it to the disks you have and the location of
the relevant partitions.

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd1,0)
# kernel /vmlinuz-version ro root=/dev/sdb2
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=10
splashimage=(hd1,0)/grub/splash.xpm.gz
title Fedora Core (2.6.9-1.11_FC2)
         root (hd1,0)
         kernel /vmlinuz-2.6.9-1.11_FC2 ro root=LABEL=/ rhgb quiet
         initrd /initrd-2.6.9-1.11_FC2.img
title Fedora Core (2.6.9-1.6_FC2)
         root (hd1,0)
         kernel /vmlinuz-2.6.9-1.6_FC2 ro root=LABEL=/ rhgb quiet
         initrd /initrd-2.6.9-1.6_FC2.img
title Fedora Core (2.6.8-1.521)
         root (hd1,0) kernel /vmlinuz-2.6.8-1.521 ro root=LABEL=/
rhgb quiet
         initrd /initrd-2.6.8-1.521.img
title Windows 2000
         rootnoverify (hd0,0)
         chainloader +1