All guides
Servers & Hardware

DIY RAID: Array Reliability and Performance

Build a DIY RAID array for high performance and data protection. A detailed breakdown of configurations, component costs, and real-world use cases.

SJslipjar.app 1 September 2026 11 min read 690 views
DIY RAID: Array Reliability and Performance ~/servery
On this page

Building a DIY RAID array allows you to significantly boost disk subsystem performance and ensure data redundancy on a budget starting at 25,000 rubles. This approach is especially relevant for webmasters, sysadmins, and owners of high-load services where downtime or data loss is unacceptable.

TL;DR

  • A DIY RAID array with four 4 TB HDDs in RAID 5 delivers 12 TB of usable capacity and read speeds up to 400 MB/s.
  • Component costs for hardware RAID 5 (LSI SAS2008 controller, 4 HDDs, case, PSU) start at 25,000 rubles.
  • Software RAID (such as mdadm) on Linux offers flexibility and low cost, but can consume up to 15% CPU during heavy write operations.
  • For servers storing critical data, a hardware RAID controller with cache and a BBU is recommended to protect against data loss during power outages.
  • The optimal RAID level depends on your requirements: RAID 0 for maximum speed (no redundancy), RAID 1 for mirroring, and RAID 5 for a balance between capacity and reliability.

What Is a DIY RAID Array and Why Do You Need One?

A DIY RAID array is a storage system assembled from individual hard drives or SSDs using a hardware or software RAID controller. Its primary goal is to increase disk subsystem performance, provide fault tolerance, or combine both. For example, an array of four 4 TB SATA HDDs configured in RAID 5 provides 12 TB of usable storage and read speeds of up to 400 MB/s, far exceeding the capabilities of a single drive.

Choosing Components: Drives, Controllers, and Case

Drives are the foundation of any RAID array. For DIY builds, HDDs are commonly used due to their affordability and high capacity. For instance, 4 TB Western Digital Red Plus drives are available for around 8,000 rubles each. When selecting drives, it is important to consider their recording technology: CMR (Conventional Magnetic Recording) is preferable for RAID due to its consistent performance compared to SMR (Shingled Magnetic Recording), which can suffer severe speed drops during rewrite operations.

A RAID controller can be either hardware-based or software-based. Hardware controllers, such as the LSI SAS2008 (used from 3,000 rubles) or the newer LSI MegaRAID SAS 9260-8i (used from 7,000 rubles), offload processing from the server's CPU and offer advanced features, including a battery-backed cache (BBU). A BBU is critical for RAID 5 and 6 because it preserves data in the controller's cache during a sudden power outage, preventing data loss and array corruption. Software solutions like mdadm on Linux are free, but they consume CPU resources. Under heavy write workloads, software RAID can use up to 15% of a quad-core CPU.

The case and power supply also play a vital role. To house 4–8 drives, you will need a case with enough 3.5-inch drive bays and good airflow. The power supply must provide sufficient wattage and enough SATA power connectors. For example, a 500 W PSU with 6 SATA connectors costs around 3,000–5,000 rubles.

Estimated Component Cost Table for a 4x4 TB HDD RAID 5 Build:

Component Estimated Cost (RUB) Notes
4 TB HDD (4 units) 32,000 Western Digital Red Plus or equivalent
RAID Controller (Hardware) 7,000 LSI MegaRAID SAS 9260-8i (used)
Case 5,000 With 3.5-inch drive bays and good airflow
Power Supply 4,000 500 W, 6 SATA connectors
SATA/SAS Cables 500
Total 48,500

Hardware vs. Software RAID: Performance and Reliability

Choosing between hardware and software RAID is a trade-off between cost, performance, and flexibility. Hardware RAID controllers feature their own dedicated processor and memory, allowing them to handle RAID operations independently of the server's CPU. An LSI MegaRAID SAS 9260-8i controller with 512 MB of cache and a BBU can deliver read/write speeds of up to 500 MB/s for a 4-HDD RAID 5 array while placing virtually zero load on the main CPU.

Software RAID (mdadm), on the other hand, relies entirely on the server's CPU and RAM. Its main advantages are low cost and high configuration flexibility. You can set up an array on any Linux server, such as on reliable VPS hosting. However, during heavy write operations—especially with RAID 5 or 6—CPU usage can reach up to 15%, which may impact the performance of other services running on the same server. For lighter workloads or systems with ample CPU headroom, software RAID is an excellent choice.

