0

I've a RAID5 configuration (4 drives). One drive failed, showed up as a failed device in mdadm. After rebooting, the failed device didn't even appear in mdadm. The RAID5 config only had 3 working devices (and a clean state).

Following Thomas's tutorial on replacing failed disks, I added a new drive to the RAID. Note, failing and removing the failed disk from the array showed "no device found" messages (I assumed because it wasn't detected as part of the array).

Checking mdadm, the new drive shows up as a spare. Checking cat /proc/mdstat doesn't show any resyncing, recovering, or reshaping messages.

Can the spare be converted to an active device? How can it be added to the RAID?

Console messages

Before adding drive (failed drive not shown):

/dev/md127:
        Version : 1.1
  Creation Time : Mon Oct 22 16:20:37 2012
     Raid Level : raid5
     Array Size : 1953518592 (1863.02 GiB 2000.40 GB)
  Used Dev Size : 976759296 (931.51 GiB 1000.20 GB)
   Raid Devices : 3
  Total Devices : 3
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

    Update Time : Sun Nov  6 11:02:16 2016
          State : clean
 Active Devices : 3
Working Devices : 3
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 512K

           Name : xxx
           UUID : xxx
         Events : 239342

    Number   Major   Minor   RaidDevice State
       3       8       49        0      active sync   /dev/sdd1
       5       8        1        1      active sync   /dev/sda1
       4       8       33        2      active sync   /dev/sdc1

After adding drive:

/dev/md127:
        Version : 1.1
  Creation Time : Mon Oct 22 16:20:37 2012
     Raid Level : raid5
     Array Size : 1953518592 (1863.02 GiB 2000.40 GB)
  Used Dev Size : 976759296 (931.51 GiB 1000.20 GB)
   Raid Devices : 3
  Total Devices : 4
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

    Update Time : Sun Nov  6 12:18:59 2016
          State : clean
 Active Devices : 3
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 1

         Layout : left-symmetric
     Chunk Size : 512K

           Name : xxx
           UUID : xxx
         Events : 239347

    Number   Major   Minor   RaidDevice State
       3       8       49        0      active sync   /dev/sdd1
       5       8        1        1      active sync   /dev/sda1
       4       8       33        2      active sync   /dev/sdc1

       6       8       17        -      spare   /dev/sdb1

New drive partition (parted):

Model: ATA WDC WD3001FFSX-6 (scsi)
Disk /dev/sdb: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  3001GB  3001GB               primary  raid
0

Haha!

mdadm --grow --raid-devices=4

When the failed device disappeared, the # of raid devices dropped down to 3. Still unsure of why this happened. Growing it back to 4 made the spare device an active one. RAID now reshaping...ever so slowly.

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.