ZimaOS - RAID Recovery Issue

Relatively new to RAIDS.

I have 5 4TB HDDs in a RAID 5 configuration (total of 16TB). I had one of my drives fail. I replaced the failed drive with another 4TB HDD and used ZiimaOS’ recovery function. Overall pretty straightforward: connect new drive, enable it, then press the red ‘Start’ button on the ‘Recover RAID’ banner.

Issue came up when it completed the recovery. It seems like instead of replacing the old drive with a new one, it added it to the RAID. Expanding the RAID to 6 drives, with the 6th drive being nonexistent. When looking at the RAID under ZimaOS’ Setting/Storage/RAID, it lists all the disks part of the RAID, but shows the new drive twice along with a total of 20TB storage space.

I went into the SSH and checked lsblk. Everything looks correct (5 drives in RAID plus OS drive).

I then checked the RAID’s details on mdadm and that’s where its lists 6 RAID Devices with a drive as shown ‘removed’.

Being relatively new to this, I would like some help on how to remove that drive from the RAID and have the storage brought back down to 16TB. If it’s too risky, I can add a real 6th drive to the RAID, I just don’t want to lose my data.

Any and all help is appreciated! Thanks!

Thank you for your feedback and for providing the RAID information.

Based on the current mdadm --detail output, the array appears to have been reshaped from the original five-device RAID5 into a six-device RAID5. The RAID metadata now defines six member slots, but only five drives are currently active, with the sixth slot marked as removed. This explains why the array now reports approximately 20 TB of capacity and is in a clean, degraded state.

Our initial assessment is that, during the recovery process, the original failed drive may not have been correctly identified as a failed or missing RAID member, or the recovery workflow may have incorrectly treated the replacement drive as an additional member. As a result, the system may have triggered a RAID expansion/reshape instead of replacing and rebuilding the failed member.

However, we need to review the storage logs before we can confirm the exact cause. Could you please run the following command through SSH?

curl -fsSL https://get.casaos.io/diskinfo.sh | sudo bash

After the command finishes, please open the Files app, locate the generated diskinfo.log file, and send it to:

rally@icewhale.org

If possible, please also let us know the approximate date and time when you started the RAID recovery. This will help us locate the relevant log entries more quickly.

In the meantime, please do not perform any additional RAID grow, remove, create, or other disk-management operations. Since the array is currently degraded, it cannot tolerate another member drive failure. We therefore strongly recommend backing up all important data as soon as possible.

Once we have received and reviewed the logs, we will continue assisting you with the RAID recovery. Based on the information currently available, the lower-risk solution may be to prepare another drive whose usable capacity is equal to or greater than that of the existing RAID members, add it to the missing sixth slot, and allow the array to rebuild.

Please note that the RAID metadata already defines the array as a six-device RAID5. Therefore, the additional drive would be used to complete and rebuild the existing six-device layout, rather than expand the RAID again. We will provide the specific next steps after reviewing the logs and confirming the current RAID and filesystem state.

Hi, you can try to recover the RAID by following the steps below

  1. Insert a new hard drive. Its capacity should be at least as large as the RAID member drive being replaced.

  2. Run the following command in the terminal to identify the device path of the new drive (sdX) and the RAID device (mdX):

    lsblk -f
    
  3. After confirming that the device paths are correct, run the following command to add the new drive to the RAID array:

    mdadm --add /dev/mdX /dev/sdX
    

    Replace /dev/mdX and /dev/sdX with the actual paths identified in step 2. For example:

    mdadm --add /dev/md0 /dev/sdc
    
  4. Run the following command to check the RAID recovery progress:

    mdadm -D /dev/mdX
    
  5. After the RAID recovery has completed, run the following command to initialize the local storage service:

    zimaos-local-storage -init
    

Before running step 3, carefully verify the device paths. Make sure that /dev/sdX is the newly inserted empty drive, not an existing RAID member drive or a drive containing important data. The images below are for reference only.


Success!

The new drive has been added and replaced the ‘removed’ drive. After following all the steps, I restarted the machine to remove the ‘read-only’ banner it had on the GUI.

Thank you for your help!