cannot remove mistakenly added md spare drive

874 views
Skip to first unread message

T. Sch.

unread,
Sep 14, 2021, 12:12:57 PM9/14/21
to esos-users
Dear Marc,

BIG Problem, because the added spare drive contains data AND is the md block device itself!

Want to remove this spare drive without loosing data on it.
6       9      127        -      faulty   /dev/md/NAS02.ad.fxxxxxxx.de:array1

[root@NAS02 ~]# mdadm -D /dev/md127
/dev/md127:
        Version : 1.2
  Creation Time : Sat Mar  9 17:19:08 2019
     Raid Level : raid5
     Array Size : 5860150464 (5588.67 GiB 6000.79 GB)
  Used Dev Size : 1953383488 (1862.89 GiB 2000.26 GB)
   Raid Devices : 4
  Total Devices : 6
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

    Update Time : Tue Sep 14 16:50:04 2021
          State : active, resyncing (PENDING)
 Active Devices : 4
Working Devices : 5
 Failed Devices : 1
  Spare Devices : 1

         Layout : left-symmetric
     Chunk Size : 64K

           Name : NAS02.ad.fxxxxxxx.de:array1  (local to host NAS02.ad.fxxxxxxx.de)
           UUID : 170e51f2:519e46b7:486cebcb:d8bf553a
         Events : 3726

    Number   Major   Minor   RaidDevice State
       0       8       48        0      active sync   /dev/sdd
       1       8       16        1      active sync   /dev/sdb
       2       8       32        2      active sync   /dev/sdc
       4       8        0        3      active sync   /dev/sda

       5       8       64        -      spare   /dev/sde
       6       9      127        -      faulty   /dev/md/NAS02.ad.fxxxxxxx.de:array1

Is there any way out? It is (of course) very urgent for the customer.
I don't even know where to or how to start.

I hope so much for your help
greets Thomas

T. Sch.

unread,
Sep 14, 2021, 12:22:34 PM9/14/21
to esos-users
- I set the " faulty   " state manually by using mdadm
- also tried to remove the device by using "Software RAID" -> "Remove Device"
 but nothing happens (GUI "hangs" / does not respond any more...)
 this was the way I added the device inadvertently before

Marc Smith

unread,
Sep 17, 2021, 10:34:54 AM9/17/21
to esos-...@googlegroups.com
If the device is marked as a "spare" then why can't it be removed? The
array is operational on the other devices?
If so, you should be able to remove the spare device like this: mdadm
/dev/mdXXX --remove /dev/SPARE

Of course replacing 'mdXXX' with the array block device and 'SPARE'
with the spare device.

--Marc
> --
> You received this message because you are subscribed to the Google Groups "esos-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to esos-users+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/esos-users/b632470a-1639-464d-823a-e81951cec568n%40googlegroups.com.

T. Sch.

unread,
Sep 20, 2021, 3:12:34 AM9/20/21
to esos-users
yes, that is exactly my question " If the device is marked as a "spare" then why can't it be removed?  ".

I just tried this command:
mdadm /dev/md127 --remove /dev/md/NAS02.ad.fxxxxxxx.de\:array1
 and nothing happens over hours / days. I can only stop this command by pressing Ctrl+C.

May be this is blocking the remove?:
[root@NAS02 ~]# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]
md127 : active raid5 md127[6](S) sda[4] sdd[0] sdc[2] sde[5](S) sdb[1]
      5860150464 blocks super 1.2 level 5, 64k chunk, algorithm 2 [4/4] [UUUU]
      [>....................]  resync =  0.0% (8564/1953383488) finish=1653140620.8min speed=0K/sec
      bitmap: 1/15 pages [4KB], 65536KB chunk

unused devices: <none>

..or perhaps something else?




Marc Smith

unread,
Sep 22, 2021, 8:23:01 AM9/22/21
to esos-...@googlegroups.com
Ah, I see... your MD RAID array is also a member device (circular)!?
Haven't seen something like that before! If it were me, I'd try
stopping/starting the array and see what happens. Might be worth to
look through the 'linux-raid' mailing list for advice too (maybe first
before stopping it).

--Marc
> To view this discussion on the web visit https://groups.google.com/d/msgid/esos-users/10aec42d-f3c3-4fb9-b48e-68a8005bfe19n%40googlegroups.com.

T. Sch.

unread,
Sep 29, 2021, 9:58:41 AM9/29/21
to esos-users

solved it like this:
shut down the esos machine with ther "circular" mess
created a new esos usb key
started the esos machine with the new key
md-raid was there with all data and no second Spare

I lost all other settings, but was able to recreate network and scst an Targets aso. manually

What do you think: May be there is a way via the TUI and / or other settings (.conf's) to prevent
such stupid admins as me to add existing scst devices to software raid arrays?
Reply all
Reply to author
Forward
0 new messages