gptboot gjournal gotcha!
Published on 2010-03-03
Installing FreeBSD in fixit can be a bit tricky, and even more so, if you want to add journaling through GEOM. Another nice thing you might want is a GPT partition layout instead of the, older and more restrictive, MBR scheme. These are all reasons why you would like to install the whole system through the fixit environment.
But I digress.. in order to provide efficient journaling for UFS you will need to:
- Keep it on a dedicated provider, i.e. give it its own partition.
- (For magnetic disk drives) Keep it at the beginning of the drive in order to reduce seek times.
- Tag the partition with the type freebsd-swap.
So what’s with the freebsd-swap partition type?
The answer is twofold:
- gjournal actually works on the block level and not on the filesystem level.
- gptboot reads your parition table and tries to boot from the first freebsd-ufs partition it finds.
I consider the second point more noteworthy since this behaviour is not clearly documented. So when you are finalizing your installation with1:
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ad0
You can rest assured that your system will not halt displaying an ugly “Not ufs” error.
Assuming freebsd-boot is on
/dev/ad0p1
↩