Refreshing my NAS configuration

I setup my Network Attached Storage (NAS) back in 2014 after getting a nice discount on a HP MicroServer of the previous generation. I added some more ECC RAM, fitted four hard drives, installed FreeNAS, and then happily used it to offload my poor computers of all the media and random stuff I had lying around there. When I moved out of the country in 2015, I packed light and left the NAS behind. Until 2021.

The 2TB hard drives are not so big by today's standards but I am happy with the 3.4TB total storage space for now (the hard drives are setup in a RAID-Z2 array, allowing me to lose two drives out of four). Of course if I lose a drive, chances are the others will fail soon too. Maybe even during the resilvering (rebuilding the RAID after replacing the faulty drive). A RAID array is not a backup. I read multiple times that 6 drives would give the best trade-off with RAID-Z2, but unless I fit two more 3.5" hard drives in that small space (it's not hot in there, but the fans and drives are too loud already), it's not going to happen any time soon.

I did a few routine maintenance updates of FreeNAS itself, but I am still lagging behind on an unsupported version. The latest version is not even called FreeNAS anymore, it's TrueNAS CORE now. Though I have to say that after the initial setup, I simply forgot about it and simply used the NFS shares for a bit. It just worked.

When I configured FreeNAS in 2014, I had no idea about how many datasets I should create and how I should split my data. I simply went with documents (to store my home dirs), media (music, movies, and the like), and raw (everything else that was not nicely sorted such as mirrors of external drives and copies of old (internal) drives before disposing of the hosts).

I won't lie, I am still a neophyte when it comes to handling FreeBSD (e.g. the jails) and configuring it. Last week I managed to mess up all file permissions of one of my datasets. Thankfully it was my home dirs mirror, so it does not matter if I blindly reset the permissions to u+rwX,go=. I also realised that I was naive enough to store my NAS user account on that same dataset. So when I reset the permissions, I also set the wrong bits for the SSH configuration and could not login anymore. It took me a shamefully long time to realise why I could not remotely log-in. I finally solved my problem with the help of the console in the FreeNAS UI: one call to chmod later and I could log-in again.

Here is the new scheme I came up with:

  • home: simply the home directories of the NAS accounts; I don't want to stupidly break my SSH configuration anymore
  • dione, iapetus, …: mirrors of the data stored on my everyday computers
  • media: original dataset for multimedia files – still a good idea
  • raw: original staging dataset of files I am supposed to review and categorise – only relevant if I actually move things out of it, otherwise I should rename it to dumpster

The idea of mirroring data from my computers is that I can leverage ZFS snapshots directly on the NAS and not handle a more-or-less complicated, and more-or-less very slow incremental local backup process. I do not work with really big files on my computers. The only time I access big multimedia files is when I travel and I want a local cache of movies/series. I am fine rsync-ing a subset of my filesystem over the wire to the NAS every day.

I thought that it would be really nice to be able to browse through the snapshots in a user-friendly manner, for instance if I want to restore an older version of a file. After a few days of leaving that train of thoughts on the back-burner, I came to the conclusion that I actually do not need that feature. I don't care about selective restoration. I don't need a time machine for individual files because if I do, then I use a version control system (e.g. Git). I imagine that the only times I would need to restore a snapshot are if I have a hardware failure, and if my files end up encrypted by some external entity asking me to pay them in cryptocurrency in exchange for the decryption key. In both cases I can take the time to navigate through manually cloning the snapshots in question and promoting it or restoring from it.

Next up: switching from DéjàDup against Google Drive to rsync to the NAS.