Backblaze Review - YOU NEED THIS! Get a Backblaze free trial: I've been using Backblaze backup on my main Mac for about three ye. After signing into the Backblaze site you can prepare a mailed restore on the 'View/Restores Files' page. USB Hard Drive up to 8TB. Flash Drive 256GB. Shipping and handling included. Depending on the size of the restore it might take several days to prepare and ship the drive. You may choose to have your hard drive encrypted during.
FreeNAS
FreeNAS is an operating system that can be installed on virtually any hardware platform to share data over a network. FreeNAS is the simplest way to create a centralized and easily accessible place for your data. Use FreeNAS with ZFS to protect, store, and back up all of your data. FreeNAS is used everywhere, for the home, small business, and the enterprise.
Unraid
Unraid Server OS 6 is a storage operating system developed by Lime Technology that is designed to scale with a system’s hardware. Its RAID design supports a mix of devices, filesystems, and sharing policies.
Overview | FreeNAS 11.3 | Unraid |
Ease of Use | Graphical User Interface | Graphical User Interface |
Documentation | User Guide, How-To Videos, Training Videos | Wiki |
Certified Hardware Available | SoHo and Business | No |
Open Source Licence | Primarily 2-clause BSD | Commercial, requires paid licensing key |
Base Operating System | FreeBSD 11.3 | unRAID Server OS 6.8 |
File System | OpenZFS | XFS (default), BTRFS |
Architecture | 64-bit | 64-bit |
Downloads | Over 10 million | Unknown |
Development Language | Python, Angular | Closed source |
Open Source Repository | https://github.com/freenas | Closed source |
Core Developers | 25+ | Lime Technology |
Forums | 66,500+ users and over 550,000 posts | over 630,000 posts |
YouTube Community Videos | 134,000+ results and 22K+ subscribers | 169,000 results |
Social Media | 28,800+ Facebook likes, 13,700 Twitter followers | 7,425 twitter followers, 124 Google+ members |
Restorability | Download/Upload configuration file, default settings restore, boot environments | /previous folder (CLI) |
Built-in Visual Reporting | CPU, disk, memory, network, processes, uptime, iSCSI, ZFS | CPU, disk, memory, network, processes, uptime, Docker |
Supported Disk Configurations | Stripe, mirror, RAIDZ1, Z2, Z3, hot-swap | Stripe, single parity, dual parity |
Encrypted Storage Support | Software Disk Encryption, Self-Encrypting Drives (SED), and Dataset Encryption in TrueNAS CORE 12 | Software Disk Encryption, Command Line Self-Encrypting Disks |
Third Party Application Support | Plugins, Jails, bhyve VMs, Docker VMs | Docker, KVM, Qemu |
API | REST, websockets | none |
Alerting Services | GUI, email, and SNMP alerts, integration with AWS-SNS, InfluxDB, Slack, Mattermost, OpsGenie, PagerDuty, VictorOps | GUI and email alerts |
Built-in File Sharing Protocols | SMB, NFS, AFP, WebDAV | SMB, NFS, AFP |
Built-in Block Storage Protocols | iSCSI | none |
Other Built-in Network Protocols | rsync, FTP, TFTP, LLDP, SSH, DDNS, SNMP | FTP, rsync (CLI), SSH (CLI) |
Built-in Cloud Synchronization | Amazon S3, Backblaze B2, Box, Dropbox, FTP, Google Cloud Storage, HTTP, Hubic, Mega, Microsoft Azure Blob Storage, Microsoft OneDrive, pCloud, SFTP, WebDAV, Yandex | Command line |
Built-in Directory Services | Active Directory, LDAP, Kerberos, NIS | Active Directory |
Built-in Hardware Protocols | S.M.A.R.T., SCSI Enclosure Services (SES), UPS | S.M.A.R.T., UPS (APC only) |
Built-in Virtualization | bhyve, Docker | KVM, Qemu |
Backblaze Freenas Setup
Backing up FreeNAS to Backblaze B2
I am not the original author of the content on this page. While searching for information about setting up Backblaze B2 on a FreeNAS installation, I came across this hyperlink: https://blog.justin-tech.com/blog/freenas-b2-backup. Unfortunately, that page now leads to an HTTP 502. Google had it cached.
The instructions worked almost perfectly, except for a couple adjustments due to updated versions of the relevant software. The idea that this useful information may disappear into the aether worried me, as it may still help others, and I'll more than likely need it again in the future. In the spirit of open source, I copied the page as rich text in Firefox, ran it through an HTML to Markdown converter, and set about cleaning it up, fixing conversion errors and formatting lost in the text-only view in Google's cache. I am posting the results below in the hope that it remains available and useful for others.
If you are the author of this content and object to this use, please contact me here on GitHub and I will promptly remove it. I humbly thank you for writing it in the first place. It really helped!
If you use FreeNAS, it's probably because you care about your data. Part of data security is ensuring the availability of your data. To that end, you need to ensure that said data is backed up. There are generally two reasonable ways to backup your data from FreeNAS. One, local backup (using ZFS replication), and two, cloud backup.
In this article, we will look at setting up cloud backups to Backblaze B2, an economical cloud backup solution similar to Amazon S3.
Step 1: Sign up
Sign up for a Backblaze account here. Once you have created an account, go to the 'My Settings' tab, and under 'Enabled Products', check the box beside B2 Cloud Storage. This enables your account for using B2.
Step 2: Create a Bucket
Once you have enabled your account for B2, you need to create a bucket (where your files are stored). To do this, on the left side of the screen, select 'Buckets' under B2 Cloud Storage. Then, select Createa Bucket. Also on this page, be sure to click on 'Show Account ID and Application Key', and mark down your Account ID and click 'Create Application Key'. Also mark this down, as you will not be able to see itagain, and will need it when we setup rclone in a later step.
Step 2a: Setup Caps and Alerts
While this step is optional, it is highly recommended so that you get notified about any charges against your account that you may not be expecting. I set mine to a cap of $1 a day for each section. This will give you 6Tb of storage, and a good number of API calls.
Step 2b: Have a look around your account
Have a look around your Backblaze account, there is a great get started guide available here.
Step 3: Setting up a FreeBSD Jail on FreeNAS
Login to your FreeNAS GUI, and go to the Jails section.
Click 'Add Jail'.
Enter a Jail Name. I called mine 'b2-backups'.
Click Ok, and your jail will be created. Note that this may take a little bit of time. You should be able to close the dialog box if needed, the jail will be created in the background.
Click on your Jail and click the 'shell' button in the bottom left. This will open a shell session to the Jail.
Enter
vi /etc/rc.conf
and changesshd_enable='NO'
tosshd_enable='YES'
. This will enable SSH to the jail.FreeBSD uses vim as a text editor, use i to insert text, del to delete the rest of the line, and the arrow keys to scroll. Save and exit by pressing the ESC key and then :we to save and quit.
You will need to run passwd root and reboot in order to have SSH access, as well as
PermitRootLogin yes
in /etc/ssh/sshd_config.At this point, you can switch over to SSH, if you prefer that to the shell in the FreeNAS GUI.
Install wget using pkg install wget, this will allow you to download the rclone binary.
Download the latest rclone binary: cd /tmp && wget https://downloads.rclone.org/rclone-v1.38-freebsd-amd64.zip.
run
unzip rclone-v1.38-freebsd-amd64.zip
to extract the binary. rclone version 1.38 is the latest stable release at the time of this writingCopy the rclone executable to /usr/bin by running
cd rclone-v1.37-freebsd-amd64 && cp ./rclone /usr/bin
Step 3a: Adding storage to the Jail
- Create a new folder structure in the Jail, I put mine in /mnt/storage, where you will mount your FreeNAS datastores. It is a goodidea to make a folder for each dataset you want to mount.
- In the FreeNAS GUI, go to the Jails tab, and then the Storage sub-tab.
- Click 'Add Storage'
- Select the Jail you want to add the storage to.
- Select the source dataset.
- Select the destination (this will be the folder structure in the jail that you created in Step 3a-1).
- Optionally select read-only.
- Leave 'Create Directory' selected.
- Click 'Ok'.
- Repeat steps 3a-4 to 3a-9 for each dataset you want to backup to B2.
Step 4: Configuring rclone
- Run rclone config to initiate the configuration of rclone
- Press n to create a new remote (a remote is what rclone uses to know where to copy/sync your files).
- Enter a name, I choose b2.
- Press 3.
- Enter your account ID from your B2 account.
- Enter your application Key from your B2 account.
- Leave endpoint blank.
- Press y to save the config.
Step 4a: Configuring encryption
Follow steps 1-3 from Step 4. Note, name this new remote different than the previous remote.
Press 6 (Encrypt remote).
Enter the name of the remote you created in Step 4, number 3, followed by the name of your bucket. For example, b2:storage in my case.
Choose whether or not you want to encrypt the file names, selecting 1 does not encrypt file names. Selecting 2 encrypts the file names. I choose 2.
Choose y to type in your own password, choose g to generate a strong password randomly. If you choose g, you are given an option as to how strong of a password you want to generate.
Create a password for the salt. This is recommended if you have chosen to enter your own password in the previous section. Note that forsecurity, these passwords should not be the same.
Select y to accept the configuration.
Note: The rclone config file is not encrypted by default, and Application Keys and your encryption passwords are stored in plaintext. It is recommended to set a password for the config file, and/or ensure the security of the rclone.conf file.
If you need to recover encrypted files from B2, you NEED both passwords (if you set two), otherwise your files will be completely unrecoverable.
Step 4b: Creating the bash script
In this section, we will look at creating the bash script we will use with cron in order to backup any changes to our local storage to B2.
Create a new file in /root, I called mine rclone-cron.sh.
Copy the following:
!/bin/sh if pidof -o %PPID -x 'rclone-cron.sh'; then exit 1 fi echo starting storage sync rclone copy {/path/to/local/storage} {name of your crypt remote}: -v --log-file={/path/to/log/file} --min-age 15m --copy-links exit
Let's break that down a bit and look at what the script actually does:
Backblaze Freenas
#!/bin/sh
Run the script with the sh terminal.
if pidof -o %PPID -x 'rclone-cron.sh'; then
If the script is currently being run, then:
exit 1
Do not run the script currently. This is good if your initial backup will take a while to run, as it won't try to run rclone again.
fi
closes the if statement.
echo start storage sync
print to the terminal that the clone is starting.
rclone copy {/path/to/local/storage} {name of your crypt remote}: -v --log-file={/path/to/log/file} --min-age 15m --copy-links
runs rclone with the
copy
parameter (does not delete files deleted locally, alternatively change copy to sync to keep an exact copy on B2 (deletes files from B2 that are deleted locally).Uses the
-v
flag for verbosity.--log-file={/path/to/log/file}
Tells rclone where to create a log file.--min-age 15m
Tells rclone not to sync files less than 15 minutes old, useful to ensure copied files are probably complete, instead of semi-completed.--copy-links
Tells rclone to follow slinks.exit
exits the script when the copy is finished.
Step 4c: Creating the cron entry
Run
crontab -e
to open the cron editor.Enter
0 1 * * * /root/rclone-cron.sh
This will run the script we created in 4b once a day.
Step 5: Run the script!
chmod +x /root/rclone-cron.sh
makes the script executable
cd /root/ && ./rclone-cron.sh
runs the script.
rclone does not run in the background. It is recommended to run the script in tux or similar, or wait for the crontab to run, as the initial backup will probably take a long time if you have a lot of data like I do.
Freenas Backblaze B2 Encryption
Step 5a: Check B2 console to see if it's working.
- Log into your back blaze account, and take a look at your bucket. You should see that files are being copied to B2.
This completes the guide on setting up rclone to backup to B2 on FreeNAS. Rclone can backup to many cloud providers, have a look at different providers if Backblaze is not your cup of tea.