keepcalculator

06 Numbers and Powers

Expand RAID5 Partition: How to Do It Safely

Card No. 06·51454 · Updated · Standard formula, shown below

Average pace 5.00 min/km
Average speed
12.00 km/h
Result
Finish time
50 min
You entered
Distance
10 km
You entered
You enter
Finish time, Distance
You get
Average pace, Average speed
Rounding
2 dp

Yes, you can expand a RAID5 partition, but the process depends on whether you are adding new physical disks to the array or just enlarging the logical volume on top of it. This article explains both scenarios, the exact steps for common systems, and the critical safety checks you must perform before resizing.

Formula

The calculator above is a placeholder for demonstration; the actual content of this page is a technical guide, not a numeric calculator. For RAID5 capacity planning, the relevant formula is:

Usable capacity = (N – 1) × S

Where N is the number of disks in the array and S is the size of the smallest disk (in GB or TB). One disk’s worth of space is always consumed by parity, so a 4-disk RAID5 of 1 TB disks yields 3 TB usable. When you add a fifth disk, the usable capacity becomes 4 TB, but the filesystem on top must be resized separately.

Worked Example

Suppose you have a 4-disk RAID5 array, each disk 1 TB. Usable capacity = (4 – 1) × 1 TB = 3 TB. You add a fifth 1 TB disk and expand the array; the new usable capacity = (5 – 1) × 1 TB = 4 TB. The array now has 1 TB of unallocated space that the partition and filesystem do not yet see. You must grow the partition (e.g., with parted or fdisk) and then grow the filesystem (e.g., resize2fs for ext4, xfs_growfs for XFS). The arithmetic is simple, but the order of operations matters: array first, then partition, then filesystem.

Understanding RAID5 and Its Expansion Limits

RAID5 stripes data and parity across all disks, tolerating the failure of one disk. Unlike RAID0, you cannot simply replace one disk with a larger one and gain space; RAID5’s capacity is tied to the smallest disk and the total number of disks. There are two distinct ways to “expand”:

  • Add a disk to the array – increases the number of disks, thus increasing total capacity by one disk’s worth (minus parity).
  • Replace all disks with larger ones – you must replace and rebuild one disk at a time, then expand the array to use the larger size.

Both methods require the RAID controller or software (mdadm, hardware RAID BIOS) to support online capacity expansion. Most modern controllers do, but older ones may require an offline rebuild.

Expanding a Software RAID5 (mdadm) on Linux

On Linux, software RAID5 is managed with mdadm. The process is well-documented and safe if done carefully:

  1. Add the new disk – Use mdadm --add /dev/md0 /dev/sdX to add a new physical disk to the array.
  2. Grow the array – Use mdadm --grow /dev/md0 --raid-disks=N where N is the new total disk count. This starts a reshape operation that redistributes data; it can take hours depending on disk size and speed.
  3. Wait for reshape to complete – Check progress with cat /proc/mdstat. Do not reboot or interrupt during this phase.
  4. Grow the partition – If the array is a whole disk (e.g., /dev/md0), you may need to create or expand a partition on it using parted or fdisk. If you used the whole device as a filesystem, skip this step.
  5. Grow the filesystem – For ext4, run resize2fs /dev/md0; for XFS, run xfs_growfs /mountpoint. This makes the new space visible to the OS.

Always back up critical data before growing, even though the operation is generally safe. A power failure during reshape can leave the array degraded, though mdadm can usually recover.

Expanding a Hardware RAID5 (Controller BIOS)

Hardware RAID controllers (e.g., from LSI, Adaptec, or Dell PERC) have their own management interfaces. The general steps are:

  1. Insert the new disk into a free slot.
  2. Open the controller utility – During boot, press the key combination (often Ctrl+R or Ctrl+C) to enter the BIOS configuration.
  3. Select the RAID5 virtual disk and choose “Expand” or “Add Drive”.
  4. Follow the prompts – The controller will start a background initialization/reshape. The OS may still be usable, but performance will be degraded.
  5. After completion, extend the partition and filesystem in the OS (e.g., Windows Disk Management or Linux tools).

