The Hardware RAID Trap
If you've managed a storage server in the last two decades, you are intimately familiar with hardware RAID. You buy a PCIe card, plug 8 to 24 hard drives into it, and configure it as RAID 6. The operating system just sees a single, massive logical drive (e.g., /dev/sdb).
The problem arises when things break. Hardware RAID arrays are tied to the proprietary silicon that created them. If your LSI or Broadcom RAID card dies, you can't just plug those drives into your motherboard—you have to source the exact same RAID card with the exact same firmware revision, or you lose the entire array. Furthermore, rebuild times on modern 20TB+ hard drives can take days, during which the array is vulnerable and agonizingly slow.
Rigid & Proprietary
Data protection is handled by a locked black-box silicon chip. If the chip dies, the data is unreadable by standard operating systems. Rebuilds require scanning every single sector of the physical disks sequentially.
Fluid & Portable
Data protection is handled by open-source math (Reed-Solomon) executed by the CPU. The hard drives can be moved to any machine, anywhere. Rebuilds only recalculate the specific files that were lost, not empty drive space.
For an active archive like HuskHoard, where data might sit untouched for months but needs to be perfectly intact for decades, being locked to a specific PCIe controller is a massive operational liability. We needed a better way.
Reed-Solomon and the Magic of 4+2
Instead of hardware RAID, the Husk Enterprise Sidecar utilizes Software-Defined Erasure Coding (EC), specifically using Reed-Solomon math operating in a Galois Field (2^8). This is the exact same mathematics used to ensure data arrives safely from deep space probes.
By default, Husk configures its EC Pools (or "Cells") in a 4+2 layout. This means we have DATA_SHARDS = 4 and PARITY_SHARDS = 2. When the Husk Core sends a stream of data to the Sidecar, it doesn't write it to disk immediately. It holds the data in RAM until it has a full 4-Megabyte chunk, known as a Stripe.
It chops that 4MB into four 1MB data shards. Then, the Reed-Solomon engine calculates two additional 1MB parity shards. We now have 6 total shards.
The mathematical magic of Reed-Solomon is that any 4 of those 6 shards can perfectly reconstruct the original 4MB stripe. You can lose drive 1 and drive 2. You can lose drive 3 and drive 6. It doesn't matter. As long as 4 shards exist, the CPU can solve the polynomial equations and rebuild the missing bytes on the fly in milliseconds.
Bypassing the Kernel: O_DIRECT & Crossbeam
Math is great, but getting it onto physical rust-and-platter hard drives quickly requires bypassing the operating system's standard behaviors. Normally, when you write a file in Linux, the OS buffers it in the "Page Cache" in RAM, writing it to disk whenever it feels like it. For a 10KB text file, this is great. For a 2TB ProRes video archive, this destroys system memory and causes massive I/O bottlenecks.
The Husk Sidecar circumvents this entirely. When it writes the 6 shards to the 6 drives in the Cell, it uses a system flag called O_DIRECT. This tells the Linux kernel: "Do not cache this. Send these exact bytes directly to the physical disk controller right now."
crossbeam::scope to prevent bottlenecking.By using Rust's fearless concurrency via crossbeam::scope, all 6 drives write their 1MB chunks in parallel. Since the write bandwidth of a modern HDD is about 250MB/s, a 6-drive Husk Cell can comfortably ingest archive data at over 1,000 MB/s—saturating a 10GbE network link without ever touching the OS page cache.
Green IT: Spindle Power Management
Because the Sidecar operates directly on the block devices (e.g., /dev/sda) rather than relying on a dumb RAID controller, it knows exactly when the drives are being used and when they aren't. In a massive petabyte-scale archive, 90% of your data will not be read on any given day.
If you leave thousands of hard drives spinning 24/7, you burn an exorbitant amount of electricity, generate massive heat (requiring more AC), and drastically reduce the mechanical lifespan of the drive bearings. Husk solves this with the Spindle Manager.
last_accessed timestamp in RAM for every EC Cell. An asynchronous background loop checks this every 30 seconds. If a Cell hasn't been touched in 600 seconds (10 minutes), it takes action.STANDBY command directly to the 6 drives in the idle Cell. The physical disks stop spinning, dropping power consumption per drive from ~8 watts down to ~1 watt.WAKE_VOLUME event. The Sidecar catches it, spins the 6 drives back up, and serves the data. The user just experiences a brief ~8-second delay.The "Virtual Tape" Abstraction
To keep the system architecture clean, the core Husk daemon doesn't actually know how Erasure Coding works. The core engine is built to write streams of data to LTO Tape drives. It expects to stream data linearly to a destination and catalog it.
We used this existing architecture to our advantage. To the Husk Core, a 6-drive EC array isn't a hard drive array at all—it's just a "Virtual Tape."
VIRTUAL_EC_POOL_1 at offset 0."EC_WRITE event. It looks up VIRTUAL_EC_POOL_1 in its state lock and realizes it maps to physical drives sda through sdf.offset / DATA_SHARDS), runs the math, and commits the write.Why We Built It in the Sidecar
By moving the heavy lifting of Erasure Coding out of the core daemon and into the Rust sidecar, we created a strict separation of concerns. If the Sidecar panics because a drive completely locked up the SCSI bus, the main Husk daemon keeps running, continuing to serve files from SSD cache and active tape drives.
Furthermore, because the Sidecar is built asynchronously on top of the Tokio runtime, holding a lock to calculate Reed-Solomon math on one EC Cell doesn't block another thread from spinning up an idle Cell or serving a Prometheus telemetry request on the HTTP port.
Because the math is entirely open-source, if you ever decide to stop using HuskHoard, you don't lose your data. A simple open-source Python script could read the 6 raw shards from the block devices and decode the Reed-Solomon equations to reconstruct your archive files. Try doing that with a dead hardware RAID controller.
Storage shouldn't rely on brittle metal and proprietary silicon. By replacing hardware RAID with intelligent, software-defined math, the Husk Enterprise Sidecar makes massive disk archives faster, greener, and ultimately, immortal.