You are not logged in.

#1 2011-10-18 16:41:02

orcane
Member
Registered: 2011-04-15
Posts: 21

Software Raid 1 with mdadm but cannot re-add a removed disk

Hey there,
I have a software raid 1 with mdadm and two 1 TB disks. Today I booted and I saw the the message that the raid activated normal but with only one out of two disks. So I I got the following output form this command:

 mdadm -D /dev/md0
/dev/md0:
        Version : 1.2
  Creation Time : Sat Apr 16 00:30:53 2011
     Raid Level : raid1
     Array Size : 976758841 (931.51 GiB 1000.20 GB)
  Used Dev Size : 976758841 (931.51 GiB 1000.20 GB)
   Raid Devices : 2
  Total Devices : 1
    Persistence : Superblock is persistent

    Update Time : Tue Oct 18 18:33:39 2011
          State : clean, degraded
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0

           Name : archiso:0
           UUID : 96ad7277:0da83ae5:25ef36da:cb4596d3
         Events : 880419

    Number   Major   Minor   RaidDevice State
       0       8       17        0      active sync   /dev/sdb1
       1       0        0        1      removed

So I tried to re-add the disk with this command:

sudo mdadm --re-add /dev/sdc1 /dev/md0

but I got this error:

mdadm: /dev/sdc1 does not appear to be an md device

In gparted I also can see the disk and in the BIOS, too, so it's there and the disk seems to work.

Can anyone tell me what to do and I don't want to loose data and too much time and just re-add the disk. (Of course I do have backups!!)

Thanks for any help or ideas!

Offline

#2 2011-10-18 18:59:13

Finn10111
Member
Registered: 2011-10-05
Posts: 7

Re: Software Raid 1 with mdadm but cannot re-add a removed disk

Hello,

I think I have the same problem. A few days ago I installed Arch on a mdadm RAID1 with two 500 GB hard drive. Today I checked the output of

cat /proc/mdstat

and I saw that my RAID only made use of one drive.

The output of

mdadm -D /dev/md0

looks like your output and I am getting the same error after trying to re-add the device to the array.

I would be glad for any kind of help...

Offline

#3 2011-10-18 19:09:34

orcane
Member
Registered: 2011-04-15
Posts: 21

Re: Software Raid 1 with mdadm but cannot re-add a removed disk

Yeah thanks for your replay, I hope we get some hints to fix this!

Offline

#4 2011-10-18 21:40:42

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Software Raid 1 with mdadm but cannot re-add a removed disk

Read mdadm concerning --grow--- for help....


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#5 2011-10-19 00:32:38

slytux
Member
From: New York
Registered: 2010-09-25
Posts: 129

Re: Software Raid 1 with mdadm but cannot re-add a removed disk

Check that the partition tables on the two drives are identical.  If not, find out which one is the failed drive, copy or recreate the partitions (type fd) and try to add the drive back to the array.

Offline

#6 2011-10-19 07:36:35

orcane
Member
Registered: 2011-04-15
Posts: 21

Re: Software Raid 1 with mdadm but cannot re-add a removed disk

can you two please be a little bit more specific. E.g. what can I do with grow which helps in my case? And how can I check if the partition tables are identical?

Thanks for your help!

Offline

#7 2011-11-10 08:20:43

orcane
Member
Registered: 2011-04-15
Posts: 21

Re: Software Raid 1 with mdadm but cannot re-add a removed disk

Any new ideas? I still have the error. Thanks for any help!

Offline

#8 2011-11-10 09:56:01

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: Software Raid 1 with mdadm but cannot re-add a removed disk

You can ensure the partition table is identical by re-writing it to the newly added disk using sfdisk:

% sfdisk -d /dev/sdb | sfdisk /dev/sdc

then you should be able to add it into to the array with:

% mdadm --add /dev/md0 /dev/sdc1

Offline

#9 2011-11-10 10:34:27

hiciu
Member
Registered: 2010-08-11
Posts: 84

Re: Software Raid 1 with mdadm but cannot re-add a removed disk

orcane wrote:
sudo mdadm --re-add /dev/sdc1 /dev/md0

but I got this error:

mdadm: /dev/sdc1 does not appear to be an md device

Shouldn't that be

sudo mdadm --re-add /dev/md0 /dev/sdc1

Offline

#10 2011-11-10 18:22:53

orcane
Member
Registered: 2011-04-15
Posts: 21

Re: Software Raid 1 with mdadm but cannot re-add a removed disk

hiciu wrote:
orcane wrote:
sudo mdadm --re-add /dev/sdc1 /dev/md0

but I got this error:

mdadm: /dev/sdc1 does not appear to be an md device

Shouldn't that be

sudo mdadm --re-add /dev/md0 /dev/sdc1

You are right, but that doesn't do the trick either....

Offline

#11 2011-11-12 18:55:30

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Software Raid 1 with mdadm but cannot re-add a removed disk

raid activated normal but with only one out of two disks

But why? What did syslog report? Anything like "removing non-fresh device sdc"? Or disk is broken, read errors (in which case do not put it back, buy a new one)?

sudo mdadm --re-add /dev/sdc1 /dev/md0

Use mdadm --manage /dev/md0 --add /dev/sdc1
Besides you doing it wrong, there is a difference between add and re-add, and it's also good practice to be explicit.

Last edited by anrxc (2011-11-12 19:08:51)


You need to install an RTFM interface.

Offline

#12 2011-11-13 03:18:58

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Software Raid 1 with mdadm but cannot re-add a removed disk

Perhaps the problem is related to the need for the mdadm system to make an add.

As I discovered, with raid0 2 disk to grow to an extra disk requires two disks because the mdadm add requires one additional disk to complete the add by first establishing raid4 and then regressing to raid0.

This action may be needed in some form for your attempts to add or re add.

FWIW:


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#13 2014-01-29 17:06:27

noesalazar
Member
Registered: 2014-01-29
Posts: 1

Re: Software Raid 1 with mdadm but cannot re-add a removed disk

what does this mean

root@njbbtiams111> mdadm -D /dev/md0
mdadm: cannot open /dev/md0: No such file or directory
root@njbbtiams111>

Offline

#14 2014-01-29 17:17:17

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Software Raid 1 with mdadm but cannot re-add a removed disk

Please don't necrobump old threads: https://wiki.archlinux.org/index.php/Fo … Bumping.27

It means, for whatever reason, you don't have a /dev/md0 - look in /proc/mdstat



Closing


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB