Whole disk ZFS Install Guide

Revision as of 15:32, August 31, 2015 by Whitehascii (Talk | contribs) (Create a pool)


ZFS seams to be one of the future filesystems. At the time of writing (31.08.2015) booting on ZFS is still a headache. Some linux distributions boot on ext2 partition and run zfs as rootfs like ZFS_Install_Guide and some are able to boot from zfs, some do support zfs only as a filesystem.

Funtoo linux supports ZFS as filesystem and as rootfs, however it does not support it as boot/grub filesystem. For easier search by search engines, it is referred to in this document as whole disk ZFS.

Funtoo linux uses the grub bootloader. So it has been not really understandable, why whole disk ZFS could not be supported by funtoo, as grub is able to do so. Or better, some linux distribution, using the grub bootloader run "whole disk ZFS". What they can, ... yes, we can! ... as well.

This guide is based on many trial and errors - caused by lack of knowledge - the actual ZFS_Install_Guide and a guide for whole disk ZFS for ubuntu. Ubuntu runs als grub bootloader, so some ideas are adapted from there.



This guide is a working pretty well on one computer - that is mine! If it does not run on yours, or if it breaks on yours, than you should try to sort the issue out and report it to this page respectively.

So, you may expect that it MAY work! ... and you should be aware that it MAY break your installation. This guide is not developed enough to ENSURE a stable production environment.

... however, I use it for that! ;-) - crazzy as I am.


ZFS will run properly only on 64Bit machines. If you plan to run ZFS with 32Bit, you may also try russian roulette with six bullets. The outcome is clear, and sure not that what you want!

Downloading the ISO (With ZFS)

This is a copy by the date of 31.08.2015 from the ZFS_Install_Guide.

In order for us to install Funtoo on ZFS, you will need an environment that already provides the ZFS tools. Therefore we will download a customized version of System Rescue CD with ZFS included.

Name: sysresccd-4.2.0_zfs_0.6.2.iso  (545 MB)
Release Date: 2014-02-25
md5sum 01f4e6929247d54db77ab7be4d156d85

Download System Rescue CD with ZFS

Creating a bootable USB from ISO (From a Linux Environment)

This is a copy by the date of 31.08.2015 from the ZFS_Install_Guide.

After you download the iso, you can do the following steps to create a bootable USB:

Make a temporary directory
# mkdir /tmp/loop

Mount the iso
# mount -o ro,loop /root/sysresccd-4.2.0_zfs_0.6.2.iso /tmp/loop

Run the usb installer
# /tmp/loop/usb_inst.sh

That should be all you need to do to get your flash drive working.

Booting the ISO

While booting the above mentioned iso image - you should use exactly that one, unless you are writing another guide - you shoud use the option E) Alternative 64bit kernel (altker64) with more choice.... 64Bit, as mentioned above.

On the next page you should select 7. SystemRecsueCd with the default graphic environment. The system will come up with a small graphical environment and some tools. One of them is a graphical version of gparted, which will be used in this guide.

Preparung the harddrives

The preparation of the harddrives envolves the following steps:

Cleaning the disks

This guide was developed using GPT partition layout. Any other layout type is not included here.

All below this note is a copy by the date of 31.08.2015 from the respective section of the ZFS_Install_Guide.

First lets make sure that the disk is completely wiped from any previous disk labels and partitions. We will also assume that /dev/sda is the target drive.

# sgdisk -Z /dev/sda

This is a destructive operation and the program will not ask you for confirmation! Make sure you really don't want anything on this disk.

Create a pool

In this section, we create a whole disk ZFS / zpool. For the convenience of this guide, a mirror pool with the name tank will be created and not mounted (option -m none). Single disk ZFS or even zraid could be used respectively.

The option ashift=12 is set for hard drives with a 4096 sector size.

#   zpool create -f -o ashift=12 -m none -R /mnt/funtoo tank mirror /dev/sda /dev/sdb 

Here we use the devices /dev/sda and /dev/sdb, and not the partitions as described in the ZFS_Install_Guide. As well the cachefile is omitted, as destructive issues may occure in productive environment.