How to create a RAID-Z2 and add drive later

NightWatcher

Cadet
Joined
Dec 14, 2023
Messages
7
Hi,
I bought 5x 18TB drives, and I plan to set them up in RAID-Z2.
Unfortunately, one of the drives got damaged in shipping. The drive is detected by the system, however once I want to create and format a pool, the operation fails.
I am short on time, and I need to have the system up and running in 2 days, so I can't wait for the RMA.
I know that RAID-Z2 can handle up to 2 drives failure, so I was wondering if there is a way to set up a 5 drives RAID-Z2 pool with 4 drives, and I can just add the replaced drive once it arrives? I thought about placing 5 drives, create the pool then remove one, except I don't have an extra 18TB lying around.
Thoughts?
 

PhilD13

Patron
Joined
Sep 18, 2020
Messages
203
No, you can't setup a 5 drive Z2 with only 4 drives and you can't set up a 4 drive Z2 and later add a 5th drive, as your Pool redundancy would be reduced from z2 to none if you lost that 5th drive down the road as the 5th drive would be added as a 1 drive vdev into the pool. If you have an older or spare drive that is smaller but large enough to work for now until the replacement arrives you could use that as the 5th drive in the z2 array, but you would be limited in space until that 5th drive gets replaced with a 18TB one. It would be a simple matter of correctly replacing the drive from the Truenas GUI with the larger one, then the pool would become the full expected capacity.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
Their is a way, but Here Be Dragons. It is not for the feint of heart. I was unable to find a more current reference, which I am sure exists. But, here is a very old one;

Basically you:
  • Create a fake disk
  • Make your pool with the fake disk
  • Remove the fake disk from the pool
  • Run the pool degraded until you get the RMA disk
Since your pool will be RAID-Z2, with 2 disks of redundancy, it is a reasonable option. Meaning you still have 1 disks worth of redundancy.

While I am 100% sure I can perform this task without problems, I will not answer any questions on it. Nor will I walk anyone through the process.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
While I am 100% sure I can perform this task without problems, I will not answer any questions on it. Nor will I walk anyone through the process.
If you need directions you are not qualified to perform this. Agree, too dangerous to take that sort of responsibility fore somebody else's data.
 

chuck32

Guru
Joined
Jan 14, 2023
Messages
623
I am short on time, and I need to have the system up and running in 2 days, so I can't wait for the RMA.
Opinions may differ on this one, there is a burn in script under resources and also there is another guide about burning in new drives. I always use the latter one. May test the other one some time in the future.

I'd advise you take some time to stability test your system before deployment. One could get away with slamming everything together but I'd rather take a week for CPU, memory and HDD testing before going live.

Albeit very old, here is some advice on creating a degraded pool, that alone threw me off personally from going down that route.
 

PhilD13

Patron
Joined
Sep 18, 2020
Messages
203
Agree with what chuck32 says. You need to not rush the build, and do a proper burn in to test the hardware. I burned in individually the memory, the disks, the cpu's then the burned in the whole system before I accepted it to be my new production storage server.

I know there are procedures out there and videos demonstrating the creation of a fake drive(s) using partitions, etc. but I personally would not go in that direction nor would I recommend anyone that is going to put actual useful data on a system to ever go that way. If it is just for play then go ahead.

You should be able to create a z2 with the 4 disks on hand and use a smaller one for the 5th disk. The capacity initially would be limited to the smallest disk but that disk can be replaced later with the RMA'd disk and capacity increased. This keeps you from running a degraded pool.

Question: Did you not order an extra drive for a cold spare? I always order an extra drive of the same size or larger to keep as a spare. I can replace a failed disk in a couple minutes, and also I have an extra in case one is DOA or fails in testing, when building out a system.
 

chuck32

Guru
Joined
Jan 14, 2023
Messages
623
You should be able to create a z2 with the 4 disks on hand and use a smaller one for the 5th disk. The capacity initially would be limited to the smallest disk but that disk can be replaced later with the RMA'd disk and capacity increased. This keeps you from running a degraded pool.
Good catch!

The need for a spare on a RAIDZ2 is debatable imo. It really depends on how available the data needs to be.
For home use I'd order a spare when the first disk of my array is out of warranty. Before that I could afford waiting a week or two before the system becomes operational again or rather before full redundancy is restored again.
I run mirrored vdevs, for that I use a hot spare.

If it's for a business I'd even go as far as having a warm spare (burned in already) at hand. But as I said, that really comes down to personal preference.

@NightWatcher , just out of curiosity, why the hard timeline?
 

NightWatcher

Cadet
Joined
Dec 14, 2023
Messages
7
The reason why I am short on time is that I am traveling to a remote location for a month, so they don't ship anything there.
So I will have time there to burn in the drive and test everything, I just ran out of time for the RMA drive to arrive, and will add it later.
I did not know I can use a lower capacity drive, that is perfect, thank you so much!
 
Top