Process of replacing a failed drive in a single-drive array? Assuming 100% data loss.

hungarianhc

Patron
Joined
Mar 11, 2014
Messages
234
Hey There,

I know this question might sound stupid. I understand that having a single hard drive means if the drive fails, you lose all the data. However, I'm going to be retooling my system, and I'm going to move to a RAIDZ1 SSD array, and I'd like to have a single 3.5" drive that I use for two purposes: Apple Time Machine and doing ZFS replication from one of my pools on the SSD array to the HDD.

I'm totally okay with the HDD not being redundant, but how does replacing it work, logistically, and where is the metadata stored? Meaning... Let's say I have two datasets on the drive. One is for Apple Time Machine backups, and the other is for backups of my media library. Disk dies. Bummer. I get a new disk... I offline the bad disk, and I pop the new one in. Will it still have the ZFS dataset on it (i.e. will TrueNAS create it), and will there still be an SMB share on the dataset, and will the ZFS replication for the media backup continue to work?

This is literally going to be a 4th copy of my data (i have two offsite backups), so I'm okay with the downtime / risk of data loss, but there's an operational recovery aspect I want to make sure I understand. If I have to recreate datasets, re-point the SMB share to the new dataset, update the ZFS replication task, etc, that'll be a pain tin the butt. Thanks!
 

Saoshen

Dabbler
Joined
Oct 13, 2023
Messages
47
I am no expert and I certainly don't know the innate details of zfs's workings.

That said, unless I am misunderstanding, if you just want to remove the disk, what you want to do instead, is EXPORT the single disk. NOT offline it.

This will allow you to re-import it at a later date with all data intact, as like an offline backup.

If the single disk array is truly bad, then you lose everything on it. Everything zfs needs for the pool is stored on the disk(s) involved.

Adding a replacement disk, is just like initiating a new disk. You would have to (re)create a pool on it, create any datasets, setup the permissions, fix or redo any jobs that pointed to the old disk/datasets.

If you want to have alternating offsite backups on multiple single disk pools, export/import is what you want. Each disk will still be its own independent setup of pool/datasets/etc. But you won't have to recreate it multiple times, just export the current disk/pool, remove disk, add other disk, import it.

as far as shares and tasks, I believe those will be based on the pools/datasets for each specific disk. but I have not done any testing or validation of that.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
If the drive is not completely dead, you can replace it with another through the GUI--plug in the new drive, then go to Storage, Manage Devices for your pool, click on the disk, Replace. Select the new one in the pop-up window and you're good to go--it will copy over all the data to the new disk, and offline the old one when complete.

If the disk is completely dead, though, everything on it is gone--data, datasets, permissions, metadata, etc. And since the pool is gone, any shares that referred to it won't work any more.

tl;dr: make sure SMART email reporting is working, and replace the drive as soon as you start seeing issues.
 
Top