1

I found simmilar problem here: Missing mdadm raid5 array reassembles as raid0 after powerout, but mine is a bit different.

Here too my raid5 reassembles as raid0, but i don't see any of my devices marked as spare in mdadm -E /dev/sdX1 output:

/dev/sdb1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 9b244d41:0b94c8f7:0da323ac:f2a873ec
           Name : bekap:0  (local to host bekap)
  Creation Time : Wed Oct  9 16:03:25 2013
     Raid Level : raid5
   Raid Devices : 3

 Avail Dev Size : 5860268032 (2794.39 GiB 3000.46 GB)
     Array Size : 5860267008 (5588.79 GiB 6000.91 GB)
  Used Dev Size : 5860267008 (2794.39 GiB 3000.46 GB)
    Data Offset : 262144 sectors
   Super Offset : 8 sectors
   Unused Space : before=262064 sectors, after=1024 sectors
          State : active
    Device UUID : f8405c86:85d8bade:8a74b0f5:fec08e3f

    Update Time : Sat Jan 16 04:41:05 2016
       Checksum : da1a9cb2 - correct
         Events : 134111

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 0
   Array State : AA. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdc1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 9b244d41:0b94c8f7:0da323ac:f2a873ec
           Name : bekap:0  (local to host bekap)
  Creation Time : Wed Oct  9 16:03:25 2013
     Raid Level : raid5
   Raid Devices : 3

 Avail Dev Size : 5860268032 (2794.39 GiB 3000.46 GB)
     Array Size : 5860267008 (5588.79 GiB 6000.91 GB)
  Used Dev Size : 5860267008 (2794.39 GiB 3000.46 GB)
    Data Offset : 262144 sectors
   Super Offset : 8 sectors
   Unused Space : before=262064 sectors, after=1024 sectors
          State : active
    Device UUID : d704efde:067523c1:a6de1be2:e752323f

    Update Time : Sat Jan 16 04:41:05 2016
       Checksum : 124f919 - correct
         Events : 134111

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 1
   Array State : AA. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdd1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 9b244d41:0b94c8f7:0da323ac:f2a873ec
           Name : bekap:0  (local to host bekap)
  Creation Time : Wed Oct  9 16:03:25 2013
     Raid Level : raid5
   Raid Devices : 3

 Avail Dev Size : 5860268032 (2794.39 GiB 3000.46 GB)
     Array Size : 5860267008 (5588.79 GiB 6000.91 GB)
  Used Dev Size : 5860267008 (2794.39 GiB 3000.46 GB)
    Data Offset : 262144 sectors
   Super Offset : 8 sectors
   Unused Space : before=262064 sectors, after=1024 sectors
          State : clean
    Device UUID : c52383f7:910118d3:e808a29f:b4edad2c

    Update Time : Mon Dec 28 10:46:40 2015
       Checksum : d69974b5 - correct
         Events : 52676

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 2
   Array State : AAA ('A' == active, '.' == missing, 'R' == replacing)

But they are marked as S (which as far as I know stands for spare) in /proc/mdstat (and there are no personalities for md0):

Personalities : 
md0 : inactive sdb1[0](S) sdd1[3](S) sdc1[1](S)
      8790402048 blocks super 1.2

unused devices: <none>

Here is mdadm -D /dev/md0 output:

/dev/md0:
        Version : 1.2
     Raid Level : raid0
  Total Devices : 3
    Persistence : Superblock is persistent

          State : inactive

           Name : bekap:0  (local to host bekap)
           UUID : 9b244d41:0b94c8f7:0da323ac:f2a873ec
         Events : 134111

    Number   Major   Minor   RaidDevice

       -       8       17        -        /dev/sdb1
       -       8       33        -        /dev/sdc1
       -       8       49        -        /dev/sdd1

So I'm a bit confused why it can't reassemble this array if it has two (I would say good devices) out of three. I'm not sure if mdadm -D /dev/md0 showed it as raid0 since the failure or if I just messed it up while trying to reassemble the array (I tried mdadm --stop /dev/md0 and mdadm --assemble --scan --verbose and mdadm --assemble --scan --verbose /dev/md0 /dev/sdb1 /dev/sdc1 or something simmilar - I can try to get exact commands if it is necessary).

So, my question: can I remove sdd1 from array, then assemble md0 without it and then add sdd1 again? Or should I use --assemble --force --run as mentioned in the linked question? Or something else? I'm quite unexperienced with linux raid and mdadm.

Thanks a lot.

  • I just read through your question and I'm having a lot of trouble understanding what you are trying to do. Right now you have three disks in a 3 disk Raid-5, what is the problem with that? – Claris Jan 25 '16 at 23:04
  • Hi, thanks, the problem si - it won't start (I would have to stop and then mdadm --assemble --scan the array again - which I would like to avoid until it's necessary - to get the exact error message, but its something like: assembled from X drives - not enough to start the array while not clean. Consider force...). I don't know why it won't start - because it has two disks, which look good to me. /proc/mdstat shows the disks are [S] (which is spare, I think), but I think they shouldn't be and mdadm -D /dev/md0 says it's raid0, which is incorrect too. Hope this more clear, thanks. – upratathlavu Jan 26 '16 at 10:00
  • Is the word "clean" in error message associated with the disk state in mdadm -E /dev/sdX output (which is now active for 2 disks and clean for the one, which has lower event counter)? Is it that it has to have at least 2 out of 3 disks marked as clean to start? If yes, can I get the two to clean state somehow? Thanks. – upratathlavu Jan 26 '16 at 10:04
  • If you created a raid array as raid-5 it should never change to raid-0. The /proc/mdstat entry should show a raid personality, right now it is showing nothing. The disk signature shows that the disk thinks that it belongs to a RAID group, and that is good. You should be able to feed that information to mdadm and have it build/rebuild an array with those parameters. – Claris Jan 26 '16 at 22:31
  • Thanks. Yes, but I'm not the only one with raid5 changed to raid0 (see link at the begining). What do you mean by disk signature (Device UUID?) and wich disk are you reffering to? Can you please give me command by which I can rebuild it? I don't really know what do you mean by "feeding that information to mdadm" - which information and how? – upratathlavu Jan 26 '16 at 23:08
0

Ok, just to conclude this - basically, what was said in that link helped, here are my exact commands:

  • mdadm --assemble --force /dev/md0 /dev/sdb1 /dev/sdc1
  • mdadm --add /dev/md0 /dev/sdd1 (--re-add didn't work), after this it started resyncing - took about 20 hours

Then, since there is lvm over:

  • lvchange -ay data/data
  • fsck /dev/data/data

Thanks for help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.