Backup to USB Drive
Introduction
For same applications it might be necessary to use an external drive without adding this drive to a ZPool. E.g. if you want to copy from or to an external device.
Setup / mounting
TrueNAS will not mount a drive automatically when plugged into an USB Port. This has to be done manually. In this example I will use an external drive from LaCie.
- Plug in the drive to any USB Port
- Figure out the name of the device. It can be seen in Storage --> Disks. It is usually the drive without pool.
- Enter
lsblk -p | grep "disk\|part"
. It will show show the exact name of the partition you want to mount.
In this case it is sdd2. - Create a mountpoint
sudo mkdir /mnt/LaCie - Mount the device
sudo mount /dev/sdd2 /mnt/LaCie
Create an rsync job
rsync -anv --delete --log-file=/var/log/rsyncd.LaCie.log --exclude "._*" --exclude ".@*" /mnt/XPpool01/backup/qnap01/ /mnt/usb_drive
rsync -a --exclude-from='/exclude-file.txt' /src_directory/ /dst_directory/
Add to cronjob.