Do you use a VPS which doesn’t support FreeBSD? Or your VPS supports FreeBSD but their install is trash and you want Root on ZFS? Hopefully your VPS gives you the option to boot in to a Linux rescue distribution (i.e. some kind of “live” environment). If so, you can quite easily install FreeBSD and put Root on ZFS.

Introducing mfsBSD, a tiny bootable image that gives you a minimal FreeBSD installation that when it boots, runs from memory. Which means you can go about configuring ZFS because your disk isn’t in use.

Boot your VPS in to a rescue/live Linux environment and then fetch the mfsBSD ISO image:

# wget

Next, write the image to your disk. For example:

# dd if=mfsbsd-14.0-RELEASE-amd64.iso of=/dev/sda

And reboot.

Your VPS will reboot in to a minimal installation of FreeBSD and it will be running entirely from memory (/dev/md0). Which means you can now destroy your disk’s partition layout and install Root on ZFS.

Log in as root and password mfsroot. Then destroy the existing partition table. This is of course 100% destructive. You will not get your data back. If you’ve got multiple disks, make sure you get the right one.

# gpart destroy -F /dev/da0

Now you can use mfsbsd’s handy zfsinstall script to do all the heavy lifting to create Root on ZFS and install FreeBSD. As a minimum:

# zfsinstall -d /dev/da0 -p zroot

Which will install FreeBSD on to /dev/da0 and name the ZFS pool zroot. The zfsinstall script accepts many parameters to customise the FreeBSD installation, such as creating a swap partition.

Once zfsinstall has done its thing, reboot the machine again and enjoy FreeBSD with Root on ZFS on your VPS. Once it has booted in to FreeBSD, you’ll want to:

  • Login as root (no password).
  • Set a root password.
  • Add things to /etc/rc.conf, such as networking, starting sshd etc.
  • Run: freebsd-update fetch install

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.