Grub installation from the ports collection vs. Freebsd boot
loader
Geert Hendrickx
geert.hendrickx at ua.ac.be
Sat Jul 3 15:35:35 PDT 2004
On Sat, Jul 03, 2004 at 05:35:35PM -0400, Bruce Hunter wrote:
> On Sat, 2004-07-03 at 16:17, Geert Hendrickx wrote:
> > > title FreeBSD 5.2.1
> > > root (hd0,2,a)
> > > kernel /boot/loader
> >
> > Sorry, this should be (hd0,1,a) ! The first slice (windows) is (hd0,0)
> > and the second is (hd0,1), and you want the root-partition within that
> > (hd0,1,a).
> >
> > GH
> > _______________________________________________
>
>
> I have read a few instructions from info grub. I am a little confuzed.
> There are so many different ways to do this. One way is grub-install
> /dev/hd0 or stages.
>
> except hd0 is not a device under freebsd. I am trying to install it to
> the mbr. At least I think that's where I should install it.
>
> i believe ad0s1 is windows and ad0s2 is freebsd
> -----------------------------------------------------------------------
> flipnode at solid# grub-install /dev/ad0/
> Probing devices to guess BIOS drives. This may take a long time.
> /dev/ad0/: Not found or not a block device.
> flipnode at solid# grub-install /dev/hd0
> /dev/hd0: Not found or not a block device.
> flipnode at solid# grub-install /dev/ad0
> /dev/ad0 does not have any corresponding BIOS drive.
> flipnode at solid# grub-install /dev/ad0s1
> /dev/ad0s1 does not have any corresponding BIOS drive.
> flipnode at solid# grub-install /dev/ad0s1
> /dev/ad0s1 does not have any corresponding BIOS drive.
> flipnode at solid# grub-install /dev/ad0s2
> /dev/ad0s2 does not have any corresponding BIOS drive.
>
> ----------------------------------------------------------------------
> just a little confuzed.. :o/
>
> Bruce
The easiest way (in my opinion) to install Grub is with the interactive
tool. Just run "grub" from the commandline, and you'll be dropped in
the same interactive environment you will enter upon booting when you
have no grub.conf (or grub cannot find it). The commands you can enter
here, are the same as in the grub.conf.
The first thing you have to do is copy the stagefiles from
/usr/local/share/grub/i386-freebsd/ to a directory called /boot in
either of your partitions (Grub can read many filesystems, including
UFS, FAT and NTFS). Also put your grub.conf in that directory. Then
start "grub" from the commandline, so you'll get the Grub-prompt.
If your boot-directory is on your Windows-drive (C:\BOOT), then you must
enter "root (hd0,0)" (the Windows-slice), if it is on FreeBSD, then use
"root (hd0,1,a)" (your root-partition on FreeBSD). Grub will then check
if the necessary files are there, and tell you if not.
If the files are indeed there, you can install the stage1 into the MBR
with "setup (hd0)". Stage1 is just a pointer to stage2 (which actually
contains Grub), but that one is too big to fit inside the MBR, so it
must be on one of your filesystems (in the /boot directory, so that the
stage1 can find it).
You could also install Grub into a partition (e.g. "setup (hd0,1)"), but
that way Grub will not show up at boot, only when you explicitly
chainload that partition (using another bootloader e.g. FreeBSD's).
P.S. 1: the grub.conf file is completely optional, so Grub will not
complain if it's not there, you will simply be dropped at the Grub-
commandline at your next reboot. There you could enter the exact same
commands as in the config-file, e.g. "root (hd0,1,a)" and "kernel
/boot/loader" to boot FreeBSD. But you'll have to confirm with the
command "boot".
P.S. 2: The Grub-commandline provides tab-completion for both devices
and files. So, to see all your partitions (and their filesystem-types),
you could enter ( + Tab.
GH
More information about the freebsd-questions
mailing list