Personal NAS with TrueNAS Core
Modified 2024-07-27
Why TrueNAS Core?
The TrueNAS Core is an older, more robust NAS OS as it's based on FreeBSD and I don't care about the virtualization options TrueNAS Scale offers.
TrueNAS Core on Bare Metal
The ideal solution is to have a dedicated NAS device, which the services elsewhere on the network can use to store their data.
TrueNAS Core on Proxmox VE with Hard Drive Passthrough
Installation
- add TrueNAS iso to Proxmox's ISO images
- in
CPUgive it 2 cores - in
Memorygive it 8192 MiB - run
lsblk -o +MODEL,SERIAlto find the drives to be used for passthrough - passthrough the drives (don't set
scsi0)- run
qm set id_of_vm_100 -scsi1 /dev/disk/by-id/id_of_device - run
qm set id_of_vm_100 -scsi2 /dev/disk/by-id/id_of_device add the serial number to
vi /etc/pve/qemu-server/100.confscsi1: /dev/disk/by-id/id_of_device,size=1953514584K,serial=serial_number_of_device scsi2: /dev/disk/by-id/id_of_device,size=1953514584K,serial=serial_number_of_device- verify drives in the GUI
- run
- boot the VM and install TrueNAS
- remove iso and reboot
Configuring NAS Pools for NFS
- create a ZFS pool (if there's none existing yet)
- create the datasets
tank
- documents => accessed by by personal computers
- entertainment => accessed by other VM's
- images => accessed by other VM's
- backups => used by Proxmox for VZDump
- software => used by Proxmox for snippets, iso images and container templates
- vm-drives (optional) => used by Proxmox for disk images and containers
- change permissions of datasets to allow writing by group and others
My Backup Strategy
Local Copies
I consider these local copies as the first copy of my data, according to the 3-2-1 guidelines.
- documents are replicated across multiple devices using syncthing
- images are stored on a singular external SSD
Periodic Snapshot Tasks
In TrueNAS I've configured to take periodical snapshots of my images and documents dataset. These snapshots should help me when I accidentally delete data, and in the event of a ransomware attack (allegedly).
I consider saving these snapshots as my second copy and second for of media, as the original was stored on another SSD (either internally from another device, or externally from another SSD).
Cloud Sync Tasks
I backup my documents and images to BackBlaze B2, and consider this as the only backup off-site for both datasets, and thus my last and final copy of the data. These cloud syncs also create a snapshot on the NAS before executing the sync, just in case something goes wrong.
Each backup has it's own private bucket, which needs Cloud Credentials set up
in TrueNAS, before we can push the data to the bucket. For now the Transfer Mode
is SYNC, because I've set up the buckets to keep the data for a set amount of
time.