Filesystems, Disks and Memory

Discuss NAS, SAN, RAID, Robotic Libraries, backup devices, RAM, DRAM, SCSI, IDE, EIDE topics here.

Failed raid 1 partition cannot re-add

👤 Login to reply

    #1  
Old 01-20-2013
ZaNaToS ZaNaToS is offline
Registered User
 
Failed raid 1 partition cannot re-add

I found out that the raid 1 was degraded:

Code:
[rootnode /]# cat /proc/mdstat
Personalities : [raid1]
md3 : active raid1 sda5[0] sdb5[1]
1822445428 blocks super 1.0 [2/2] [UU]
 
md2 : active raid1 sda3[0](F) sdb3[1]
1073741688 blocks super 1.0 [2/1] [_U]
 
md1 : active raid1 sda2[0] sdb2[1]
524276 blocks super 1.0 [2/2] [UU]
 
md0 : active raid1 sda1[0] sdb1[1]
33553336 blocks super 1.0 [2/2] [UU]

so it seems to me that in partition md2 the device sda3 was Faulty.

so I did try to remove and re-add it in order to repair it:

Code:
[rootnode /]# mdadm --remove /dev/md2 /dev/sda3
mdadm: hot removed /dev/sda3 from /dev/md2

then I tried to add it again:

Code:
[rootnode /]# mdadm --add /dev/md2 /dev/sda3
mdadm: /dev/sda3 reports being an active member for /dev/md2, but a --re-add fails.
mdadm: not performing --add as that would convert /dev/sda3 in to a spare.
mdadm: To make this a spare, use "mdadm --zero-superblock /dev/sda3" first.

and the result is:

Code:
[rootnode /]# cat /proc/mdstat
Personalities : [raid1]
md3 : active raid1 sda5[0] sdb5[1]
1822445428 blocks super 1.0 [2/2] [UU]
 
md2 : active raid1 sdb3[1]
1073741688 blocks super 1.0 [2/1] [_U]
 
md1 : active raid1 sda2[0] sdb2[1]
524276 blocks super 1.0 [2/2] [UU]
 
md0 : active raid1 sda1[0] sdb1[1]
33553336 blocks super 1.0 [2/2] [UU]
 
unused devices: <none>


so

Code:
md2 : active raid1 sda3[0](F) sdb3[1]
1073741688 blocks super 1.0 [2/1] [_U]

changed to

Code:
md2 : active raid1 sdb3[1]
1073741688 blocks super 1.0 [2/1] [_U]

and I cant re-add the 2nd device,
If I run
Code:
mdadm --zero-superblock /dev/sda3

would what erase my data from the partion? or would that create any other damage?

I've searched the manual which says:

Code:
--zero-superblock
If the device contains a valid md superblock, the block is overwritten with zeros.
With --force the block where the superblock would be is overwritten even if it doesn't appear to be valid

but I'm not sure if this erases data and since the partition mounts to / in which all the data is, I'm scared to try it without verification.

If anyone knows, that would be really helpfull.

---------- Post updated at 08:35 PM ---------- Previous update was at 06:40 PM ----------

after lots of research I decided to go on with it

Code:
[root@node ~]# mdadm --zero-superblock /dev/sda3
[root@node ~]# mdadm /dev/md2 -a /dev/sda3
mdadm: added /dev/sda3

[root@node ~]# cat /proc/mdstat
Personalities : [raid1]
md3 : active raid1 sda5[0] sdb5[1]
      1822445428 blocks super 1.0 [2/2] [UU]

md2 : active raid1 sda3[2] sdb3[1]
      1073741688 blocks super 1.0 [2/1] [_U]
      [>....................]  recovery =  1.1% (12009408/1073741688) finish=313.7min speed=56397K/sec

md1 : active raid1 sda2[0] sdb2[1]
      524276 blocks super 1.0 [2/2] [UU]

md0 : active raid1 sda1[0] sdb1[1]
      33553336 blocks super 1.0 [2/2] [UU]

as you can see the result is the raid is recovering so everything is ok and --zero-superblock didn't damage any data.

Last edited by Scrutinizer; 01-20-2013 at 01:38 PM.. Reason: code tags
Sponsored Links
👤 Login to reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
SPARC T4-1/Solaris 11/Add 2 new HDDs in RAID 0 configuration julumme Solaris 13 09-10-2012 10:42 PM
Identify failed disk in Linux RAID Loic Domaigne UNIX for Advanced & Expert Users 2 11-01-2011 04:28 PM
How to add partition? Agat Solaris 8 08-01-2011 11:23 PM
Partition management: lvm? fdisk? parted? (on RAID) builder88 Filesystems, Disks and Memory 1 05-03-2010 02:22 AM
Help: root partition crashed, fsck failed. Disk problem? steeles Solaris 2 02-11-2008 06:09 PM



All times are GMT -4. The time now is 04:20 PM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
×
UNIX.COM Login
Username:
Password:  
Show Password





Not a Forum Member?
Forgot Password?