LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-13-2015, 01:05 PM   #1
Uruz42
LQ Newbie
 
Registered: Aug 2015
Posts: 17

Rep: Reputation: Disabled
mdadm removed and spare disk


Hey folks,

I have a mdadm raid 6 array, and it seems that it is somehow degraded or has issues of some other kind.
It used to be a raid 6 array of 5 disks. However it seems that somehow (probaly becouse I screwed something up) one of the drives is removed and added as a spare. I have tried fixing it by using --re-add or --add but all seems to not really work.
Below the --detail and /proc/mdstat

Code:
# mdadm --detail /dev/md0
/dev/md0:
        Version : 1.2
  Creation Time : Tue Oct  7 22:08:51 2014
     Raid Level : raid6
  Used Dev Size : -1
   Raid Devices : 5
  Total Devices : 5
    Persistence : Superblock is persistent

    Update Time : Thu Aug 13 14:34:06 2015
          State : active, degraded, Not Started
 Active Devices : 4
Working Devices : 5
 Failed Devices : 0
  Spare Devices : 1

         Layout : left-symmetric
     Chunk Size : 512K

           Name : debian-name:0  (local to host debian-name)
           UUID : cb730507:61aed11d:c7804066:8a28886b
         Events : 155

    Number   Major   Minor   RaidDevice State
       0       8       65        0      active sync   /dev/sde1
       1       0        0        1      removed
       2       8       17        2      active sync   /dev/sdb1
       3       8       33        3      active sync   /dev/sdc1
       4       8       49        4      active sync   /dev/sdd1

       5       8        1        -      spare   /dev/sda1
Code:
~# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md0 : inactive sde1[0] sda1[5](S) sdd1[4] sdc1[3] sdb1[2]
      14650670080 blocks super 1.2
My guiss is that it will not be that hard but as all my data is on it I prefere to not use trial and error too much.
Thanks in advance for the help.
 
Old 08-13-2015, 01:13 PM   #2
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Try the following (assuming that the disk removed if f):

Code:
mdadm --zero-superblock /dev/sdf1
mdadm /dev/md0 --add /dev/sdf1
 
Old 08-13-2015, 01:26 PM   #3
Uruz42
LQ Newbie
 
Registered: Aug 2015
Posts: 17

Original Poster
Rep: Reputation: Disabled
First of all thanks for the reply. I tried doing so however it seems that it is unavailable for opening. So to be shure I did a reboot.

Code:
~# mdadm --zero-superblock /dev/sda1
mdadm: Couldn't open /dev/sda1 for write - not zeroing
Just to make shure after rebooting I did detail again and it seems the disks are somehow renamed for now sdb1 is the dead link instead of sda1
Code:
# mdadm --detail /dev/md0
/dev/md0:
        Version : 1.2
  Creation Time : Tue Oct  7 22:08:51 2014
     Raid Level : raid6
  Used Dev Size : -1
   Raid Devices : 5
  Total Devices : 5
    Persistence : Superblock is persistent

    Update Time : Thu Aug 13 14:34:06 2015
          State : active, degraded, Not Started
 Active Devices : 4
Working Devices : 5
 Failed Devices : 0
  Spare Devices : 1

         Layout : left-symmetric
     Chunk Size : 512K

           Name : debian-hidde:0  (local to host debian-hidde)
           UUID : cb730507:61aed11d:c7804066:8a28886b
         Events : 155

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

       5       8       17        -      spare   /dev/sdb1
Once again I tried --zero-superblock but still doesnt work.
Code:
# mdadm --zero-superblock /dev/sdb1
mdadm: Couldn't open /dev/sdb1 for write - not zeroing
I'm wondering if it's rebuilding or something so all the disks cannot be accesed?
Also for my learning purpouses, am I correct if I say that what you intended was deleting the removed disk and deleting all data from it so that it can be added?
 
Old 08-14-2015, 12:34 PM   #4
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
What does the following spit out;

Code:
cat /proc/mdstat
Also check the disk to ensure it is set to Linux Raid
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mdadm - removing faulty spare carlmarshall Linux - Server 8 03-09-2023 03:31 PM
mdadm - re-added disk treated as spare wingnut64 Linux - Server 13 08-09-2022 05:02 PM
mdadm spare drive glennbtn Linux - Software 1 11-21-2013 08:55 AM
[SOLVED] Software RAID (mdadm) - RAID 0 returns incorrect status for disk failure/disk removed Marjonel Montejo Linux - General 4 10-04-2009 07:15 PM
[Fedora 9]mdadm + faulty spare setkos Linux - Newbie 0 10-30-2008 10:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:06 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