# FreeBSD 9.0 USB Install No Bootloader?



## DisketteDude (Sep 19, 2013)

Hi everyone, I'm new to FreeBSD, although I have been a Linux user for five years now so I consider myself fairly knowledgeable. Anyway, I am attempting to install FreeBSD alongside my Windows and Linux OSes. I had one free primary partition left, so I went ahead and let the installer automatically partition it. Things looked like they were going well, and the installer said everything was successful, but when I rebooted, I found my old bootloader with no FreeBSD. I booted into Linux and generated a new GRUB configuration file, but it didn't detect FreeBSD either. I noticed that the installer didn't seem to create a boot partition, just  root and swap.


----------



## wblock@ (Sep 19, 2013)

FreeBSD does not need a separate boot partition for MBR, or maybe if you have existing bootcode on GPT.  What version did you install?  Is the disk MBR or GPT?


----------



## DisketteDude (Sep 19, 2013)

MBR. Sadly the factory install of Windows will not boot from GPT on my bios based computer.


----------



## kpa (Sep 19, 2013)

wblock@ said:
			
		

> FreeBSD does need a separate boot partition for MBR, or maybe if you have existing bootcode on GPT.  What version did you install?  Is the disk MBR or GPT?



Don't you mean "a separate boot partition for GPT"?

For OP, FreeBSD does not use a separate partition for the /boot directory if you mean that.


----------



## wblock@ (Sep 19, 2013)

Edited now, I meant to say "does *not* need a separate boot partition for MBR".


----------



## DisketteDude (Sep 19, 2013)

So does the  FreeBSD bootloader not support multiple operating systems? Perhaps thats why the installer didn't install it.


----------



## scottro (Sep 19, 2013)

I don't believe GRUB detects FreeBSD.  If you're using GRUB2 to boot the various operating systems on your machine, he syntax you would need, assuming FreeBSD is on /dev/sd3 is

```
menuentry "FreeBSD" {
set root='(hd0,3)'
chainloader (hd0,3)+1
}
```

Some people find that doesn't work and use 
	
	



```
set root='(hd0,3,a)'
```
but for my setups, that has given me errors, whereas the the hd0,3 without an "a" works for me.

The way I do it is to create a /boot/grub2/custom.cfg file. That's in Fedora, which creates a grub2 directory, rather than a grub directory. Debian and its variants, such as Ubuntu, use /boot/grub rather than /boot/grub2. (As those are directories, are we supposed to use file tags?  Well, if I see it's been edited, I'll do it in the future.)

Although there is another way to do it, using some directory's 40_custom_rules or something similar -- the number might be 41. (I'm writing this from CentOS, which doesn't use GRUB2, so I don't remember the exact name), somewhere in the GRUB2 scripts, it will say to use a custom.cfg file if it exists.  I use the custom.cfg, but other people add it to the 40 or 41_custom or whatever it's called.

If you're using legacy GRUB, then it's even simpler. Just edit your menu.lst or grub.conf with a stanza like

```
title FreeBSD
rootnoverify (hd0,2)
chainloader +1
```

I don't have a FreeBSD install on a machine with legacy GRUB to test, but that should be right. Note that this time, the partition count starts at 0.  With GRUB2 it starts at 1.  So, if it's /dev/sda3 use hd0,2 as shown. Also, in GRUB2, at least in Fedora, I have found that the chainloader line must be written as I had it, with no spaces between (hd0,3) and the + sign. With legacy GRUB, you need the space between the word 'chainloader' and the '+1'.  (In case it's not clear, by legacy, I mean the GRUB 0.97 or 0.98, used by RedHat and its clones.)


----------



## wblock@ (Sep 19, 2013)

DisketteDude said:
			
		

> So does the  FreeBSD bootloader not support multiple operating systems? Perhaps thats why the installer didnt install it.



boot0, installed with boot0cfg(8), is a bare-bones multi-boot loader.  Whether it was installed was one of the reasons I asked which version of FreeBSD you installed.


----------



## DisketteDude (Sep 19, 2013)

Problem solved! Now how do I mark the thread as such?


----------



## SirDice (Sep 19, 2013)

Good, the first task on your new installation is upgrading it because FreeBSD 9.0 is End-of-Life :e

Unsupported FreeBSD Releases


----------

