0

I have 2 disk sda and sdb with several partition. I have to make a raid1 of the running system. I managed to setup raid1 with md0 on root but there are 2 more partition which are mounted on /home and /var which i cannot add to raid. Below are the configuration....can someone guide what is wrong and how i can bring these md127 and md2

NAME      MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT

sda         8:0    0 931.5G  0 disk
├─sda1      8:1    0   9.3G  0 part
│ └─md0     9:0    0   9.3G  0 raid1 /
├─sda2      8:2    0   7.5G  0 part  [SWAP]
├─sda3      8:3    0     1K  0 part
├─sda5      8:5    0  20.5G  0 part  /home
├─sda6      8:6    0  55.9G  0 part  /var
└─sda7      8:7    0 838.4G  0 part

sdb         8:16   0 931.5G  0 disk
├─sdb1      8:17   0   9.3G  0 part
│ └─md0     9:0    0   9.3G  0 raid1 /
├─sdb2      8:18   0   7.5G  0 part
├─sdb3      8:19   0     1K  0 part
├─sdb5      8:21   0  20.5G  0 part
│ └─md127   9:127  0  20.5G  0 raid1
└─sdb6      8:22   0  55.9G  0 part
  └─md2     9:2    0  55.9G  0 raid1

sr0        11:0    1  1024M  0 rom

-----------------------------------------------------------
md0 : active raid1 sdb1[1] sda1[2]
      9735168 blocks super 1.2 [2/2] [UU]
md127 : active (auto-read-only) raid1 sdb5[1]
    21466112 blocks super 1.2 [2/1] [_U]
md2 : active (auto-read-only) raid1 sdb6[1]
    58559488 blocks super 1.2 [2/1] [_U]
unused devices: <none>

-------------------------------------------------------
/dev/md127:
  
         Version : 1.2
  
   Creation Time : Mon Jun 26 18:21:00 2023
      Raid Level : raid1
      Array Size : 21466112 (20.47 GiB 21.98 GB)
   Used Dev Size : 21466112 (20.47 GiB 21.98 GB)
    Raid Devices : 2
   Total Devices : 1
     Persistence : Superblock is persistent
       Update Time : Mon Jun 26 18:21:00 2023
           State : clean, degraded
  
  Active Devices : 1
 Working Devices : 1
  Failed Devices : 0
   Spare Devices : 0


Consistency Policy : resync

              Name : dns003:1  (local to host dns003)
  
            UUID : xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  
          Events : 0

    Number   Major   Minor   RaidDevice State
  
     -       0        0        0      removed
  
     1       8       21        1      active sync   /dev/sdb5

sudo mdadm /dev/md127 -a /dev/sda5

mdadm: Cannot open /dev/sda5: Device or resource busy


alexus
  • 13,112
  • 32
  • 117
  • 174
  • There is no way to do it safely on the running system. Boot from rescue media and do it like that. To be able to do such things online you had to already have some more flexible schemes, like LVM. – Nikita Kipriyanov Jun 26 '23 at 19:14
  • I can reboot one or 2 times if needed ....sofar to bring md0 up i had done a reboot...Could you please provide some information on this – codelearner1029 Jun 27 '23 at 08:10
  • I don't understand what information to provide. You need a partitioning scheme? An outline of a process of migrating the installed system to the RAID-backed one? The question as it exists presently basically asks "how to avoid security warning and destroy the existing filesystem and the data", are you sure you need *that*? If not, explain what you want *properly*, what state it has now, what state you want it to be, and what exactly is the problem going from one to another. – Nikita Kipriyanov Jun 27 '23 at 11:22
  • currently we have only sda with 3 partition and a raid1 has to be created with sdb with same partition scheme as sda which is newly added so that if there is a faulty disk then it will not be a problem. – codelearner1029 Jun 27 '23 at 12:03

0 Answers0