Findings and guidance for setting up FreeNAS to back up to tape over iSCSI. Fun proof of concept with a few real implications. See paper for more nuanced steps
- Debian 8 or 9 server (CentOS is also an option, but Debian was most familiar)
- FreeNAS or other NAS solution
- QuadstorVTL
Follow installation steps in the text-based installer
- apt install uuid-runtime build-essential sg3-utils apache2 psmisc linux-headers-`uname -r
- Add "non-free" to /etc/apt/sources.list
- apt update
- apt install firmware-qlogic
- a2enmod cgi
- wget https://quadstor.com/vtldownloads/quadstor-vtl-ext-3.0.40-debian-x86_64.deb
- dpkg -i quadstor-vtl-ext-3.0.40-debian-x86_64.deb
- systemctl enable quadstorvtl
- Run ip addr and go to the IP
- Add a drive in addition to the boot drive in the FreeNAS machine
- Add it to a disk pool in FreeNAS
- Create users and assign them SMB or other types of shares
- Give FreeNAS an easily recognizable NetBIOS name and alias
- Test access with another machine on the network
- Add a drive to the machine to act as the "tape"
- Add the drive to a pool through the QuadstorVTL web interface
- Go to "Virtual Drives" and click "Add VDrive" to add a tape drive
- Add a VCartridge (non-WORM) and select the pool it will use
- On subsequent boots you will need to manually "load" the VCartridge
- Go into shell mode in FreeNAS
- Edit the "require" line (7) in /conf/base/etc/ix.rc.d/ix-zfs to include iscsictl
- Remove the block on port 3260 (iSCSI) in /conf/base/etc/ipfw.conf.block by deleting it from line 4
- Go to "System" then "Tunables" and add the following 3 rc.conf variables to ensure iSCSI on boot a. iscsictl_enable with value "YES" and type rc b. iscsictl_flags with value "-Ad " and type rc c. iscsid_enable with value "YES" and type rc
- Go to "Tasks" then "Init/Shutdown Scripts" a. Add the command "zpool export " as a shutdown script for proper shutdown after disk sync
- Run "iscsictl -Ad " to add all iSCSI devices on the Debian machine
- Run iscsictl to make sure the tape drive's iqn, target IP, and mount point shows up
- Basic commands a. tar -czf /dev/sa0 /mnt//* to back up the entire pool to the tape cartridge at /dev/sa0 b. tar -tzf /dev/sa0 to list all files on the drive c. tar -xvzf /dev/sa0 -C / to actually restore the entire backup (this will overwrite from / so the path lines up
- Two scripts are included in the repo: tapebu.sh and taperes.sh. The backup script can be assigned as a weekly cronjob
- The execution in real practice would probably need more fine tuning
- The proper boot order is QuadstorVTL, clicking "load" on necessary tape cartridges, then booting FreeNAS a. This just ensures iSCSI drives are available before FreeNAS boots
- Thanks to user thewizard231 on the FreeNAS forums for giving steps for making FreeNAS act as an iSCSI initiator https://www.ixsystems.com/community/threads/freenas-as-an-iscsi-initiator.22098/#post-462100