Clone disk of a stripe zvol

natx666

Cadet
Joined
Mar 7, 2022
Messages
2
Hi, I currently have a pool with 4 8TB disks in stripe mode, I know it's not ideal, but it's just for keeping some movies and music, so nothing really important in there. My question is, now that one of the drives is starting to give bad SMART reports, can I set the disk to offline, clone the disk to another drive of the same size, swap it with the new one and put it online again?

Thanks for the help.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
You have 2 options:
  1. Use the "replace in place"
  2. Use the GUI to remove the disk, (go from 4 x 8TB to 3 x 8TB).
Both assume your existing disk is capable of being read for the blocks in use.

The second assumes you have both enough free space to allow the removal. And that you want to stay at 3 x 8TB disks.

Even if the disk to remove has some errors, you would be able to recover all the other files. Then ask ZFS which files needed to be restored from backup.



In general, cloning a disk outside of ZFS does not work. The exception is if you shutdown your server / pool gracefully and then clone the disk. The new clone still may not work because the serial number won't match.

But, if you were trying a last resort recovery, with a backup clone of your pool's disks, you can copy them back to the real disks if you make a mistake in recovery. Then retry the recovery.
 

natx666

Cadet
Joined
Mar 7, 2022
Messages
2
Thanks for the explanation. I think I'll try the first option as I have enough free space to give it a shot.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
Thanks for the explanation. I think I'll try the first option as I have enough free space to give it a shot.
The first option basically replaces the existing disk with another of equal or larger size. Then, when the re-silver is complete, the existing disk is automatically removed from the pool. So the amount of free space is irrelevant, as it remains the same.

So I am guessing you mis-understood what I meant for option 1.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Use the GUI to remove the disk, (go from 4 x 8TB to 3 x 8TB).
I don't think this is an option for a striped pool. ZFS will allow it, but I don't think the GUI will.
 
Top