Is mdadm RAID Toast?

Andrew Wei asked:

I took all my drives out and put them onto a new cpu/mobo. (upgrading)

I boot up and mdadm claims it can’t boot my degraded RAID.

/dev/sdb

    sudo mdadm --examine /dev/sdb
    /dev/sdb:
              Magic : a92b4efc
            Version : 1.2
        Feature Map : 0x0
         Array UUID : 91a6c44d:21226975:8d2dc41a:7fcff414
               Name : desktop:0  (local to host desktop)
      Creation Time : Tue Jun 25 19:03:31 2013
         Raid Level : raid5
       Raid Devices : 3

     Avail Dev Size : 5860271024 (2794.40 GiB 3000.46 GB)
         Array Size : 5860270080 (5588.79 GiB 6000.92 GB)
      Used Dev Size : 5860270080 (2794.39 GiB 3000.46 GB)
        Data Offset : 262144 sectors
       Super Offset : 8 sectors
              State : clean
        Device UUID : 367cb248:993e2658:ecd4b56d:2aaa0a6a

        Update Time : Tue Mar  4 17:48:54 2014
           Checksum : d4572f50 - correct
             Events : 12635

             Layout : left-symmetric
         Chunk Size : 512K

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

/dev/sdc

    sudo mdadm --examine /dev/sdc
    /dev/sdc:
       MBR Magic : aa55
    Partition[0] :   4294967295 sectors at            1 (type ee)

/dev/sdd

    sudo mdadm --examine /dev/sdd
    /dev/sdd:
       MBR Magic : aa55
    Partition[0] :   4294967295 sectors at            1 (type ee)

What happens when I tried to “recreate” it

    sudo mdadm --create /dev/md0 --level=5 --raid-devices=3 --spare-devices=0 /dev/sd[bcd]
    mdadm: /dev/sdb appears to be part of a raid array:
        level=raid5 devices=3 ctime=Tue Jun 25 19:03:31 2013
    mdadm: /dev/sdc appears to be part of a raid array:
        level=raid0 devices=0 ctime=Wed Dec 31 18:00:00 1969
    mdadm: partition table exists on /dev/sdc but will be lost or
           meaningless after creating array
    mdadm: /dev/sdd appears to be part of a raid array:
        level=raid0 devices=0 ctime=Wed Dec 31 18:00:00 1969
    mdadm: partition table exists on /dev/sdd but will be lost or
           meaningless after creating array

I’m hoping there is a slight chance I can get my stuff back, considering mdadm doesn’t see that sdc/sdd are part of a raid, but just not the same one.

Is my raid toast?

EDIT: Trying to assembling by specifying

    sudo mdadm --assemble /dev/md0 /dev/sd[bcd]
    mdadm: no RAID superblock on /dev/sdc
    mdadm: /dev/sdc has no superblock - assembly aborted

Try Using –scan

    sudo mdadm --assemble --scan
    mdadm: /dev/md0 assembled from 1 drive - not enough to start the array.

EDIT #2

    cat /proc/mdstat
    Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
    md0 : inactive sdb[1](S)
          2930135512 blocks super 1.2

    unused devices: <none>

EDIT #3

/dev/sdb

    sudo gdisk -l /dev/sdb
    GPT fdisk (gdisk) version 0.8.7

    Partition table scan:
      MBR: not present
      BSD: not present
      APM: not present
      GPT: not present

    Creating new GPT entries.
    Disk /dev/sdb: 5860533168 sectors, 2.7 TiB
    Logical sector size: 512 bytes
    Disk identifier (GUID): 76360B85-31EF-4155-8F9E-767C0C14454E
    Partition table holds up to 128 entries
    First usable sector is 34, last usable sector is 5860533134
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 5860533101 sectors (2.7 TiB)

    Number  Start (sector)    End (sector)  Size       Code  Name

/dev/sdc

    sudo gdisk -l /dev/sdc
    GPT fdisk (gdisk) version 0.8.7

    Partition table scan:
      MBR: protective
      BSD: not present
      APM: not present
      GPT: present

    Found valid GPT with protective MBR; using GPT.
    Disk /dev/sdc: 5860533168 sectors, 2.7 TiB
    Logical sector size: 512 bytes
    Disk identifier (GUID): DBD9F056-E1AE-4C22-826F-2D359EF6680E
    Partition table holds up to 128 entries
    First usable sector is 34, last usable sector is 5860533134
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 2925 sectors (1.4 MiB)

    Number  Start (sector)    End (sector)  Size       Code  Name
       1            2048      5860532223   2.7 TiB     0700

/dev/sdd

    sudo gdisk -l /dev/sdd
    GPT fdisk (gdisk) version 0.8.7

    Partition table scan:
      MBR: protective
      BSD: not present
      APM: not present
      GPT: present

    Found valid GPT with protective MBR; using GPT.
    Disk /dev/sdd: 5860533168 sectors, 2.7 TiB
    Logical sector size: 512 bytes
    Disk identifier (GUID): BE9B843B-62CB-4D12-A661-5FA9AF871493
    Partition table holds up to 128 entries
    First usable sector is 34, last usable sector is 5860533134
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 2925 sectors (1.4 MiB)

    Number  Start (sector)    End (sector)  Size       Code  Name
       1            2048      5860532223   2.7 TiB     0700  

My answer:


For some reason, you seem to have used the whole disk for one of the drives, and a single partition on each of the other two. Try assembling using the partitions.

mdadm --assemble /dev/sdb /dev/sd[cd]1

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.