TrueNASTrueNAS Nightly Development Documentation
This content follows experimental nightly development software. Pre-release software is intended for testing purposes only.
Use the Product and Version selectors above to view content specific to a stable software release.

Replacing Disks

Hard drives and solid-state drives (SSDs) have a finite lifetime and can fail unexpectedly. When a disk fails in a Stripe (RAID0) pool, you must recreate the entire pool and restore all data backups. We always recommend creating non-stripe storage pools that have disk redundancy.

To prevent further redundancy loss or eventual data loss, always replace a failed disk as soon as possible! TrueNAS integrates new disks into a pool to restore it to full functionality.

TrueNAS requires you to replace a disk with another disk of the same or greater capacity as a failed disk. You must install the disk in the TrueNAS system. It should not be part of an existing storage pool. TrueNAS wipes the data on the replacement disk as part of the process.

Disk replacement automatically triggers a pool resilver.

Replacing a Failed Disk

If you configure your main TrueNAS Dashboard to include individual Pool or the Storage widgets they show the status of your system pools as on or offline, degraded, or in an error condition.

Main Dashboard Pool and Storage Widgets Degraded
Figure 1: Main Dashboard Pool and Storage Widgets Degraded

The Storage Dashboard pool widgets also show the status of each of your pools.

Storage Pool Widgets in Degraded State
Figure 2: Storage Pool Widgets in Degraded State

From the main Dashboard, you can click the on either the Pool or Storage widget or you can click Storage on the main navigation menu to open the Storage Dashboard screen and locate the pool in the degraded state.

My disk is faulted. Should I replace it? If a disk shows a faulted state, TrueNAS has detected an issue with that disk and you should replace it.
Can I use a disk that is failing but still active?

There are situations where you can leave a disk that has not completely failed online to provide additional redundancy during the replacement procedure.

We do not recommend leaving failed disks online unless you know the exact condition of the failing disk.

Attempting to replace a heavily degraded disk without off-lining it significantly slows down the replacement process.

To replace a disk in a pool without a hot spare available:

  1. Take the disk offline.
  2. Replace the disk.
  3. Refresh the screen.

To replace a disk in a pool with a hot spare:

  1. Take the disk offline.
  2. Detach the failed disk to promote the hot spare.
  3. Refresh the screen.
  4. Recreate the hot spare VDEV.

Taking a Failed Disk Offline

We recommend users off-line a disk before starting the physical disk replacement. Off-lining a disk removes the device from the pool and can prevent swap issues. To offline a disk:

Go to the Storage Dashboard and click Manage Devices on the Topology widget for the degraded pool to open the Devices screen for that pool. Click next to the VDEV to expand it, then look for the disk with the REMOVED status.

Devices Disk Failed
Figure 3: Devices Disk Failed

Click on the failed disk, then click Offline in the ZFS Info widget to take the disk offline. The disk status changes to OFFLINE.

The offline failed?

If the off-line operation fails with a Disk offline failed - no valid replicas message, go to Storage Dashboard and click Scrub on the ZFS Health widget for the pool with the degraded disk. The Scrub Pool confirmation dialog opens. Select Confirm and then click Start Scrub.

When the scrub operation finishes, return to the Devices screen, expand the VDEV, then click the disk, and try to off-line it again.

Replacing a Failed Disk

If you are replacing the failed disk you took offline and removed, insert the replacement disk now. The new disk must have the same or greater capacity as the failed disk. If replacing a failed disk with an available disk in the system, proceed to the next step.

Click Replace on the Disk Info widget on the Devices screen for the disk you off-lined.

Select the new drive from the Member Disk dropdown list on the Replacing disk dialog.

Replacing Disk Dialog
Figure 5: Replacing Disk Dialog

Click Replace Disk to add the new disk to the VDEV and bring it online.

Disk replacement fails when the selected disk has partitions or data present. To destroy any data on the replacement disk and allow the replacement to continue, select the Force option.

Replacing Disk Status
Figure 6: Replacing Disk Status

When the disk wipe completes, TrueNAS starts replacing the failed disk. TrueNAS resilvers the pool during the replacement process. For pools with large amounts of data, this can take a long time. When the resilver process completes, the pool status returns to Online on the Devices screen.

Replacing a Failed Disk with a Hot Spare

A Hot Spare vdev sets up drives as reserved to prevent larger pool and data loss scenarios. TrueNAS automatically inserts an available hot spare into a Data vdev when an active drive fails. TrueNAS resilvers the pool after the hot spare is activated.

To replace a disk in a pool with a hot spare:

  1. Take the disk offline.
  2. Detach the failed disk to promote the hot spare.
  3. Refresh the screen.
  4. Recreate the hot spare VDEV.

Detaching a Failed Disk

Go to the Storage Dashboard and click Manage Devices on the Topology widget for the degraded pool to open the Devices screen for that pool. Click next to the VDEV to expand it, then look for the disk with the REMOVED status.

Devices Disk Failed - Hot Spare Active
Figure 7: Devices Disk Failed - Hot Spare Active

Click Detach on the ZFS Info widget on the Devices screen for the disk you off-lined.

Select Confirm, then click Detach. TrueNAS detaches the disk from the pool and promotes the hot spare disk to a full member of the pool.

Recreating the Hot Spare

After promoting the hot spare, recreate the Spare vdev and assign a disk to it.

Do I really need to promote the hot spare and then recreate the spare vdev?

If you have a hot spare inserted into the pool and then follow the instructions in Replacing a Failed Disk, TrueNAS automatically returns the hot spare disk to the existing Spare vdev and ONLINE status.

However, we do not recommend this method, because it causes two resilver events: one when activating the hot spare and again when replacing the failed disk. Resilvering degrades system performance until completed and causes unnecessary strain on the disk.

To avoid unnecessary resilvers, promote the hot spare then recreate the hot spare vdev.

If recreating the spare with a replacement in place of the failed disk, insert the replacement disk now. The new disk must have the same or greater capacity as the failed disk. If recreating the spare with an available disk in the system, proceed to the next step.

Go to the Storage Dashboard and click Manage Devices on the Topology widget for the degraded pool to open the Devices screen for that pool.

Click Add VDEV to open the Add Vdevs to Pool screen.

Click the Spare (Optional) row to expand it.

Add Vdev Spare
Figure 8: Add Vdev Spare

Select a disk size equal to or greater than the failed disk or click Manual Disk Selection to choose the replacement disk. Click Save And Go To Review.

Review Screen
Figure 9: Review Screen

Review changes then click Update Pool. Select Confirm, then click Continue.

After completing the job, TrueNAS returns to the Storage Dashboard screen. Review Spare VDEVs on the Topology widget to confirm the hot spare is added.