Replicating to an external USB drive for off-site storage

felippe

Dabbler
Joined
Jan 26, 2021
Messages
23
Hello,

I did try to search for a solution before posting this. but couldn't find any - maybe I wasn't using the right search terms. I am sorry if this has been previously discussed. I am new to TrueNAS and still finding my way through all the features.

Currently, apart from the boot disk (120GB SSD) I have only one 2TB SATA drive; I mentioned in another post that a second one is on its way to me. There is one pool - named "data" - with a dataset and a few child datasets. Before adding the second drive to the pool (mirror) I want to make sure my data is safe, so I plugged a 1TB external USB drive to the server. I created another pool- named "usb-backup".

Then I created and run a replication task. Now all my files and folder from the "data" pool are replicated to the "usb-backup" pool on my external USB HDD.

The question is: what is correct procedure to disconnect the external USB drive from the server, to make sure when reconnecting it, I can safely recover my data if anything bad happens when I add the second SATA HDD?

I am asking this because I did a test, which, in my view, failed. After replicating all my data, I powered off the server, disconnected the external USB HDD, replaced a "too long" SATA cable, and powered up the server. After making sure the server is up and running, and I have access to the Web UI, I plugged back the external USB drive. The problem was that the Dashboard was showing the "usb-backup" pool as off-line! I couldn't bring it back online, so I deleted, rebuilt, and run the replication task again.
 

Redcoat

MVP
Joined
Feb 18, 2014
Messages
2,925
The question is: what is correct procedure to disconnect the external USB drive from the server, to make sure when reconnecting it, I can safely recover my data if anything bad happens when I add the second SATA HDD?
Export the pool before pulling the drive. When you put the drive back, import the backup pool.

You don't say what version of FreeNAS/TrueNAS you are using so cannot point you to the manual section that describes this process in detail. The export routine will offer some choices which include one for deleting the exported pool data - be careful not to make that choice for your desired outcome.
 

felippe

Dabbler
Joined
Jan 26, 2021
Messages
23
Thank you, @Redcoat

I did as you explained and disconnected the pool, taking care not to tick the "Destroy data on this pool?" checkbox, but leaving the "Delete configuration of shares that used this pool?" checkbox ticked.

Then I disconnected the USB external HDD and reconnected it. I then added back the pool by importing it; I chose the usb-backup pool which did show in the wizard. It looks like I have successfully backed up my data for safe keeping off-site.

TrueNAS Core version: TrueNAS-12.0-U1.1

Cheers,
 

Redcoat

MVP
Joined
Feb 18, 2014
Messages
2,925
Good, glad you were successful.
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
For basic backup as you are doing, you safely delete the "configuration of shares that used this pool" as well. As to what the system did when you removed the disk without properly Exporting/Disconnecting the pool - that is exactly what the system is supposed to do. An unplanned disconnect is seen by the system as an error.

Anyway, it was a learning experience. Glad it all turned out OK.
 

felippe

Dabbler
Joined
Jan 26, 2021
Messages
23
Yes, everything was fine with the backup. After that, I destroyed and recreated the pool, then restored the data from the backup. For some unknown reason, the restored datasets permissions were reset to "read only" - easily fixed after a quick search here.
 
Top