Right, I'm about halfway through writing the sort-of final version of this, but I've got a practical problem: This computer is connected to the internet by a rather dubious temporary hack, and I just can't get sysinstall to work with FTP. Too many layers of NAT, I suspect, or possibly some problem with WinXP ICS.
I'll have to get back to you when I have bought myself a long TP cable.
For the time being, here's the first half:
Software
FreeBSD, specifically a liveFS CD.
A partitioning program that can create logical partitions (e.g. gPartEd)
GRUB 2
Some way to install GRUB 2, I'm using an Ubuntu install [1].
Outline
Step by step
I'll install Ubuntu and do the partitioning from their liveCD, just to cut down on the number of steps. The details of partitioning and installing a linux are beyond the scope here, so I'll just show the partition layout when it was done:
The next step is to install FreeBSD. I'm using the amd64 7.1 livefs iso, though the i386 version would also be fine.
When sysinstall starts, chose [font="Courier New"]Fixit -> CDROM/DVD[/font]. This drops you at a shell.
Note the [font="Courier New"]ad [/font]devices - they correspond to the partitions in the partition editor screenshot above. ad0s1 is the extended partition, and ad0s5+ are the logical partitions inside it.
In this case, we're interested in ad0s7 (which will be our / partition), ad0s8 (which will be /usr), and ad0s9, which will be swap.
First, we need to format it. I'll do UFS2 with softupdates on both:
[font="Courier New"]Fixit# newfs -U /dev/ad0s7[/font]
[font="Courier New"]Fixit# newfs -U /dev/ad0s8[/font]
Next, mount this somewhere. /mnt will do nicely:
[font="Courier New"]Fixit# mount /dev/ad0s7 /mnt[/font]
We also have to mount the other partitions in the appropriate subdirectories:
[font="Courier New"]Fixit# mkdir /mnt/usr[/font]
[font="Courier New"]Fixit# mount /dev/ad0s8 /mnt/usr[/font]
Leave the fixit shell (the exit command, or Ctrl D). Leave the [font="Courier New"]Fixit [/font]menu, and go to [font="Courier New"]Configure[/font]. Select [font="Courier New"]Options[/font], and change Install Root to where you mounted the partition(s), e.g. /mnt.
Work in progress
Leave the Options menu, and go to [font="Courier New"]Distributions[/font]. Pick Base and Kernels (where you want the GENERIC kernel), and leave the distributions menu: This will take you to the media select screen, where you can pick something suitable - I used FTP, since the liveFS CD doesn't contains the neccesary files.
The details around this are the same as for a normal install,. so I'll just skip to when the installation finishes. There's a few more things we need to do in the fixit shell. I've had some weird problems with starting it again, so I'd suggest leaving sysinstall and rebooting now, starting up from the liveFS CD again, and then starting the fixit shell. If you do, repeat the [font="Courier New"]mount [/font]commands from earlier.
What's left to do is to set the GENERIC kernel as default, and to write a suitable fstab. Assuming the new isntall is mounted at /mnt :
[font="Courier New"]Fixit# cd /mnt/boot
Fixit# mv GENERIC kernel
Fixit# ee /etc/fstab [/font]
With the partitions above, you'd want something like this:
Save and exit. Leave the fixit shell, exit sysinstall, reboot.
That's it for the FreeBSD side: What's left is to install grub2 and config it to boot the FreeBSD install (not to mention whatever else you've got installed, but I'll leave that to you.)
GRUB 2
I'll be working in Ubuntu 9.04 from here on, since that's what I happen to have in the VM I'm testing this in. You might be able to install GRUB2 on and from FreeBSD. If so, I might come back to that later.
Support for booting 64-bit FreeBSD was only very recently added, so until it makes it into the packages of assorted linux distros, you probably have to compile it yourself.
To do this, I had to install subversion, autoconf, and bison. It might also be smart to deinstall grub, since we'll be installing to some of the same locations as it (and would risk an update to grub overwriting grub2 files).
# svn co svn://svn.sv.gnu.org/grub/trunk/grub2
# cd grub2
# ./autogen.sh
# ./configure
# make install
To be continued (now that I've finally got myself a decent network connection).
[1] As a variation from the SuSE last time.
[2] I think it's possible to compile it on FreeBSD as well - but one experimental thing at the time.
I'll have to get back to you when I have bought myself a long TP cable.
For the time being, here's the first half:
Software
FreeBSD, specifically a liveFS CD.
A partitioning program that can create logical partitions (e.g. gPartEd)
GRUB 2
Some way to install GRUB 2, I'm using an Ubuntu install [1].
Outline
- Create the logical partitions
- Format, mount, and install FreeBSD to them from the livefs CD
- Install GRUB2 (from Linux) [2]
- Configure it to boot FreeBSD.
Step by step
I'll install Ubuntu and do the partitioning from their liveCD, just to cut down on the number of steps. The details of partitioning and installing a linux are beyond the scope here, so I'll just show the partition layout when it was done:
The next step is to install FreeBSD. I'm using the amd64 7.1 livefs iso, though the i386 version would also be fine.
When sysinstall starts, chose [font="Courier New"]Fixit -> CDROM/DVD[/font]. This drops you at a shell.
Note the [font="Courier New"]ad [/font]devices - they correspond to the partitions in the partition editor screenshot above. ad0s1 is the extended partition, and ad0s5+ are the logical partitions inside it.
In this case, we're interested in ad0s7 (which will be our / partition), ad0s8 (which will be /usr), and ad0s9, which will be swap.
First, we need to format it. I'll do UFS2 with softupdates on both:
[font="Courier New"]Fixit# newfs -U /dev/ad0s7[/font]
[font="Courier New"]Fixit# newfs -U /dev/ad0s8[/font]
Next, mount this somewhere. /mnt will do nicely:
[font="Courier New"]Fixit# mount /dev/ad0s7 /mnt[/font]
We also have to mount the other partitions in the appropriate subdirectories:
[font="Courier New"]Fixit# mkdir /mnt/usr[/font]
[font="Courier New"]Fixit# mount /dev/ad0s8 /mnt/usr[/font]
Leave the fixit shell (the exit command, or Ctrl D). Leave the [font="Courier New"]Fixit [/font]menu, and go to [font="Courier New"]Configure[/font]. Select [font="Courier New"]Options[/font], and change Install Root to where you mounted the partition(s), e.g. /mnt.
Work in progress
Leave the Options menu, and go to [font="Courier New"]Distributions[/font]. Pick Base and Kernels (where you want the GENERIC kernel), and leave the distributions menu: This will take you to the media select screen, where you can pick something suitable - I used FTP, since the liveFS CD doesn't contains the neccesary files.
The details around this are the same as for a normal install,. so I'll just skip to when the installation finishes. There's a few more things we need to do in the fixit shell. I've had some weird problems with starting it again, so I'd suggest leaving sysinstall and rebooting now, starting up from the liveFS CD again, and then starting the fixit shell. If you do, repeat the [font="Courier New"]mount [/font]commands from earlier.
What's left to do is to set the GENERIC kernel as default, and to write a suitable fstab. Assuming the new isntall is mounted at /mnt :
[font="Courier New"]Fixit# cd /mnt/boot
Fixit# mv GENERIC kernel
Fixit# ee /etc/fstab [/font]
With the partitions above, you'd want something like this:
Code:
/dev/ad0s7 / ufs rw 0 0
/dev/ad0s8 /usr ufs rw 1 1
/dev/ad0s9 none swap sw 0 0
Save and exit. Leave the fixit shell, exit sysinstall, reboot.
That's it for the FreeBSD side: What's left is to install grub2 and config it to boot the FreeBSD install (not to mention whatever else you've got installed, but I'll leave that to you.)
GRUB 2
I'll be working in Ubuntu 9.04 from here on, since that's what I happen to have in the VM I'm testing this in. You might be able to install GRUB2 on and from FreeBSD. If so, I might come back to that later.
Support for booting 64-bit FreeBSD was only very recently added, so until it makes it into the packages of assorted linux distros, you probably have to compile it yourself.
To do this, I had to install subversion, autoconf, and bison. It might also be smart to deinstall grub, since we'll be installing to some of the same locations as it (and would risk an update to grub overwriting grub2 files).
# svn co svn://svn.sv.gnu.org/grub/trunk/grub2
# cd grub2
# ./autogen.sh
# ./configure
# make install
To be continued (now that I've finally got myself a decent network connection).
[1] As a variation from the SuSE last time.
[2] I think it's possible to compile it on FreeBSD as well - but one experimental thing at the time.