ZFS RAIDZ and Adding a HDD

Mike Clements

Gone but not Forgotten
Joined
Oct 31, 2006
Messages
2,049
I just built a new FreeNAS build to replace my old FreeNAS build due to aging HDDs. My old array has degraded and rebuilt a few times recently so I am anxious to get this new build going.

1 of the 4 Hitachi HITACHI Deathstar 5K3000 HHDs I bought is bad and I am in the process of an RMA. I am using the most recent FreeNAS 8.* release build.

My question is, can I build a RAIDZ volume now with the 3 good drives and seamlessly add the 4th when I get a replacement drive? Thanks in advance for any info.
 
You can add the 4th as a SPARE later but you cannot add the 4th to your original 3 drive vdev to expand it. If your target is a 4 drive RAIDZ you have to wait for the 4th drive, or temporarily use some other 2TB drive as a palceholder to create the vdev, then replace that with the hitachi later.
 
I don't think there is a seamless way to do it. 2 options come to mind:

* Build a 3-drive pool now; when the replacement shows up, destroy your existing pool and create a 4-drive pool, then restore your files from backup (you do have a backup, right?). Slow and painful, but simple to do.

* Build a 4 partition pool now on one or two of your drives, then replace each partition with a drive once your 4th arrives. Once you finish migrating to full disks the pool should automatically expand to fill the new space. http://www.freebsddiary.org/zfs-resizing.php documents a similar situation. Also slow and painful, not as simple, but doesn't require an external backup unless something goes wrong (you do have a backup, right? :) ).
 
The original server is still alive and I also backed up everything to spare HDDs. So, I'm backed up as well as I can be. I think I'll just wait and do it right the first time next week since I don't have a 5th 2TB HDD on hand. Newegg set me up for advanced replacement and next day air so I may have it by Monday or Tuesday. I'll keep my fingers crossed until then.

Thanks to all for the info.
 
I misread the OP. I was thinking about mirrored vdevs. No, AFAIK, you cannot add a device to a raidz or any kind.
 
There is one other way to do it, that is make a 4 disk vdev using 3 disks and a file image I belive ( never tried it myself,

ie imagine say you make 4 sparse files of say 20 Meg, you can add these to make a raidz vdev of the 4 20 Meg files yes to make a pool of 60 Meg ...

So now imagine doing the above with 3 drives of 2 tb and a sparse file of 2 tb you get a pool of 6 tb

now you can either do 2 things, run like that till the replacement drive arrives and replace the 2 tb file with the new drive..... Or delete the file and run in degraded mode until it arrives, then replace the file with the 2 tb drive.

I know someone who runs his rpool as a 3 way mirror.... With only 2 drives.... So it runs degraded yes but is still safe because of the other mirrored drive. To make an offsite backup of the rpool he simply plinks in the 3rd drive, onlines it and resilvers the rpool..... Waits till it's finished and removes the drive again. Simple backup done

plenty of different ways around things with zfs
 
A cleaner way to do it nowadays? You have a 2-disk mirror with disk_1 and disk_2. disk_3 is your spare disk. Do this:

zpool attach MYPOOL disk_1 disk_3
(you now have a 3-way mirror - wait for it to resilver)
zpool split MYPOOL XPOOL disk_3
(the above will split disk_3 off as a separate pool)
zpool export XPOOL
(the cloned pool disk is now offline and can be unplugged and plugged into the new machine)
 
Back
Top