Manchineel Posted August 12, 2023 Share Posted August 12, 2023 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? Quote Link to comment
itimpi Posted August 12, 2023 Share Posted August 12, 2023 It is a modified version of the 'md' driver through which all low level reads/writes to the Unraid array are directed. The source for this driver is included in the Unraid distribution under /usr/src 1 Quote Link to comment
primeval_god Posted August 14, 2023 Share Posted August 14, 2023 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. 1 Quote Link to comment
kizer Posted August 16, 2023 Share Posted August 16, 2023 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. Quote Link to comment
Recommended Posts
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.