# bootloader booting second disk



## Nadja (Sep 22, 2010)

Hello there!

I just ordered a new system and want to do a fresh install in a correct way. I have two SSDs, one I want to use for FreeBSD and the other for Windows 7 64bit. Since I want FreeBSD to be ZFS-only, I have to use GPT, so having two hard drives solves the issue of Windows 7 not being able to boot from GPT.

My question is: if I install FreeBSD on the first hard drive, how can I boot Windows off the second drive other than configuring the other hard drive as boot-drive in the BIOS (which would be annoying)? I know that the "old" boot0-loader could boot other partitions on the same hard disk, but since I use GPT, I don't have boot0 (or at least I have no clue how to) and I'm not even sure boot0 is/was able to boot from another hard disk.

I know that setting up something with grub2 might actually work (though I only find instructions how to use the grub-loader to load and start FreeBSD which I don't want to try, because if the boot-procedure changes, I'm screwed) and my old Windows XP could just boot FreeBSD by copying one of the boot files. Does that still work with Windows 7? I never used it before so I really have no clue about Windows 7.

Any help on how to set this up so I am using the FreeBSD-code to boot FreeBSD is very much appreciated.


----------



## roddierod (Sep 22, 2010)

You could try GAG


----------



## Nadja (Sep 22, 2010)

From what I know, GAG can't handle GPT and thus cannot boot a GPT-only FreeBSD.
It might work with EasyBCD and chainloading, though I have never tried that since I haven't used Vista or Windows 7 before.


----------



## aragon (Sep 22, 2010)

Nadja said:
			
		

> I'm not even sure boot0 is/was able to boot from another hard disk.


It can.


----------



## Yampress (Sep 22, 2010)

grub

I have grub (ver. 1) and multiboot with 3 systems 


```
title		Debian GNU/Linux, kernel 2.6.26-2-686
root		(hd0,4)
kernel		/boot/vmlinuz-2.6.26-2-686 root=/dev/sda5 vga=792 ro 
initrd		/boot/initrd.img-2.6.26-2-686

title		FreeBSD 8.1 Production Release
root		(hd0,3,a)
kernel		/boot/loader


title	Windows 7
root	(hd0,0)
makeactive
savedefault
chainloader	+1
```

grub is installed on linux, but on freebsd you can too


----------



## Nadja (Sep 23, 2010)

aragon said:
			
		

> It can.



Then from what I read, the following command (or sth. similar) should work for ZFS, GPT and second hard disk:

[CMD="gpart"]bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0[/CMD]

Is that correct?


----------



## aragon (Sep 23, 2010)

Sorry, I don't know.  I've only used boot0 with BIOS partition tables...


----------



## Nadja (Sep 24, 2010)

Since I'll get all the components this evening, I'll post if that worked or not on Monday. Thanks for all the suggestions so far


----------



## jem (Sep 24, 2010)

I set up a dual-boot system with FreeBSD on my second disk, leaving the first disk untouched and just used the BIOS boot device menu to select which disk to boot from.  I just installed the standard pmbr and gptzfsboot on the second disk.

This is the simplest method in my opinion, and avoids the risk of clobbering the Windows boot loader and leaving the system unable to boot Windows.


----------



## Nadja (Sep 27, 2010)

Now that I've installed both, Windows 7 and FreeBSD, I learned my lesson.
First of all, I installed Windows 7 first. Although I chose to install it on the second harddisk, it created a 100MB slice on the first drive to boot from there. Since I had my Windows fully installed with all needed programs, I found out when I was too lazy to uninstall windows again. What I *should* have done is first remove the first HD and then install windows on the second drive, then reattach the first one and start installing FreeBSD. Anyway... having this 100MB slice, I added another slice, covering the rest of the disk and followed these instructions to the end. All is working now and I can chose which OS to boot. Only problem is that if my first HD crashes, the second one with Windows will remain useless. But oh well... usually it doesn't take long before I reinstall Windows anyway 

I don't remember where, but I read somewhere that you can't use the boot0 bootmanager with GPT and still be able to chose where to boot from. This is why I think the solution I chose (no GPT) is in a way even better than using GPT just for the sake of using it 

Thanks to everyone for the comments!


----------

