3

I have installed FreeBSD 9.1 on the second partition of an external hard disk and I'm not able to get my computer to boot from it. FreeBSD was installed using the FreeBSD memstick image dd'd onto a USB flash drive.

The first partition is an ntfs partition which has my backup. When I found the need to have a FreeBSD installation, I "shrank" the first partition (in windows) to get free space to install FreeBSD and then installed FreeBSD. It never asked to install a boot manager.

When I first tried to boot, it failed without any error message (maybe there was no boot manager installed). So I booted from my flash drive, and ran the command boot0cfg -B /dev/ad1) (ad1 refers to the external hard disk). Now on booting, it displays a menu like:

F1 Win
F2 FreeBSD
F5 First disk

and on pressing F1 or F2 I get the error message: "BOOTMGR is missing". What could the problem be?

Please help me boot into my FreeBSD installation.

7
  • You might want to include any links to tutorials/guides you're following as your attempting to do the installation.
    – slm
    Apr 24, 2013 at 6:51
  • I'm not following any particular guide. Most of the info was taken from FreeBSD handbook. I was successfully able to install everything. The real question is how do I boot? Apr 24, 2013 at 6:54
  • Yup, understand. It just makes it easier for would be answers to follow what you've done thus far.
    – slm
    Apr 24, 2013 at 6:55
  • freebsd.org/doc/en/books/handbook/bsdinstall-pre.html this is one of the places Apr 24, 2013 at 7:00
  • 1
    I believe you actually have two choices: a) change bios to boot from the second hdd and mark the partition as active/bootable. b) install a boot loader (ex grup on MBR)
    – BitsOfNix
    Apr 24, 2013 at 7:11

1 Answer 1

2

Both hard drives ad0 and ad1 need to have the boot0 boot code, and the slice (MBR partition) of ad1 that FreeBSD sits on needs to have boot1. This is somewhat confusing but results from a way back architectural decision to use bsd disklabels inside MBR partitions.

Boot0 is really small and dynamic, allowing for other OSes respectable bootloaders to continue. Basically boot0 sits in the MBR. Boot0 cannot read disklabels so it just loads first block(s) of a partition(slice) and jumps to execute that code.

Boot1 is where the FreeBSD specific code really starts, memory is set up in modes suitable for FreeBSD kernel and the boot1 code can read the BSD disklabel, find / and even read the filesystem enough to find a kernel file by name. Boot1 is quite complicated and does loads of stuff, including loading more of boot code, modules, the kernel and starts executing the kernel.

I'm guessing you have a disk layout somewhat like this:

ad0 - internal hard drive (boot0)
ad0s1 - first and only partition (slice) of the internal hard drive, C:\

ad1 - external hard drive (boot0)
ad1s0 - a FAT or NTFS partition (slice) on external drive, D:\
ad1s1 - FreeBSD partition (slice) (boot1)
ad1s1a - FreeBSD /
ad1s1b - FreeBSD swap
ad1s1c - FreeBSD /usr
...

I've noted where you need boot0 and boot1 loaders.

Doing this by hand teaches nice valuable lessons about how FreeBSD boots. Next lessons up in line are configuring the /boot/ environment, changing a custom image and selecting and configuring kernel modules before the kernel itself is loaded.

I'm guessing you're doing this mostly for learning purposes and could be interested in stripping down the installation. NanoBSD is worth looking into.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .