My Raid0 array consists of two partition components.

[root@rhel-85 ~]# mdadm --detail /dev/md0
           Version : 1.2
     Creation Time : Sun Jan  9 17:25:26 2022
        Raid Level : raid0
        Array Size : 3141632 (3.00 GiB 3.22 GB)
      Raid Devices : 2
     Total Devices : 2
       Persistence : Superblock is persistent

       Update Time : Sun Jan  9 17:25:26 2022
             State : clean 
    Active Devices : 2
   Working Devices : 2
    Failed Devices : 0
     Spare Devices : 0

            Layout : original
        Chunk Size : 512K

Consistency Policy : none

              Name : rhel-85:0  (local to host rhel-85)
              UUID : bf76445f:08e4dab7:3861a780:76912221
            Events : 0

    Number   Major   Minor   RaidDevice State
       0     259        8        0      active sync   /dev/nvme0n2p1
       1     259        5        1      active sync   /dev/nvme0n1p5
[root@rhel-85 ~]# 

I have taken backup of all data from the raid0 array. Now, I want to add /dev/nvme0n2p5 partition component to the Raid0 array

After taking the backup, I am running the following commands:

[root@rhel-85 ~]# umount /dev/md0
umount: /dev/md0: not mounted.

[root@rhel-85 ~]# cat /proc/mdstat 
Personalities : [raid0] [raid1] 
md0 : active raid0 nvme0n2p1[0] nvme0n1p5[1]
      3141632 blocks super 1.2 512k chunks

[root@rhel-85 ~]# mdadm --add /dev/md0 /dev/nvme0n2p5
mdadm: add new device failed for /dev/nvme0n2p5 as 2: Invalid argument

Please let me know what commands to add partition /dev/nvme0n2p5 to the Raid0 array?

  • So you want to remove /dev/nvme0n2p1 and add /dev/nvme0n2p5 instead? Can you show your entire storage with lsblk? The device being busy doesn't necessary means it is mounted, if you have something stacked on top of the array (like LVM) you need to stop/deactivate these first. Commented Jan 10, 2022 at 6:27
  • 1
    RAID0 doesn't have any redundancy, so can't remove component devices without it breaking. Which do you want to do, add nvme0n2p5 as a third component, or replace nvme0n2p1 with it?
    – ilkkachu
    Commented Jan 10, 2022 at 7:02
  • I want to add nvme0n2p5 the third component. Do I need to format the /dev/md0 again? What are the steps to break raid0?
    – meallhour
    Commented Jan 10, 2022 at 15:46
  • 1
    First of all, you say in the commend that you want to add a third disk, but in the question itself you're trying to remove a disk. So do you have problems with adding a disk to the raid, or removing a disk? Second, have you tried googling?
    – aviro
    Commented Jan 10, 2022 at 16:06
  • My understanding is that in order add 3rd disk, I firstly need to remove the existing disks. That is why I was trying to remove the disks one by one. I am having issue adding 3rd disk and need steps for it. I tried to google but couldn't find anything concrete. However, the link given by you is helpful.
    – meallhour
    Commented Jan 10, 2022 at 16:12


You must log in to answer this question.

Browse other questions tagged .