Raid

McTechSolutions

Dabbler
Joined
Jun 7, 2019
Messages
29
Hi Guys.

I am in the process of getting my system off the ground and just looking for a little guidance on Raidz. I come from a traditional background of RAID levels , 0 , 1 , 5 ,10 etc and know the pros and cons of each type.

I am reading on ZFS and Raidz etc but what i am looking for is some kind of Raid1 = RAIDz? , RAID5 = RAIDz?

In my system that i am building i am installing the OS to a USB key. I then have 5 x 6TB SATA3 drives. Now typically i would have set these up in RAID5 so that i can survive a drive failure. What would be the RAIDz equivalent of this?

Thanks in advance guys. Just trying to learn and understand a little more.
 

Redcoat

MVP
Joined
Feb 18, 2014
Messages
2,925

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I am reading on ZFS and Raidz etc but what i am looking for is some kind of Raid1 = RAIDz? , RAID5 = RAIDz?

RAID1 is functionally the same thing as ZFS mirror vdevs.

People want to invent equivalences between RAIDZ and RAID5/6 but while the goals are similar (better space usage than mirrors), the technical implementation is NOT. RAIDZ1 has "single parity" protection (RAID5), RAIDZ2 "double" (RAID6), RAIDZ3 "triple" (RAID-got-nuthin').

The similarity basically ends there.

RAID5 works by having a parity block for each stripe (like RAID4) but rotating it amongst the component devices (unlike RAID4). You can compute where each parity block is on a RAID5 array.

ZFS doesn't do this at all. Instead, ZFS treats the pool as a bunch of space with the interesting characteristic that there's multiple devices.

Pull up this image in another window.

Now here comes the thing that might break your brain. ZFS writes variable length blocks. It protects the BLOCKS with parity.

For an eight sector sized block, see LBA 0-1, this seems similar to RAID5 (or better yet RAID4) and anyone who's worked with RAID4 will be screaming "BUT WHAT ABOUT THE HOT SPOT THIS MAKES!" -- it doesn't, because ZFS doesn't need to read the parity block prior to writing. The parity is a function of the block being written, not a function of the disk stripe. There is no XOR against "existing" on-disk blocks.

For a single sector sized block, see LBA 3 disks D and E. Writing a ZFS block that is the size of a single sector still requires parity protection. Unfortunately, that works out to be as much space as the data that's being protected.

RAIDZ uses a variable amount of space to store your data.

This has some significant implications on pool design. RAIDZ1 pools are fantastic at storing massive amounts of sequential data, with space efficiency similar to RAID5. RAIDZ1 is not good at protecting small blocks of random data.

If you're going "uhhhh... this raises a lot of questions" don't feel bad. The pros and cons you learned for conventional RAID levels are basically worth almost nothing here in ZFS-land. A whole different set of rules apply.
 

McTechSolutions

Dabbler
Joined
Jun 7, 2019
Messages
29
Thanks for the replies chaps. I am still learning this freenas stuff and trying to soak it all up. I did spin up very basic freenas to try some different setups.
 

Tigersharke

BOfH in User's clothing
Administrator
Moderator
Joined
May 18, 2016
Messages
893
In my system that i am building i am installing the OS to a USB key. I then have 5 x 6TB SATA3 drives.

Prior (significantly older) versions of FreeNAS worked adequately with the boot drive as a USB stick but nowadays it is highly recommended to use some type of SSD instead. An SSD will have considerably better longevity than any USB stick/key. Standard HDD as boot device is fine also.
 

blanchet

Guru
Joined
Apr 17, 2018
Messages
516
If you lack of SATA port for the boot device, a SSD coupled with a USB-to-SATA3 adapter, is a very acceptable solution.
 

McTechSolutions

Dabbler
Joined
Jun 7, 2019
Messages
29
Thanks mate. Do you mean one of them USB SATA / SSD drive enclosures?
 

McTechSolutions

Dabbler
Joined
Jun 7, 2019
Messages
29
I see. Thanks mate. Will keep this is mind
 
Top