Resource icon

How to: Backup to local disks

How to: Backups to local disks

Overview:
This subject comes up often enough that I thought I would start a post of how I do it. Specifically I back up my TrueNAS to a hot-inserted, locally attached disk, then when done, hot-remove and take off-site.

The decision on whether hot-swap works okay or not, is up to the person implementing the solution. You have to decide if your SATA or SAS ports, as well as the OS drivers for them, are up to the challenge of hot-swap. And if your drive slot, (internal or external), can support hot-swap. If your SATA or SAS ports can't support hot swap, you can simply shutdown and perform the disk changes cold, (aka without power).

Next, the actual method of copying the data from the NAS to the backup disks will generate discussion. At present I use Rsync, but may move to ZFS send and receive. Yet the overall backup concept is the same.

For me, I can fit the entire NAS on a single 8TB disk. So that is my primary backup. I have an older 750GB disk that I can use to backup everything except the Media, so I rotate those 2. Later I may add another 8TB disk, (or larger), into the rotation.

Some people may not be able to fit a full backup on a single backup disk. Using a two, (or more), disks in a stripe, (or RAID-Zx), for your backup Pool may be acceptable for you. You have to decide.

Using plain files, (with either Rsync or ZFS send/receive), allows simple restores, or backup verification by comparing single files. Using a more complex method, like archive files, (for example TAR), adds in extra steps for the verification.

Note: In my case, I use a Seagate 8TB Archive SMR disk for backups of everything. SMR disks are slower for writes, and backups are generally write mostly. But, this was the only 8TB disk available when I went looking. Further, I am not backup window constrained, meaning I don't care how long the backups take.

This part describes the relevant hardware and software. I've left out un-needed details to simplify and reduce confusion.

My TrueNAS hardware is:
- FreeNAS Mini, (ASRock Rack C2750D4I)
http://www.asrockrack.com/general/productdetail.asp?Model=C2750D4I#Specifications
- 4 x 4TB disks


My backup hardware is:
- 1 x 750GB Seagate, (old, left over but still works)
- 1 x 8TB Seagate Archive SMR, (Shingled Magnetic Recording)
- 1 x 12TB WD Ultrastar DC HC520 7.2K SATA 6Gb/s 256MB Cache 3.5-Inch Helium Disk
- 20 x Anti-static zip-lock baggies
- 3 x Seahorse SE120 protective case
https://www.amazon.com/gp/product/B001A1PT7W
- Dual SATA to eSATA PCIe back panel adapter
https://www.amazon.com/gp/product/B005KKCP26
- StarTech USB 3.0/eSATA Dual-Bay Trayless 3.5-Inch SATA III, with fan
https://www.amazon.com/gp/product/B00M77UOC8
- FIDECO 3.5/2.5-Inch Hard Drive Enclosure Case with Fan, USB 3.0 to SATA Hard Drive
https://www.amazon.com/gp/product/B07D72Z4XD
- Cru-dataport LLC Rtx110-3q, All-Metal 1-Bay Trayfree Drive Enclosure, USB3/eSATA/FW800, with fan
https://www.amazon.com/gp/product/B00PJ1CNDW
- Short eSATA cable


My TrueNAS configuration:
- RAID-Z2 with 4 x 4TB disks
- Dual SATA to eSATA PCIe back panel adapter is wired to 2 x Intel SATA ports, not the Marvell SATA ports


Un-tested pool create:
(It's un-tested because it's been so long, and I only did it twice.)
- Scan for the disk(s);
camcontrol rescan all
- Create the pool;
zpool create -m /mnt/Backup -O compression=lz4 Backup {DISK}
or
zpool create -m /mnt/Backup -O compression=lz4 Backup750 {DISK}
- Create dataset for backup;
zfs create Backup/`uname -n | cut -f1 -d'.'`
or
zfs create Backup750/`uname -n | cut -f1 -d'.'`


Import disk:
- Remove backup disk from hard shell transport and storage case
- Remove backup disk from anti-static baggie
- For StarTech dual disk enclosure:
- Install backup disk in top bay​
- Dis-connect eSATA cable​
- Turn enclosure on​
- Wait til drive is ready, (10 seconds, maybe more)​
- Connect eSATA cable​
- Examine front panel's drive LED. Should be solid blue.​
- Run;
zpool import
- If import fails to see any pools, it may be needed to run the following and repeat import;
camcontrol rescan all
- Run;
zpool import Backup
or
zpool import Backup750


Start backup:
tmux
cd ~${MY_USER_NAME}/bin


Optionally;
setenv MY_BACKUP_SCRUB off

./backup_freenas_rsync


Examine log file:
less /var/log/local/XXX


Export backup disk:
cd /
sync
zpool status Backup
zpool export Backup
zpool list

or
cd /
sync
zpool status Backup750
zpool export Backup750
zpool list



See the discussion for the backup script. It's an attachment.

Latest updates

  1. Added 12TB disk to my backup hardware

    Got another plain disk for backups. It's in the standard rotation of the other 2, (8TB & 750GB).
  2. Updated the backup script - includes automatic snapshot

    Perform the snapshot regardless of the size of the backup media. Let the SysAdmin delete older...
  3. Added 2 newer external disk enclosures

    I've added 2 external disk enclosures that I've bought more recenly and have used successfully...
  4. Corrected spelling

    Updated the spelling of ASRack to ASRock Rack, which is what the company uses.
  5. Updated script

    I've added features to the script and am now publishing the changes.

Latest reviews

Exactly what we were lookiing for.
I was looking for this. Helpful.
Top