Setting Up raid1 (Mirrored Pool) ZFS on Ubuntu as a Desktop Data Drive
Here’s some instructions on how I set up a zfs mirrored pool on Ubuntu 20.04. I made a similar post for zfs stripped mirror on Ubuntu server 14.04. Check out this post of you want to see that.
Install ZFS
The main components of ZFS are maintained as a standard Ubuntu package, so to install simply run:
$ sudo apt install zfsutils-linux
After that, we can check if ZFS was installed correctly by running:
$ whereis zfs
Create Storage Pool
First we need to choose which disks to pool. We can see what disks we have by running:
$ sudo fdisk -l
Write down the device names of the disks you want to pool. In my case it is /dev/sdb
and /dev/sdc
.
To create a disk pool, we run the following:
$ sudo zpool create -m <mount> <pool> mirror <ids>
In my case I want to pool /dev/sdb
and /dev/sdc
and I want to mount the pool to ~/data
:
$ sudo zpool create -m ~/data data mirror /dev/sdb /dev/sdc
You can check the status of ZFS pools with:
$ sudo zpool status
Lastly we need to set the correct permissions for the pool’s mount point using:
$ sudo chown -R $USER:$USER ~/data
That’s it! If you mounted the pool in the home folder like I did, it should show up in the nautilus sidebar like you see below.
Thanks for reading! If this post helped you, let me know on twitter so I know to keep writing stuff like this up.