How is Unraid parity implemented?


Manchineel

Recommended Posts

Question as per title.

 

I've been using Unraid for years and I'm familiar with the XOR-based (parity 1) and the Reed-Solomon Code (parity 2) approaches to parity. While I therefore do know what Unraid ends up storing on the parity drive(s), I've been asking myself: how does Unraid update parity in real-time—what is the magic sauce?

 

It appears that parity is always updated when writing to Unraid array disks, whether I'm accessing them through a user share (`/mnt/user/`) or by accessing the XFS-mounted filesystem directly (/mnt/disk1, /mnt/disk2 etc.).

 

Additionally, how can Unraid instantly pick up all new FS reads/writes and suddenly start redirecting them to the emulated disk hosted by Unraid in the event of a drive failure, without breaking currently running apps, existing file handles etc.?

 

Is it a modification of the XFS/BTRFS/ZFS/ReFS drivers within the Linux kernel employed by Unraid? (If so, supposedly LimeTech will have published the source somewhere to comply with GPL-2)? Is it something in the userspace (and if so, how can it capture such low-level block device events)? Or is there some Linux utility to create a virtual partition/disk (at the block level) and insert additional software interrupts on access events while relaying the operations to an upstream block device?

Link to comment

Also worth noting that the special sauce of unraid isnt really doing the parity in real time, that is what the linux md subsystem does normally. The special unRaid part is dedicated parity disks for raid 5 and 6 (rather than the more common distributed raid 5 and 6) and the lack of block level striping so that each disk has an independent file system.

  • Like 1
Link to comment

I just look at it as in my case with 7 total drives 1 + 1 + 1 + 1 + 1 + 1 = 6

When a drive is lost it knows that 1 + 1 + ? + 1 + 1 + 1 = 6 so it slots in 1 during the rebuild. 

 

Sure its way more complicated than that, but I like to think simple and let the powers that be worry about how much Mayo is added to the Special Sauce. 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.