You are not logged in.

#1 2015-04-20 12:48:14

craigdabbs
Member
Registered: 2011-07-01
Posts: 11

Linux Raid - Identify failed hard drive

Hi there,

I have a failed hard drive i would like to replace on my raid 5 array.  When i run

mdadm --detail /dev/md0

/dev/md0:
        Version : 1.2
  Creation Time : Sun Mar  4 11:43:02 2012
     Raid Level : raid5
     Array Size : 5858999808 (5587.58 GiB 5999.62 GB)
  Used Dev Size : 1952999936 (1862.53 GiB 1999.87 GB)
   Raid Devices : 4
  Total Devices : 3
    Persistence : Superblock is persistent

    Update Time : Mon Apr 20 13:30:41 2015
          State : clean, degraded 
 Active Devices : 3
Working Devices : 3
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 512K

           Name : HTPC-SERVER:0
           UUID : 86c44c6c:adddd2d7:4eb800f9:35d4070e
         Events : 234808

    Number   Major   Minor   RaidDevice State
       0       8       33        0      active sync   /dev/sdc1
       3       8       64        1      active sync   /dev/sde
       4       0        0        4      removed
       4       8       48        3      active sync   /dev/sdd
cat /proc/mdstat 
Personalities : [raid6] [raid5] [raid4] 
md0 : active raid5 sdc1[0] sdd[4] sde[3]
      5858999808 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/3] [UU_U]
      
unused devices: <none>

The output does not tell what drive has been removed, i can find it by trail and error by unplugging them.  How would i go about removing the line  '4       0        0        4      removed' from the array?

Thanks

Craig

Offline

#2 2015-04-20 13:11:20

nstgc
Member
Registered: 2014-03-17
Posts: 393

Re: Linux Raid - Identify failed hard drive

You have 4 drives right, and 3 of them are good. You can go into "/dev/disks/by-id/" and run "ls -l". On the left will be the device IDs, which will include the drive make, model, and serial number. On the right is which "/dev/sdX" it links to. You know three drives that are it, and presumably there is a drive that isn't in the array since you have through at least sde.

Offline

#3 2015-04-20 13:33:11

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Linux Raid - Identify failed hard drive

I think the 'removed' line should be taken care of once you add a new device and rebuild the array.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#4 2015-04-20 13:54:41

craigdabbs
Member
Registered: 2011-07-01
Posts: 11

Re: Linux Raid - Identify failed hard drive

ive found the duff hard drive, i have another replacement in now.  Hopefully it will rebuild ok and the removed device gets removed too.   Thanks guys

Offline

#5 2015-04-20 13:59:53

craigdabbs
Member
Registered: 2011-07-01
Posts: 11

Re: Linux Raid - Identify failed hard drive

success

/dev/md0:
        Version : 1.2
  Creation Time : Sun Mar  4 11:43:02 2012
     Raid Level : raid5
     Array Size : 5858999808 (5587.58 GiB 5999.62 GB)
  Used Dev Size : 1952999936 (1862.53 GiB 1999.87 GB)
   Raid Devices : 4
  Total Devices : 4
    Persistence : Superblock is persistent

    Update Time : Mon Apr 20 14:57:40 2015
          State : clean, degraded, recovering 
 Active Devices : 3
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 1

         Layout : left-symmetric
     Chunk Size : 512K

 Rebuild Status : 0% complete

           Name : HTPC-SERVER:0
           UUID : 86c44c6c:adddd2d7:4eb800f9:35d4070e
         Events : 234866

    Number   Major   Minor   RaidDevice State
       0       8       33        0      active sync   /dev/sdc1
       3       8       64        1      active sync   /dev/sde
       5       8       16        2      spare rebuilding   /dev/sdb
       4       8       48        3      active sync   /dev/sdd

Wanted to make sure it was done right before hosing all the data.  Ill add another drive as a spare for the array.  I assume you just add it and it should know to use it as a spare?

Offline

#6 2015-04-20 17:09:13

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

Re: Linux Raid - Identify failed hard drive

Not a Sysadmin issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB