How I backup my data

In this post I will describe my backup procedure for my NAS at home. This is mainly so I can look it up myself. I am using TrueNas Core (running as a VM in Proxmox). My pools are encrypted by default.

Initial Backup

  • create a new pool with the UI
  • DO NOT create a dataset
  • assuming your existing pool is called tank_1 and you want to backup the dataset data
  • create a snapshot of tank_1/data
  • do an initial copy of a snapshot with zfs send tank_1/data@<snapshot> | pv | zfs receive -x encryption -vF tank_2/data

Incremental Backup

  • assuming your existing pool is called tank_1 and you want to backup the dataset data to another pool called tank_2
  • look up the most recent common snapshots between your pools (let’s call that one old_snapshot)
    • zfs list -t snapshot
  • take a new snapshot of tank_1/data (let’s call that one new_snapshot)
    • zfs snapshot tank_1/data@new_snapshot
  • unlock dataset tank_1/data and tank_2/data
  • finally send the snapshot over
    • zfs send -i tank_1/data@old_snapshot tank_1/data@new_snapshot | pv | zfs receive -x encryption -vF tank_2/data

delete old snapshot

  • zfs destroy tank_1/data@old_snapshot

Scrub a pool

  • zpool scrub tank_1
  • cmdwatch -n 1 zpool status tank_1

Change the password

  • unlock dataset
  • zfs change-key -l -o keyformat=passphrase -o keylocation=prompt tank_1