Using a hardware RAID controller with a BBU is critical for protecting data integrity in RAID 5/6 setups. Without a BBU, a sudden power outage can cause the loss of data held in the controller's cache and corrupt the entire array, requiring a lengthy recovery process.

RAID Levels: Which One Should You Choose?

Selecting the right RAID level depends directly on your performance, capacity, and fault-tolerance needs:

  • RAID 0 (Striping): Combines drives into a single logical volume, striping data across all drives. Offers maximum performance and capacity, but zero fault tolerance. If a single drive fails, all data is lost. Suitable for temporary data or scratch caches where speed matters more than reliability.
  • RAID 1 (Mirroring): Mirrors data across two drives. Provides excellent fault tolerance (can survive a single drive failure), though usable capacity is limited to the size of the smallest drive. Read speeds can exceed those of a single drive thanks to parallel reads. Ideal for critical OS drives or databases.
  • RAID 5 (Striping with Parity): Stripes both data and parity information across all drives. Requires at least 3 drives and can survive a single drive failure. Offers a solid balance between capacity, performance, and redundancy. With four 4 TB drives, usable capacity is 12 TB, with read speeds up to 400 MB/s and write speeds up to 250 MB/s.
  • RAID 6 (Striping with Dual Parity): Similar to RAID 5, but uses two parity blocks. Requires at least 4 drives and can survive two simultaneous drive failures. Provides even higher fault tolerance, though at the cost of lower usable capacity and slower write performance compared to RAID 5.
  • RAID 10 (RAID 1+0): A combination of RAID 1 and RAID 0. Requires at least 4 drives. Data is first mirrored, and those mirrors are then striped together. Delivers high performance and strong fault tolerance (can withstand one drive failure per mirrored pair). Usable capacity is half of the total raw capacity.

For most home servers and small projects that need a balance between storage capacity and reliability, RAID 5 is the optimal choice. It provides 75% usable capacity out of the total drive space (in a 4-drive setup) along with single-drive fault tolerance.

Counterargument: Hot-Swapping Drives and Its Cost

Many assume that hot-swapping failed drives in a RAID array is a must-have feature, but in practice, that isn't always the case for DIY builds. Hot-swap hardware, such as drive cages with backplanes, can significantly drive up build costs. For example, a 4-bay hot-swap cage can cost anywhere from 7,000 to 15,000 rubles. On a home server or small project where a few minutes—or even an hour—of downtime isn't critical, you can easily skip hot-swap support. Powering down the server to swap a drive takes 10–15 minutes, including reboot time and starting the array rebuild. Saving money on hot-swap hardware lets you put those funds toward higher-quality drives or a RAID controller with a BBU, which improves the overall reliability of the array itself.

For mission-critical systems where every minute of downtime carries a heavy financial cost, hot-swap capability is undoubtedly essential. However, for webmasters hosting a handful of sites or game server owners where brief downtime results in minimal financial loss, it can be an unnecessary expense.

Setting Up Software RAID with mdadm on Linux

Configuring software RAID 5 on Linux using mdadm takes just a few steps. Let's assume you have four drives: /dev/sdb, /dev/sdc, /dev/sdd, and /dev/sde.

1. Create the RAID array:

sudo mdadm --create /dev/md0 --level=5 --raid-devices=4 /dev/sdb /dev/sdc /dev/sdd /dev/sde

This command creates a RAID 5 array out of the four drives. The initialization process can take several hours depending on drive capacity.

2. Check the array status:

cat /proc/mdstat

This will display the synchronization progress of your array.

3. Create a filesystem:

sudo mkfs.ext4 /dev/md0

You can also use another filesystem, such as XFS, for very large storage volumes.

4. Mount the array:

sudo mkdir /mnt/raid
sudo mount /dev/md0 /mnt/raid

5. Add the array to fstab for automatic mounting at boot:

First, retrieve the array's UUID:

sudo blkid /dev/md0

Next, add the following line to /etc/fstab (replace the placeholder with your actual UUID):

UUID=ВАШ_UUID_МАССИВА /mnt/raid ext4 defaults 0 0

6. Save the mdadm configuration:

sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf
sudo update-initramfs -u

This ensures the array is properly assembled every time the system boots.

What We Did Wrong / What Surprised Us

During one of our deployments, we ran into an unexpected bottleneck: using SMR (Shingled Magnetic Recording) drives in a RAID 5 array. Even though the drives were from the same manufacturer and had identical capacities, sustained write performance dropped to single-drive speeds—and sometimes even lower—instead of the expected 200–250 MB/s. Rebuilding the array after replacing a drive took over 24 hours instead of the usual 6–8 hours for 4 TB drives, leaving the system nearly unusable during the process.

