Replacing disks in array
You may need to replace disks in your array for two main reasons:
- Capacity upgrade: Your storage is nearly full, and you want to use larger disks.
- Failure or retirement: A disk has failed or is no longer supported.
While the process for replacing disks is similar in both cases, be cautious, as there is a risk of data loss during the replacement. Parity devices help protect your data; one parity device can safeguard against a single disk failure, while two can protect against losing data if two disks fail. Always be aware of your protection level during disk replacements.
Upgrading capacity
When upgrading your data drive to a larger one, here are some points to keep in mind:
-
Unmountable disks: Fix any unmountable disks before upgrading. An unmountable status won't be resolved during the rebuild.
-
Single parity risks: If you have single parity, you're at risk of data loss if another drive fails during the upgrade. Seek advice in forums if this happens.
-
Dual parity protection: With dual parity, you're safe from losing data if one drive fails while upgrading a single drive. You can also upgrade two drives at once, but note that this increases the risk since you won't have protection against another drive failing.
-
Backup the old disk: Keep the original disk intact until the upgrade is confirmed successful. This provides a fallback option if anything goes wrong.
Replacing drives always involves some risk. If another drive fails during the upgrade, especially with only single parity, you may experience data loss. Always check the health of your drives before beginning the process, and ensure that you keep the old drive intact until the upgrade is complete and your data is confirmed to be safe.
To upgrade an existing data disk:
- Run a parity check and ensure there are zero errors. If parity isn't valid, rebuilding the disk will corrupt its file system.
- Stop the array.
- Unassign the target disk.
- Start the array. Unraid emulates the missing disk using the existing parity and data disks. You have two modes to choose from:
- Maintenance Mode - Prevents any writes to the emulated disk
- Normal Mode - Allows read/write access to the emulated disk
Starting in Normal Mode is optional. You can use it to verify that the emulated disk mounts and the data looks correct before proceeding.
- Stop the array again.
- Assign the replacement disk to the vacant slot.
- Start the array to begin the rebuild. Unraid rebuilds the contents onto the new disk, and the file system automatically adjusts to the larger disk's capacity.
Replacing failed/disabled disks
What is a failed/disabled disk?
A failed or disabled disk is one that Unraid has stopped using for writing data, usually because it encountered a write error. A failed drive isn't always broken; it might be due to bad connections, power issues, or a temporary glitch.
Indications include a red "X" on the disk indicator and failure notification alerts.
| Failure Scenario | No Parity | Single Parity | Dual Parity |
|---|---|---|---|
| 1 Disk Failure | Data Lost | Rebuildable | Rebuildable |
| 2 Disk Failures | Data Lost | Data Lost | Rebuildable |
- For Single Parity: You can only replace one disk at a time. If another disk fails during the rebuild, you could lose data.
- For Dual Parity: You can replace one or two disks at the same time, but be cautious if more than two disks fail.
If more disks fail than your parity can protect:
- Immediately halt all write operations to prevent further data loss.
- Seek help by posting your issue in the Unraid forums along with diagnostics.
- Do not attempt a rebuild until you've received advice—focus on salvaging your data first.
How to diagnose the issue
Check the syslog and SMART reports:
- If the syslog shows that the drive has reset, there might be a problem with the connection or cables.
- SMART reports can help assess the drive's health, but the best way to check is by running a SMART extended test. If it completes without errors, the drive is likely fine.
- If you see CRC errors, it usually points to issues with the cabling. These errors accumulate over time and don't reset.
To stay informed about drive issues, enable notifications in Unraid by going to Settings → Notification Settings. This way, you're alerted right away if something goes wrong, reducing the risk to your data.
What is emulation?
When a drive is disabled, Unraid uses its parity and other working drives to emulate the failed drive. The system continues to operate, and you can still access the data stored on the emulated drive.
- Unraid stops writing to the physical drive, and any updates are saved in parity and the emulation instead.
- Before replacing the failed drive, you can check and recover data from the emulated drive, which keeps the physical drive intact for potential recovery.
- If you can't access the emulated drive, repairing the file system is essential before any rebuild since fixing the file system is quicker and more effective than a rebuild.
Preparing for drive replacement
Make sure the new drive is at least as large as the failed drive but not larger than your smallest parity drive. If you have to use a larger drive, follow the Parity Swap procedure.
While it's not mandatory, many users choose to pre-clear new drives to test them and help prevent early failure. You can do this with the Preclear plugin, a SMART extended test, or manufacturer tools.
If you try to rebuild using an unmountable emulated drive, the new drive will also become unmountable. Always repair the file system before attempting a rebuild.
To replace and rebuild a disk, follow the size requirements described in the "Preparing for drive replacement" section above.
Before you start, check for any disk errors or warnings. Unraid must be able to read all the remaining disks without any issues for the rebuild to work correctly. If another disk is failing, it could lead to data loss.
- Stop the array.
If your server supports hot-swap, you can skip step 2.
- Power down your server.
- Remove the old, failed disk and install the new disk. Ensure the replacement meets the size requirements described above.
- Power up your server.
- Assign the new disk to the failed disk's slot.
- Check Yes, I want to do this and confirm.
- Optionally select Maintenance Mode to speed up the rebuild (the array won't be accessible during this time).
- Click Start to begin the rebuild. Unraid copies data from the emulated disk to the new disk. If the new disk is larger, Unraid manages the extra space.
If Unraid prompts you to format the new disk during the rebuild, do not do it. Formatting will wipe all data and make recovery impossible.
What to expect during the rebuild
- The array will still be available to use during the rebuilding process (unless you're in Maintenance Mode), but it might run slower.
- Rebuilding can take several hours, depending on your disk sizes and system usage.
- The new disk will have the same file system as the original.
- If the old disk was unmountable due to file system issues, the new disk will also not be mountable. Please fix any file system issues before starting the rebuild.
- The rebuild process won't change the file format of the disk; it simply restores its previous form.
- Always check the health of every disk before you start a rebuild to avoid any potential issues.
Re-enabling a disabled disk (rebuilding onto itself)
Sometimes, a disk may be disabled not because it's actually faulty, but due to issues such as loose cables, power problems, or temporary glitches. If that's the case, you can try to re-enable the disabled disk by rebuilding it onto itself instead of replacing it.
Only use this procedure when:
- The disk was disabled due to external factors (like cables or power issues).
- You've checked the disk's health using SMART reports.
- You've fixed any external problems that caused the disk to be disabled.
- The disk seems to be functioning normally.
- If you are rebuilding a data drive, make sure that the emulated disk shows the right content before you proceed. The rebuild process will ensure that the physical drive matches the emulated one exactly.
- The emulated disk may show as 'unmountable' in some cases. A rebuild will not necessarily fix an unmountable emulated disk, so verify the situation first. If the emulated disk shows 'unmountable' or the content doesn't look right, ask for help in the Unraid forums before proceeding with the rebuild.
- Always run a SMART extended test on the disabled drive to double-check that it's healthy before starting this process.
- If the emulated disk shows any file system issues, use the automated XFS repair feature for XFS‑formatted disks, or the respective file system repair options for other file systems in the WebGUI before beginning the rebuild.
- While the rebuild process should preserve your data, it's a good idea to back up important files if you can.
To re-enable a disabled disk by rebuilding it onto itself:
- Verify disk health by running a SMART extended test and acknowledging any warning icons in the dashboard.
- Stop the array.
- Unassign the disabled disk.
- Start the array so Unraid can register the missing disk. The array displays the disk as "Not installed."
- For data drives only, verify that the emulated disk shows the content you expect.
- Stop the array.
- Reassign the disabled disk to its original slot.
- Optionally select Maintenance Mode to speed up the rebuild process.
- Click Start to begin the rebuild. Unraid takes the contents from the emulated disk and reconstructs them onto the physical drive.
Rebuilding a disk onto itself can take several hours to more than a day for larger drives, depending on the size of the disk and system activity. Factors that can affect rebuild time include drive capacity, disk speed, and system load. You can keep an eye on the progress in the WebGUI.
This procedure works for both data drives and parity drives that have been disabled.
Parity swap
Parity swap is a special procedure used when you need to replace a data disk with a disk that is larger than your current parity disk. The process moves your current parity disk to the data slot, then installs a new, larger disk as the new parity disk. This ensures your array remains protected and allows for larger data drives in the future.
Use a parity swap when your replacement data drive is larger than your current parity disk. This isn't necessary if your new data drive is the same size or smaller than your parity disk.
Example scenario: You have an Unraid setup with a 2TB parity drive and a 1TB data drive and want to replace the 1TB drive with a 4TB drive. First, assign the new 4TB drive as the parity drive, which will replace the 2TB drive. Then move the original 2TB drive to the data slot, and remove the 1TB drive entirely. After these changes, you'll have a 4TB drive as your new parity, ensuring you can add future data drives up to 4TB. The 2TB drive will now hold your existing data, while the 1TB drive can be repurposed. This swap keeps your data secure and your array protected, allowing for future upgrades.
- Before starting, ensure the data drive you want to replace is disabled. Failed drives (showing a red indicator) are already disabled. For healthy drives you want to replace, unassign the drive and start the array once without it to force Unraid to mark it as disabled.
- When your replacement data drive is not larger than your parity drive, use the standard Replacing failed/disabled disks procedure instead.
- This procedure is only needed for replacing data drives in an Unraid array with a disk larger than the current parity drive. For parity drive upgrades only, simply remove the old parity drive, add the new one, and start the array. Parity will rebuild automatically.
- Always verify the health of all drives using SMART reports before starting a parity swap. Attempting this procedure with another failing or unhealthy disk increases the risk of data loss.
- Preclear the new disk if possible. While not required, preclearing stress-tests the drive and reduces the risk of early failure.
- Correctly identify all drives before beginning. Note the model numbers and last four characters of each serial number to avoid mistakes during assignment.
To carry out a parity swap:
If the drive to be replaced is already disabled, you can skip steps 1–4. If you've already installed the new replacement drive, you can skip steps 5–8.
- Stop the array.
- Unassign the old data drive if it's still assigned.
- Start the array. The data drive should now show as "Not installed."
- Stop the array again.
- Power down the server.
If your system supports hot-swap, you don't need to power down. Make sure the array is stopped before making any hardware changes.
- Optionally remove the old drive.
- Install the new drive. Pre-clearing is strongly recommended, but formatting is not needed.
- Power on the server.
- Stop the array if it started automatically.
- Unassign the parity drive.
- Assign the new drive to the parity slot.
- Assign the old parity drive to the data slot of the drive being replaced.
- You should see a Copy button with a message stating "Copy will copy the parity information to the new parity disk."
- Check the confirmation box and click Copy. The array isn't available during this operation, which can take many hours depending on disk size.
- Start the array to begin the data rebuild. You can use the array during the rebuild, but limit usage for best performance. The rebuild process also takes several hours.
Never format a drive during this process. Formatting will erase all data and update parity, making recovery impossible.
After completion, you will have a larger parity disk and a replaced data disk. Many users run a parity check afterward for extra confidence, though this is optional.