Some controllers allow expansion while the system is running using vendor-specific tools (e.g., MegaCli or storcli for LSI). Check your controller’s manual for exact commands.

Common Problems and How to Avoid Them

  • Mismatched disk sizes – RAID5 uses the smallest disk for all disks. If you add a 2 TB disk to a 1 TB array, you only gain 1 TB until all disks are at least 2 TB.
  • Filesystem not resized – After growing the array, the partition and filesystem still show old size. You must explicitly grow them.
  • Reshape interruption – A power loss during reshape can leave the array in a degraded state. Use a UPS and avoid rebooting unnecessarily.
  • Partition table limits – If you used MBR (Master Boot Record), partitions are limited to 2 TB. For larger arrays, use GPT (GUID Partition Table).
  • Backup before you start – Even though expansion is routine, a mistake can cause data loss. Always have a current backup.

Hardware RAID vs. Software RAID: Which Is Easier to Expand?

Software RAID (mdadm, ZFS, Storage Spaces) is generally more flexible because you can grow the array with standard commands and often without rebooting. Hardware RAID requires the controller’s proprietary tools and may need a reboot for the BIOS to recognize the new disk. However, hardware RAID offloads parity calculations from the CPU, which can matter on busy servers. For home users and small businesses, software RAID is usually simpler and cheaper. ZFS, for example, allows adding a vdev (a group of disks) but does not allow expanding an existing RAIDZ vdev by adding a single disk; you must add a whole new vdev. This is a key difference to research before choosing a RAID implementation.

Safety and Backup Considerations

Expanding a RAID5 array is a relatively safe operation, but it is not without risk. The reshape process reads and writes all data on the array, which puts stress on every disk. A second disk failure during reshape will cause data loss because RAID5 only tolerates one failure. Therefore:

  • Ensure all disks are healthy (check SMART data) before starting.
  • Have a verified backup of critical data.
  • Monitor the reshape progress and system temperatures.
  • Do not perform other heavy I/O tasks during the reshape to reduce risk.

If you are replacing all disks with larger ones, the process is even riskier: you replace one disk, let it rebuild, then replace the next. Each rebuild takes time and stresses the other disks. Some experts recommend against this for very large arrays due to the increased chance of a second failure during rebuild.

Frequently Asked Questions

Can I expand RAID5 without adding a disk?

No. RAID5 capacity is fixed by the number of disks and the smallest disk size. The only way to get more space is to add a disk or replace existing ones with larger models. You cannot “shrink” or “move” parity to free up space.

Does expanding RAID5 require a reboot?

For software RAID (mdadm), no reboot is needed; you can grow the array while the system is running. For hardware RAID, the controller may require a reboot to recognize a newly inserted disk, but the expansion itself can often be done online after that.

How long does a RAID5 expansion take?

It depends on disk size and speed. A 1 TB array might take several hours; a 10 TB array could take a day or more. The reshape reads and writes all data, so it is I/O-bound. You can check progress with cat /proc/mdstat on Linux.

Can I expand a RAID5 array with a disk larger than the others?

Yes, but you will only gain the size of the smallest disk in the array. For example, adding a 2 TB disk to a 4-disk 1 TB array gives you 1 TB of extra space (since the array treats all disks as 1 TB). To use the full 2 TB, you must replace all other disks with 2 TB disks as well.

What is the difference between expanding the array and expanding the partition?

The array is the RAID device (e.g., /dev/md0). The partition is a logical division of that device (e.g., /dev/md0p1). The filesystem lives on the partition. After expanding the array, you must expand the partition to fill the new space, then expand the filesystem to use it. If you skip the partition step, the OS still sees the old size.

Is it safe to expand RAID5 while the system is running?

Yes, both mdadm and most hardware controllers support online expansion. However, the system will experience reduced performance during the reshape, and there is a small risk of data loss if a disk fails during the process. Always back up first.

Related

Formula used
in t | Finish time | min | 50 | 0
in d | Distance | km | 10 | 0 | 100000
out pace | Average pace | min/km | t / d | 2
out speed | Average speed | km/h | d / (t / 60) | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →