
The MBR (master boot record) is getting old. As soon as first 2 Terabyte hard drives begin to appear, it won't be able to hold such a big partition and won't even be able to use the whole drive anymore.
GPT is a new scheme for partition tables on many platforms by now. Usually you would need an EFI BIOS to start up a system partitioned with the GPT layout. But FreeBSD has a way to use an MBR to forward the loading to the GPT boot loader. This is actually a nice way to keep everything compatible, as long as mainboards with EFI are scarce.

I have written this tutorial for people who don't have any system installed and want to install FreeBSD on a blank hard disk. I want to give you this warning first, because all that you will achieve here is to destroy any data on your hard drive. So be aware that this is dangerous and don't forget to backup your data properly.
So what you need here is:
After FreeBSD live CD booted, you have to select your country and keyboard layout. Then select Fixit and CDROM/DVD. You get a nice prompt saying Fixit #.
I'm using tcsh for my configuration, so I'm starting it first by typing:

I start by initialising an empty GPT. Note that the tools often are hidden in the /dist directory and it is not a part of the PATH environment.
I want to emphasize once again. You will destroy everything on your hard disk with the following commands!
The command
gives you the current partitioning status. You can use it any time you want and you will need it again and again to find the next sector you can use for the next partition.
I get the following output. I will explain it, so you know how to partition your own hard drive.
The first line tells you about your hard drive. You can start partitioning from sector 34 and the last available sector is 39999935. The second line gives information that there is free space beginning at sector 34 and spreading to sector 39999935. Ok, it means that the drive is empty.
First I need a partition for the boot sector. You can add it with the following command. You will need at least 16 sectors (8kB), but you can use more. You should perhaps keep in mind that the boot process has to load the entire boot partition to the memory to start it, so don't make it too large. If you don't know what you are doing, use 16 sectors.
I added a freebsd-boot partition at sector 34 with 16 sectors on drive ad0. The partition name is ad0p1. Note the suffix p1 and don't forget that there are no slices here that you know from MBR. In case you plan to install FreeBSD on ZFS and boot it directly on a ZFS root file system, you might want to use 64 sectors (parameter -s, because you will need to transfer the file gptzfsboot which is a bit larger.
I will add more partitions here for my FreeBSD needs. You can calculate the sectors by looking at the output of /dist/sbin/gpart show.
I have the following partition layout now:
| Partition | Type | Size | File system |
|---|---|---|---|
| ad0p1 | freebsd-boot | 8kB | - |
| ad0p2 | freebsd-ufs | 512MB | / |
| ad0p3 | freebsd-swap | 512MB | swap |
| ad0p4 | freebsd-ufs | 512MB | /tmp |
| ad0p5 | freebsd-ufs | 3GB | /var |
| ad0p6 | freebsd-ufs | 12GB | /usr |
| ad0p7 | freebsd-ufs | 3GB | /usr/home |
Optionally, you can use filesystems of type freebsd-zfs, but I would not recommend it for anything except /usr/home. If you use ZFS boot, you might want to use ZFS only in your partitions
The step that you should not forget is to make the drive bootable. We have a partition layout now, but your system won't start up at this moment. First I want to write the main boot bootcode. This is easy.
I tell gpart to write the bootcode to partition ad0p1 hence the -i 1.
Now I will make the new file systems ready to copy files on it.
It is up to you, if you want to use encryption (geli) and/or journaling at this point. You have to use the proper tools for this. The live CD has everything needed in /dist/sbin. Just don't forget to add the modules to the kernel in your /boot/loader.conf later.

The easiest thing is to fetch the install image, mount it and execute the installation scripts on the mounted destination file systems. There are, of course many ways how to install the base system. It depends where you install it and how your system and network looks like. You can also mount /usr/src and /usr/obj from some other FreeBSD system and install world and kernel. The process is a little bit more complex, though, and needs more manual intervention.
First I need my network interface up. I will use DHCP and I need to create a directory for dhclient to run it.
In next step, I need more space than my live CD offers, so I am going to mount my file systems in the /mnt subdirectory.
Now it is time to download the installation CD from my favorite FTP mirror. This can take a few minutes, depending on your download speed.
After finished downloading, I will mount the ISO image.
Now, I want to install all needed FreeBSD distribution files.
Now a totally empty FreeBSD distribution has been installed, but you still need some important settings to boot the system properly. I will therefore chroot into /mnt and setup the rest of the system.
I need a /etc/fstab file. I will create it with vi.
And also a /etc/rc.conf file. It will look like this for a start. I need a German keyboard layout and I like my key rate fast.
Ok, now the system should be ready to boot. I need to unmount my file systems cleanly and tidy up the rest.
At this point we are back on the live CD GUI. Select Exit and then Exit Install. I am going to reboot the PC with my first hard drive now, where the fresh FreeBSD installation on the GPT is.
At this point everything should be set up. You should see your login prompt.
You can log in using your root password, update your system, install software and set up the rest of your system and software.
What should I say more? Have fun!
m8d.de, 2008