r/HomeServer • u/Narutobi_Sensei • Jan 26 '24
How does RAID 5 work exactly?
Please explain RAID 5 for me. How can 1 disk store 3 disks worth of data? and lets say an entire drive doesn't fail, but some files go corrupt as time passes. Will RAID 5 protect against this? Will it tell me if one of my files corrupts? And is there a way to rebuild individual files without rebuilding the entire array? I am planning on integrating 6 large hard drives into my windows 10 PC. It has an Asus Maximus X Formula motherboard that supports RAID 5, though I don't know exactly how that works. Thank you
4
u/LittlebitsDK Jan 26 '24
"how does RAID 5 work"
click search or press ENTER
plenty lovely videos about it explain how raids work
3
u/PuerAeternis Oct 25 '24
I came here from a Google search.
Thank you for letting me know I could just google it. Boy, do I feel stupid right about now!
0
Mar 13 '25
[deleted]
1
u/fake-ons Jan 07 '26
I haven’t had that issue yet, but I imagine it feels like the reaction meme of coralline’s dad, exhausted in front of his desktop
1
u/picturelife Nov 03 '25
You know what? I googled "how does RAID 5 work" and it brought me here. Thanks for adding this into the archive OP!
1
1
u/--Spaci-- Jan 26 '26
The first guys explanation was the google result and a good one at that, boy I bet you feel stupid 2 years later
-21
u/Narutobi_Sensei Jan 26 '24
wow didn't think of that. Thanks for your insight redditor
4
u/TheMartok Jan 26 '24
Yet here you are lol
1
u/chicknfly P200A 5600G RAIDZ2 6x8TB NAS + Proxmox on Optiplex Jan 27 '24
Perhaps I'm reading into this too hard, but I'm willing to bet OP did that and the videos don't click in a way they understand.
1
u/LittlebitsDK Jan 27 '24
there are MANY of them... if not one of em "clicks" why would you think a short text msg on here would click? when videos are full of lovely visuals and long explanations?
1
u/chicknfly P200A 5600G RAIDZ2 6x8TB NAS + Proxmox on Optiplex Jan 27 '24
All I know is I have read about Voronoi diagrams. I have watched all sorts of videos showing it. I have seen pseudocode of creating the diagram. Yet, to this day, I still have no idea how to write code to make a Voronoi diagram. I’m not saying OP is struggling in that way, but it’s always possible.
1
0
u/guaranteednotabot Jun 23 '25
None of the explanations I found explained it as well as the top comment here. You are no different to those StackOverflow snobs
8
u/MrB2891 unRAID all the things / Core Ultra 7 265k / 25 disks / 300TB Jan 27 '24 edited Jan 27 '24
Don't bother with RAID5 these days.
If you have dozens or hundreds of users and need the high IOPS and bandwidth of a striped parity array, RAIDz1 or RAIDz2.
If you're a home user that is looking for large storage capacity on home user budgets that still had one or two disk redundancy, Unraid.
As far as 'how', read up on 'XOR parity'. That is how RAID5 (and Unraid with single disk parity) works. RAID6 (and Unraid two disk parity) uses Reed-Solomon if you want to read up on that as well.
3
u/duoschmeg Jan 26 '24
Search G for multi TB drives in raid 5 rebuild time. In short, rebuild will fail and you will loose data.
3
2
Jan 27 '24
Redundancy is achieved through striped parity. The data of any given disk is striped amongst the rest.
Protecting against data degradation (bitrot) isn’t something that RAID does. But it is a feature of ZFS, and you can run RAIDz vdevs In ZFS.
1
u/Pvt-Snafu Feb 02 '24
RAID won't protect against file corruption. That's the job of a file system. Same goes for write hole. For this, you need a file system with checksumming like ZFS or ReFS. Also, I would never use RAID on a motherboard which is essentially a fake RAID: https://skrypuch.com/raid/ Either go for a hardware RAID or software RAID (Linux MDRAID/Storage Spaces/ZFS).
0
u/IHaveTeaForDinner Jan 26 '24
RAID does not prevent corruption. The controller writes whatever its told to the disks, garbage or no garbage. It doesn't understand what it's writing either, could be files, could be raw sectors.
It doesn't write 3 disks worth of data it stripes checksums of the data across the array. In very simple terms, if you have the sum 1+2 =3. Store the 1 on drive 1, 2 on drive 2 and the three on drive 3. If drive 2 fails you have to compute 1 + x = 3, which is easy it's 2.
0
0
-3
Jan 26 '24
How can 1 disk store 3 disks worth of data?
Poorly with most hardware implementations and with the Windows Server implementation. I recommend using btrfs or ZFS (port coming to windows) to avoid nightmare resilvering scenarios.
88
u/skreak Jan 26 '24
I'll keep it brief - say you have 5x disks in a raid 5, you get 4x disks of usable space and can lose any one disk. It uses XOR logic for the parity disk, think it like - a sum of numbers - instead of disks you had 4 numbers you wanted to write - 8, 3, 6, 1 on 4 pieces of paper and on a fifth paper you wrote the number 18 which is the sum of the 4 numbers. You could blindly throw away one of those 5 pieces of paper and be able to figure out what number was stored on it later - e.g. 8 + 3 + x + 1 = 18. Finding X is easy. Raid5 allows for a _single_ disk in your group to fail but no more than 1 because, like my analogy, if you lost 2 piece of paper - x + 3 + y + 1 = 18 is not solvable.