Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 May 2004 10:11:21 -0500
From:      Sean Welch <Sean_Welch@alum.wofford.org>
To:        db@traceroute.dk
Cc:        hackers@freebsd.org
Subject:   Re:Grub and FreeBSD 4.9
Message-ID:  <20040519151121.GA4157@NitroPhys.welchsmnet.net>

next in thread | raw e-mail | index | archive | help
I think you are making things too difficult for yourself.

I've been using grub since it first appeared in the ports tree and
the procedure is relatively simple compared to what you've been
trying to do.  The latest version also supports ufs2 quite nicely.

Here is what my menu.lst looks like:


timeout 5
default 4
password --md5 **************************************************

title Windows ME
	lock
	rootnoverify (hd0,0)
	chainloader +1		
title S2D resume
	lock
	rootnoverify (hd0,1)
	chainloader +1
title FreeBSD 5.2-Current
        root (hd0,2,a)
        kernel /boot/loader
title FreeBSD 4.9-Release
        root (hd0,3,a)
        kernel /boot/loader
title FreeBSD 5.2.1-Release  (default)
	root (hd0,3,d)
        kernel /boot/loader


(I have obviously replaced the password listing for security.)

The trick is that after you install grub via the port you must copy
the correct supporting pieces to /boot/grub from
/usr/local/share/grub/i386-freebsd/ directory.  Namely:

ffs_stage1_5
stage1
stage2

You also need a device.map file (because grub expects linux
terminology).  Mine contains the following:

(fd0)   /dev/fd0
(hd0)   /dev/ad0

Once you have also placed your menu.lst file there you can follow the
directions found in `info grub`	to get it installed to the disk.  To
give a short tutorial, here is what a session looks like for me:

NitroPhys# 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 /boot/grub/stage1
 (hd0,3,a)
 (hd0,3,d)

grub> root (hd0,3,d)
 Filesystem type is ffs, partition type 0xa5

grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/ffs_stage1_5" exists... yes
 Running "embed /boot/grub/ffs_stage1_5 (hd0)"...  15 sectors are embedded.
succeeded 
 Running "install /boot/grub/stage1 (hd0) (hd0)1+15 p (hd0,3,d)/boot/grub/stage 2 /boot/grub/menu.lst"... succeeded
Done.

grub> quit

NitroPhys#

That should get you going without any fooling around with floppies
and such.

Let me know if you still can't get it working properly.

Sean



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040519151121.GA4157>