Page 1 of 1

Creating RAID ZFS pools with different sized disks in vDev

Posted: 25 Mar 2013 20:31
by PaganGod
I thought I'd provide a post with a solution to a problem I had, and for which I was unable to find the answer in spite of dilligent searching with Google.

Basically, I was creating my second NAS4Free build. The first was just proof of concept with old hardware and using ZFS RAID-Z with 3 PATA disks of 80GB size, which went very smoothly. The new build was going to use a mixture of 6 different sized SATA drives. The plan was to go RAID-Z2 and gradually swap out the smallest disks for larger disks, as I moved data off existing systems onto the NAS4Free system and freed their larger internal disks. This would also give me a lot of experience with resilvering, drive replacement, etc. My boss also liked the minimal investment up-front by using existing unused drives to start out.

No matter what I tried, I was unable to get the ZFS pool created. It returned "Error: The changes could not be applied (error code 1)" every time. The vDev (RAID-Z2) always created without issue. The secret to solving the problem was going to Diagnostics -> Log in the WebGUI. There I saw a message stating that the issue was the disks were different sizes and indicating I could bypass this check by including the -f parameter in the command. I no longer have the original logs (this happened last week and they've been overwritten, at least in the WebGUI) but here is the specific command on my system which was failing:

Code: Select all

zpool create -m /mnt/zPool1 zPool1 raidz2 /dev/ada0.nop /dev/ada1.nop /dev/ada2.nop /dev/ada3.nop /dev/ada4.nop /dev/ada5.nop
Note the .nop extensions are due to using Advanced Format option for 4K sectors and might not be shown in your case. All I did was copied the command, adding the -f parameter:

Code: Select all

zpool create -f -m /mnt/zPool1 zPool1 raidz2 /dev/ada0.nop /dev/ada1.nop /dev/ada2.nop /dev/ada3.nop /dev/ada4.nop /dev/ada5.nop
Then I used the Advanced -> Command option in the WebGUI to issue the command. Then I was able to see the successfully created zPool in the WebGUI and could start putting my datasets on it, and then was able to share them out. Hope this helps someone else.

Re: Creating RAID ZFS pools with different sized disks in vD

Posted: 27 Jun 2013 05:05
by Liquado
Thanks tons for posting this. Combination of this and the wipe.sh command got me up and running, from http://wiki.nas4free.org/doku.php?id=faq:0129 -- it blows me away that this has not been addressed yet in the standard installation commands.

Re: Creating RAID ZFS pools with different sized disks in vD

Posted: 27 Jun 2013 08:53
by raulfg3
-f = force option, is available on WebGUI, no need to use shell if you want.