# Md raid usage problem

**URL:** <https://discussion.fedoraproject.org/t/md-raid-usage-problem/80165>\
**Category:** Ask Fedora\
**Tags:** mdadm, f37, coreos\
**Created:** [March 29, 2023, 6:16pm UTC](https://discussion.fedoraproject.org/t/md-raid-usage-problem/80165 "2023-03-29T18:16:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bugthing](https://sea1.discourse-cdn.com/fedoraproject/user_avatar/discussion.fedoraproject.org/bugthing/32/6006_2.png) [@bugthing](https://discussion.fedoraproject.org/u/bugthing)\
**Post date:** [March 29, 2023, 6:16pm UTC](https://discussion.fedoraproject.org/t/md-raid-usage-problem/80165/1 "2023-03-29T18:16:41Z")

</div>

hello all :),  
I am using coreos and am having trouble removing a disk from a raid1 array.  
As they say, “terminal output paints a thousand words”, so here is mine to demo the problem:

```auto
Fedora CoreOS 37.20230303.3.0
[core@baller ~]$ sudo bash
[root@baller core]# mdadm --detail /dev/md127
/dev/md127:
           Version : 1.2
     Creation Time : Sat Feb 5 21:07:27 2022
        Raid Level : raid1
        Array Size : 9766303680 (9.10 TiB 10.00 TB)
     Used Dev Size : 9766303680 (9.10 TiB 10.00 TB)
      Raid Devices : 2
     Total Devices : 2
       Persistence : Superblock is persistent

     Intent Bitmap : Internal

       Update Time : Wed Mar 29 18:02:53 2023
             State : clean
    Active Devices : 2
   Working Devices : 2
    Failed Devices : 0
     Spare Devices : 0

Consistency Policy : bitmap

              Name : any:backup
              UUID : 555c5555:f37db731:bcf64d0c:94f60b41
            Events : 482208

    Number Major Minor RaidDevice State
       2 8 49 0 active sync /dev/sdd1
       1 8 1 1 active sync /dev/sda1

[root@baller core]# umount /dev/md127
[root@baller core]# mdadm --stop /dev/md127
mdadm: stopped /dev/md127
[root@baller core]# mdadm --fail /dev/sdd --remove /dev/sdd
mdadm: /dev/sdd does not appear to be an md device
[root@baller core]# mdadm --fail /dev/sdd1 --remove /dev/sdd1
mdadm: /dev/sdd1 does not appear to be an md device

```

As you can see `mdadm` reports the device is not raid device but before (–detail) it reports it as part of the array.  
I have not done this before so I am unsure if this is the correct thing to do… or if there is another problem.

Please offer any advice you can.

Many thanks,  
-bn

---

<div class="post-metadata">

**Author:** ![eashleyfl](https://avatars.discourse-cdn.com/v4/letter/e/38bc3b/32.png) [@eashleyfl](https://discussion.fedoraproject.org/u/eashleyfl)\
**Post date:** [March 29, 2023, 6:28pm UTC](https://discussion.fedoraproject.org/t/md-raid-usage-problem/80165/2 "2023-03-29T18:28:33Z")

</div>

I believe the raid array needs to be running for --fail to be applied, also you should `--fail sdd`. Quothe the man page:

> –fail, -f  
> This allows the hot-plug system to remove devices that have fully disappeared from the kernel. It will first fail and then remove the device from any array it belongs to. The device name given should be a kernel device name such as “sda”, not a name in /dev.

---

<div class="post-metadata">

**Author:** ![bugthing](https://sea1.discourse-cdn.com/fedoraproject/user_avatar/discussion.fedoraproject.org/bugthing/32/6006_2.png) [@bugthing](https://discussion.fedoraproject.org/u/bugthing)\
**Post date:** [March 29, 2023, 7:01pm UTC](https://discussion.fedoraproject.org/t/md-raid-usage-problem/80165/3 "2023-03-29T19:01:57Z")

</div>

thanks for the advice 👍

sadly this does change how mdadm see the device

```auto
mdadm --detail /dev/md127
/dev/md127:
           Version : 1.2
     Creation Time : Sat Feb 5 21:07:27 2022
        Raid Level : raid1
        Array Size : 9766303680 (9.10 TiB 10.00 TB)
     Used Dev Size : 9766303680 (9.10 TiB 10.00 TB)
      Raid Devices : 2
     Total Devices : 2
       Persistence : Superblock is persistent

     Intent Bitmap : Internal

       Update Time : Wed Mar 29 18:59:01 2023
             State : clean
    Active Devices : 2
   Working Devices : 2
    Failed Devices : 0
     Spare Devices : 0

Consistency Policy : bitmap

              Name : any:backup
              UUID : 650c5059:f37db731:bcf64d0c:94f60b41
            Events : 482208

    Number Major Minor RaidDevice State
       2 8 49 0 active sync /dev/sdd1
       1 8 1 1 active sync /dev/sda1
[root@baller core]# mdadm --fail /dev/sdd
mdadm: /dev/sdd does not appear to be an md device
[root@baller core]# mdadm --fail /dev/sdd1
mdadm: /dev/sdd1 does not appear to be an md device

```

i

---

<div class="post-metadata">

**Author:** ![computersavvy](https://sea1.discourse-cdn.com/fedoraproject/user_avatar/discussion.fedoraproject.org/computersavvy/32/4741_2.png) [@computersavvy](https://discussion.fedoraproject.org/u/computersavvy)\
**Post date:** [March 30, 2023, 12:51am UTC](https://discussion.fedoraproject.org/t/md-raid-usage-problem/80165/4 "2023-03-30T00:51:54Z")

</div>

> [@eashleyfl](#):
>
> also you should `--fail sdd`.

Since mdadm shows /dev/sdd1 as a raid member then the fail command should address the member in that way.

Most users define a raid array using the full devices, but it is perfectly fine to do so with a partition as well.

for @bugthing  
A quick search with google gives me these

> **[Removal of mdadm RAID Devices - How to do it quickly?](https://bobcares.com/blog/removal-of-mdadm-raid-devices/)**
>
> Removal of mdadm RAID Devices is quite easy. It involves a quick 6 steps. In this article, our support techs discusses these steps.

> **[Failing and Removing a Device From a RAID 1 Array in Linux](http://www.linux-databook.info/?page_id=394)**
>
> When a RAID device fails, it is necessary to remove the hard drive containing the failed device from the array and replace it with a new hard drive. With Linux software RAID this is actually fairly…

I have not tested that since I do not use raid 1, but both seem to be pretty standard.

---

<div class="post-metadata">

**Author:** ![bugthing](https://sea1.discourse-cdn.com/fedoraproject/user_avatar/discussion.fedoraproject.org/bugthing/32/6006_2.png) [@bugthing](https://discussion.fedoraproject.org/u/bugthing)\
**Post date:** [March 30, 2023, 8:16am UTC](https://discussion.fedoraproject.org/t/md-raid-usage-problem/80165/5 "2023-03-30T08:16:35Z")

</div>

YES!.. thanks to that second link I have made progress… my problem was that I formed the `--fail` command wrong, it should be

`mdadm --fail /dev/md127 /dev/sdd1`

Seems so many posts on this topic say about stopping the raid first and dont seem to include the raid device in the fail command… but all that I needed was the above.

Thanks for reply, much appreciated 💟
