Since bsdinstall is geared towards GPT installations, it's not so easy to dual-boot a fresh install of FreeBSD with an existing install of Windows on the same drive. I'm assuming here that you have an existing installation of Windows under an MBR structure. If you're running 64-bit Windows 7 under a UEFI motherboard, there's a fair chance your drive is operating under GPT. You can check this with GParted (under drive information, partition style should read 'msdos' if it is MBR-structured).
This tutorial will result in a FreeBSD installation with a UFS root partition. This does not cover ZFS.
The bootselect code will be the minimalist boot0 code as installed by previous versions of FreeBSD. Sorry, fancy bootselect fans.
The following only applies under MBR!
Back up anything you don't want to lose!
This worked for me but it may not work for you!
Assuming you have Windows installed, start your already-prepared FreeBSD installer from CD or USB. Follow the prompts as per the Handbook's instructions for bsdinstall until you come to the first partitioning prompt.
You are given the choice of Guided, Manual or Shell partition setup. Select Manual. You should see a hierarchy of your storage devices. From here I will assume that your installation target drive is ada0. If it is ad0 or otherwise, be sure to substitute. You may want to note the name of the storage device for later on.
On ada0, you should see an NTFS or FAT partition, named ada0s1 or similar. Select the parent (ada0) and Create and hit Enter to create your FreeBSD MBR partition. Change Type to "freebsd". Change size to the total intended size of all your FreeBSD slices, including Swap space. Don't enter a mountpoint. Select OK.
From here, make sure the first slice you create is your root slice, otherwise your install will not boot. bsdinstall does not appear to modify the order of slices from how you enter them, so you have to make the root slice first to ensure your installation is bootable.
To do this, select ada0s2 (the partition you created before) and select create. Then enter
Note that for an MBR partition, you do not create a 'freebsd-boot' partition as you would for a GPT installation.
Then, again by selecting ada0s2 and selecting Create, make a swap slice:
Feel free to make any other freebsd-ufs partitions (just not /boot) to fill out your freebsd partiton, then select Finish. The Handbook picks up from here, until you've committed, installed, rebooted. You'll notice bsdinstall has overwritten the MBR without asking any questions during the install, so for a scary few minutes you won't be able to access Windows.
Login to root (or login with a user and su to root), and then bearing in mind you should replace 'ada0' with your HDD's device if different, execute
to install the bootselect code to the MBR.
Rebooting, you should now be able to boot into Windows and FreeBSD.
This tutorial will result in a FreeBSD installation with a UFS root partition. This does not cover ZFS.
The bootselect code will be the minimalist boot0 code as installed by previous versions of FreeBSD. Sorry, fancy bootselect fans.
The following only applies under MBR!
Back up anything you don't want to lose!
This worked for me but it may not work for you!
Assuming you have Windows installed, start your already-prepared FreeBSD installer from CD or USB. Follow the prompts as per the Handbook's instructions for bsdinstall until you come to the first partitioning prompt.
You are given the choice of Guided, Manual or Shell partition setup. Select Manual. You should see a hierarchy of your storage devices. From here I will assume that your installation target drive is ada0. If it is ad0 or otherwise, be sure to substitute. You may want to note the name of the storage device for later on.
On ada0, you should see an NTFS or FAT partition, named ada0s1 or similar. Select the parent (ada0) and Create and hit Enter to create your FreeBSD MBR partition. Change Type to "freebsd". Change size to the total intended size of all your FreeBSD slices, including Swap space. Don't enter a mountpoint. Select OK.
From here, make sure the first slice you create is your root slice, otherwise your install will not boot. bsdinstall does not appear to modify the order of slices from how you enter them, so you have to make the root slice first to ensure your installation is bootable.
To do this, select ada0s2 (the partition you created before) and select create. Then enter
Code:
Type: freebsd-ufs
Size: <desired size postfixed with MB or GB>
Mountpoint: /
Label: <whatever pleases you>
Note that for an MBR partition, you do not create a 'freebsd-boot' partition as you would for a GPT installation.
Then, again by selecting ada0s2 and selecting Create, make a swap slice:
Code:
Type: freebsd-swap
Size: <whatever you like, I prefer 2x RAM>
Mountpoint and Label are greyed out. Select OK.
Feel free to make any other freebsd-ufs partitions (just not /boot) to fill out your freebsd partiton, then select Finish. The Handbook picks up from here, until you've committed, installed, rebooted. You'll notice bsdinstall has overwritten the MBR without asking any questions during the install, so for a scary few minutes you won't be able to access Windows.
Login to root (or login with a user and su to root), and then bearing in mind you should replace 'ada0' with your HDD's device if different, execute
Code:
boot0cfg -B ada0
Rebooting, you should now be able to boot into Windows and FreeBSD.