The culprit was SMR technology, which increases areal density by partially overlapping data tracks. While this works well for sequential reads and writes, it performs poorly during random writes and overwrites—both of which happen constantly in a RAID array. For RAID setups, it is crucial to use CMR (Conventional Magnetic Recording) drives, which deliver consistent performance across all workloads. The price difference between SMR and CMR drives of the same capacity is minimal (sometimes just 500–1,000 rubles per 4 TB drive), yet the impact on RAID performance and stability is massive.

Actionable Recommendations

  1. Define your requirements first (5–10 minutes, easy): Before buying parts, clearly decide what matters most to you: maximum speed (RAID 0), maximum redundancy (RAID 1), or a balance between capacity and fault tolerance (RAID 5/6/10). Doing this upfront saves time and money when choosing components.
  2. Choose CMR drives for RAID (15–30 minutes of research, easy): Always verify that the drives you buy use CMR, especially for HDDs of 4 TB and above. This prevents severe performance degradation and painfully slow array rebuilds. Cross-check your picks against your RAID controller manufacturer's compatibility list.
  3. Invest in a hardware RAID controller with a BBU for critical data (30–60 minutes to select, moderate): If your data is mission-critical and downtime is unacceptable, a hardware controller with a BBU (Battery Backup Unit) is mandatory. It protects cached data during power outages, easily paying for itself by preventing data corruption. For instance, a used LSI MegaRAID SAS 9260-8i with a BBU can be found for 7,000–10,000 rubles.
  4. Test your array regularly and maintain backups (weekly, 30 minutes, moderate): RAID is not a substitute for backups. Schedule automated array scrubbing to catch errors early, and regularly monitor drive SMART status using tools like smartctl. Store your backups on a separate server—such as a VPS configured as a CDN node—to improve overall resilience.
  5. Plan for future expansion (1–2 hours, moderate): Design your build with scalability in mind. Pick a case with extra drive bays and a RAID controller that supports more drives than you initially plan to install. This will save you from costly hardware replacements down the road when you need more storage.

FAQ Section

How many drives do I need for a DIY RAID array?

The minimum number of drives depends on the RAID level you choose: RAID 0 and RAID 1 require at least 2 drives, RAID 5 requires at least 3 drives, and RAID 6 and RAID 10 require at least 4 drives. For a solid balance of performance, capacity, and redundancy, a 4-drive array (such as RAID 5) is a popular and efficient setup, giving you 12 TB of usable space out of 16 TB total capacity.

Can I use SSDs for a DIY RAID array?

Yes, you can use SSDs in a RAID array to achieve dramatically higher read and write speeds. However, SSDs have a finite number of write cycles, and running RAID 5 or 6 on SSDs can accelerate drive wear due to frequent parity writes. For maximum speed and longevity with SSDs, RAID 0 or RAID 10 is generally preferred. Keep in mind that an SSD array is considerably more expensive: four 4 TB SSDs can start at 60,000 rubles.

Does the RAID controller affect drive speeds?

Yes, the RAID controller has a major impact on array performance. A hardware controller with its own processor and onboard cache (such as the LSI MegaRAID SAS 9260-8i with 512 MB of cache) can deliver aggregate read/write speeds well beyond what a single drive can achieve—for example, reaching up to 400 MB/s read speeds in a 4-HDD RAID 5 setup. Software RAID, by contrast, relies on the host CPU and may experience lower performance under heavy write workloads.

How hard is it to recover data after a drive failure in a DIY RAID array?

Recovering from a single drive failure in RAID 1, 5, 6, or 10 typically involves replacing the failed drive and initiating an array rebuild. With hardware RAID, this is handled through the controller's management utility; with software RAID (mdadm), you run mdadm --manage /dev/md0 --add /dev/sdX. Rebuilding can take anywhere from a few hours to a full day depending on drive capacity and system load. If you use SMR drives, however, the rebuild process can drag on for 24+ hours, as we experienced firsthand with 4 TB SMR drives.

SJ

slipjar.app

Editorial team

The slipjar.app team writes about hosting, servers and infrastructure in plain language.

Was this article helpful?
Servers & Hardware

Read next.

Whole category

New guides every week.

A digest of the best pieces on servers, VPN and self-hosted software. No ads, no spam.

1 email a weekOne-click unsubscribeRU · EN
Only slipjar.app articles, nothing else.