Re: Cannot add replacement hard drive to mdadm RAID5 array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Artur,

Your answer worked! I just wanted to follow up, so anyone else who has a similar issue can arrive at the solution. Also, I am reporting what I did since it is not exactly as you suggested.

I tried to follow your extra step, but it returned as an invalid number.

I ran with sudo since my user is not root in this case:

printf "%llu\n" -1 > sudo /sys/block/md126/md/resync_start
-bash: printf: /sys/block/md126/md/resync_start: invalid number

So, we assumed that you simply wanted us to edit the resync_start file value to the number 18446744073709551615. I did it by hand using a text editor. After doing so, the value of the file changed to none.

sudo cat /sys/block/md126/md/resync_start
none

After that, I proceeded to reconstruct the array. But I changed the order of the commands. Not sure if that mattered.

sudo mdadm -S /dev/md125
mdadm: stopped /dev/md125

sudo mdadm -a /dev/md127 /dev/sdb
mdadm: added /dev/sdb

sudo mdadm -R --force /dev/md126
mdadm: Started /dev/md/Data with 3 devices (0 new)

Even though it only reported 3 devices (0 new) during the last command's output, it successfully added the new /dev/sdb drive as a spare, started the array resync, and is recovering now as reported by cat /proc/mdstat.

Thank you so much for the assistance!

Devon Beets


From: Artur Paszkiewicz <artur.paszkiewicz@xxxxxxxxx>
Sent: Wednesday, April 7, 2021 4:25 AM
To: Devon Beets <devon@xxxxxxxxxxxxxxxx>; Tkaczyk, Mariusz <mariusz.tkaczyk@xxxxxxxxxxxxxxx>; linux-raid@xxxxxxxxxxxxxxx <linux-raid@xxxxxxxxxxxxxxx>
Cc: Glenn Wikle <gwikle@xxxxxxxxxxxxxxxx>
Subject: Re: Cannot add replacement hard drive to mdadm RAID5 array 
 
On 06.04.2021 22:05, Devon Beets wrote:
> Output of the recommended commands for adding the new disk to the RAID5 array:
> 
> sudo mdadm -R --force /dev/md126
> mdadm: array /dev/md/Data now has 3 devices (0 new)
> 
> sudo mdadm -S /dev/md125
> mdadm: stopped /dev/md125
> 
> sudo mdadm -a /dev/md127 /dev/sdb
> mdadm: added /dev/sdb
> 
> Output of mdstat after running the commands. Shows that both md126 and md127 are inactive, and there is no RAID resync happening.
> 
> cat /proc/mdstat
> Personalities : [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid1] [raid10]
> md126 : inactive sda[2] sdc[1] sdd[0]
>       5567507712 blocks super external:/md127/0
> 
> md127 : inactive sdb[3](S) sdc[2](S) sdd[1](S) sda[0](S)
>       10564 blocks super external:imsm
> 
> unused devices: <none>

It looks like mdadm still does not handle this case correctly. Please do this
before the "mdadm -R --force /dev/md126":

printf "%llu\n" -1 > /sys/block/md126/md/resync_start

Regards,
Artur



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux