In part 1, I chose some hardware for my NAS, but before putting some money in the project, I wanted a lighter version, as cheap as possible.
I had the opportunity to get an old Optiplex from work, lets start with this.

Hardware Setup

I first try to find a solution to put 4 disks in the specific case without success.
As there is only one place for a 3,5” HDD, I found a sub case to install two 2,5”.

disk_case

The solution to separate system and data disks was to use an hard drive adapter for the dvd drive place.

dvd_case

I chose to store the system on a Samsung SSD 870 Evo, 250 Go, and datas on two WD Blue 2,5” 5400 RPM, 2To

Is Proxmox a good choice ?

I wanted to use Proxmox for the main reason that it supports ZFS nativly and it is Debian based. After some questions on IRC, I realised that I didn’t need all the features it gives, and that it differs too much for a real Debian OS. The #debian channel on IRC can’t help, and #proxmox one is less active.

The solution came from IRC too.

Why don’t you use Debian 10 with a backport ?

  • … because I don’t know what it is.

Debian backports allow you to use a package from next Debian release on the stable one.
Great news, current ZFS version in Debian Buster is 0.8 and in Debian Bullseye, it is 2.0 which comes with the ability to use zstd compression.

The only source of knowledge is experience

After a quick Debian install, the first service I setup is sshd, it should be easy to reach my server, lets test from outside.
My ISP router doesn’t gave me a router that had an important feature: the NAT Loopback. It allows you to reach a server from its public IP when source and destination are the same IP.
With my current ISP, the only workaround was to use alternativly public or private IP if I’m at home or not.

Two weeks later, and after some usual problems with my new ISP and line activation, I get my new router working and the ability to reach it with public IP from my local network.

Data managment

Data on a mirrored storage is reliable only in case of physical problem on the pool. To be completely safe, I still need to replicate that data outside of home. Not all the data needs replication, nor sync, lets define how to manage all kind of data.

Type Size Sensitivity Incremental backup Replication Daily access Access type
Archives: pictures, videos + ++ No Yes No mount
Administrative docs - ++ Yes Yes Yes sync
Systems and homes backups ++ + Yes Yes No mount-sync
Phone Pictures, contacts - - No No No sync
Others ++ - No No No mount

The solution for data which needs Replication is syncthing.
Backups will be done with borgbackup.

Zpool creation

Let’s create the pool

$ zpool create -f -o ashift=12                        \
             -O acltype=posixacl                      \
             -O compression=zstd                      \
             -O relatime=on                           \
             -O xattr=sa                              \
             -O dnodesize=legacy                      \
             -O normalization=formD                   \
             -O mountpoint=none                       \
             -O canmount=off                          \
             -O devices=off                           \
             dpool /dev/sdb /dev/sdc

And some datasets

$ zfs create –o mountpoint=/data/zfs/backups dpool/backups
$ zfs create –o mountpoint=/data/zfs/sync dpool/sync
$ zfs create –o mountpoint=/data/zfs/vms dpool/vms
$ zfs create –o mountpoint=/data/zfs/docker dpool/docker

After copying some data

$ zfs list -o name,used,compressratio,logicalused,avail
NAME            USED  RATIO  LUSED  AVAIL
dpool           404G  1.06x   427G  1.36T
dpool/backups   275G  1.00x   275G  1.36T
dpool/docker    176M  2.66x   415M  1.36T
dpool/sync      723M  1.07x   765M  1.36T
dpool/vms        96K  1.00x    42K  1.36T
[...]