LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-06-2017, 09:33 PM   #1
ergosteur
LQ Newbie
 
Registered: Sep 2009
Posts: 15

Rep: Reputation: 0
Question Question about number in mdadm --detail and /proc/mdstat when replacing drive


Just rebooted my Debian server without properly checking that all the drives were properly connected...

Anyway, I'm running a raid5 with mdraid, so the drive is now showing as "removed" -

Code:
# mdadm --detail --scan /dev/md0
/dev/md0:
        Version : 1.2
  Creation Time : Mon Feb 20 15:30:24 2017
     Raid Level : raid5
     Array Size : 15627548672 (14903.59 GiB 16002.61 GB)
  Used Dev Size : 3906887168 (3725.90 GiB 4000.65 GB)
   Raid Devices : 5
  Total Devices : 4
    Persistence : Superblock is persistent

    Update Time : Mon Mar  6 22:18:44 2017
          State : clean, degraded 
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 512K

           Name : ana-nas:0  (local to host ana-nas)
           UUID : 1c96f3e6:d996243e:91fa4af1:636f787f
         Events : 5672

    Number   Major   Minor   RaidDevice State
       0       8       16        0      active sync   /dev/sdb
       1       8       32        1      active sync   /dev/sdc
       2       8       48        2      active sync   /dev/sdd
       3       8       64        3      active sync   /dev/sde
       4       0        0        4      removed
# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] 
md0 : active raid5 sdb[0] sde[3] sdd[2] sdc[1]
      15627548672 blocks super 1.2 level 5, 512k chunk, algorithm 2 [5/4] [UUUU_]
      
unused devices: <none>
I reconnected the drive and re-added it
Code:
# mdadm --add /dev/md0 /dev/sdf
mdadm: added /dev/sdf
But now the drive shows as device number 5 instead of 4. Is this the intended behaviour? Is there any way to get /dev/sdf to show as device 4 again to satisfy my OCD?

Code:
# mdadm --detail --scan /dev/md0
/dev/md0:
        Version : 1.2
  Creation Time : Mon Feb 20 15:30:24 2017
     Raid Level : raid5
     Array Size : 15627548672 (14903.59 GiB 16002.61 GB)
  Used Dev Size : 3906887168 (3725.90 GiB 4000.65 GB)
   Raid Devices : 5
  Total Devices : 5
    Persistence : Superblock is persistent

    Update Time : Mon Mar  6 22:29:03 2017
          State : clean, degraded, recovering 
 Active Devices : 4
Working Devices : 5
 Failed Devices : 0
  Spare Devices : 1

         Layout : left-symmetric
     Chunk Size : 512K

 Rebuild Status : 0% complete

           Name : ana-nas:0  (local to host ana-nas)
           UUID : 1c96f3e6:d996243e:91fa4af1:636f787f
         Events : 5972

    Number   Major   Minor   RaidDevice State
       0       8       16        0      active sync   /dev/sdb
       1       8       32        1      active sync   /dev/sdc
       2       8       48        2      active sync   /dev/sdd
       3       8       64        3      active sync   /dev/sde
       5       8       80        4      spare rebuilding   /dev/sdf
# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] 
md0 : active raid5 sdf[5] sdb[0] sde[3] sdd[2] sdc[1]
      15627548672 blocks super 1.2 level 5, 512k chunk, algorithm 2 [5/4] [UUUU_]
      [>....................]  recovery =  0.0% (2420676/3906887168) finish=456.9min speed=142392K/sec
 
  


Reply

Tags
mdadm, number, raid5, replace



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] help with software raid mdstat mdadm oliveoyl Linux - General 5 09-19-2016 09:04 PM
Understanding /proc/mdstat anon091 Linux - Newbie 7 06-22-2012 06:12 AM
New to mdadm. Can someone interpret my /proc/mdstat? bvz Linux - Newbie 2 09-28-2011 11:39 PM
[SOLVED] Can only see one drive in /proc/mdstat hedron Slackware 3 09-05-2011 09:56 AM
event 7 displayed in /proc/mdstat craigusb Linux - Software 0 07-05-2006 03:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration