0

I've been asked to look at a computer which had a Raid 1 Array in it until one drive failed 12 months ago without being picked up and has now been replaced but the other drive is also in a bad way and has a bunch of damaged sectors.

Ideally I'd like to integrate the new drive into the array and then decommission the broken drive and have it replaced. But when doing so mdadm gets so far then throws something like:

May 29 12:55:46 jackbarberlimited xinetd[21512]: START: smtps pid=28049     from=::ffff:2.102.62.201
May 29 12:55:46  kernel: ata2.00: status: { DRDY ERR }
May 29 12:55:46  kernel: ata2.00: error: { UNC }
May 29 12:55:46  kernel: ata2.00: configured for UDMA/133
May 29 12:55:46  kernel: sd 1:0:0:0: SCSI error: return code = 0x08000002
May 29 12:55:46  kernel: sdb: Current [descriptor]: sense key: Medium Error
May 29 12:55:46  kernel:     Add. Sense: Unrecovered read error - auto reallocate failed
May 29 12:55:46  kernel: 
May 29 12:55:46  kernel: Descriptor sense data with sense descriptors (in hex):
May 29 12:55:46  kernel:         72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 
May 29 12:55:46  kernel:         3a d9 d5 58 
May 29 12:55:46  kernel: end_request: I/O error, dev sdb, sector 987354456
May 29 12:55:46  kernel: raid1: sdb: unrecoverable I/O read error for block 982615168
May 29 12:55:46  kernel: ata2: EH complete
May 29 12:55:46  kernel: SCSI device sdb: 1465149168 512-byte hdwr sectors (750156 MB)
May 29 12:55:46  kernel: sdb: Write Protect is off
May 29 12:55:46  kernel: SCSI device sdb: drive cache: write back
May 29 12:55:46  kernel: md: md2: sync done.

Clearly its a bit upset copying a broken drive to a new drive, is there a way of forcing this, or do I have to copy the stuff across on a recovery disk or something?

bugg_tb
  • 3
  • 3
  • This might be a bit late since there are already potential answers, but: 1) What kind of [RAID 1](http://serverfault.com/questions/339128/what-are-the-different-widely-used-raid-levels-and-when-should-i-consider-them) array. Two drives? RAID 1E? Four drives in a 2+2 configuration? (Which should be tagged RAID10), ... A simple two drive mirror with one broken disk and one disk with problems? (In which case @longneck is right. Use cp and or ddrescue)... – Hennes May 29 '13 at 14:00
  • Is there a partition table on the MD disk? – Hauke Laging May 29 '13 at 14:25

2 Answers2

1

I would suggest to switch off the array and clone the drive using dd to a new one. Then make a full fsck to be sure everything is fine and then try to rebuild your RAID again with another new drive.

You should use the dd option "conv=noerror,sync" to ignore bad sectors.

bugg_tb
  • 3
  • 3
Pascal Schmiel
  • 1,728
  • 12
  • 17
0

md will not copy a drive that returns errors like that. You should instead:

  • Boot in to a rescue environment
  • Use something like dd or ddrescue to copy the bad drive to your new drive
  • Take the bad drive out
  • Boot off the new drive
  • Install another empty drive and let md mirror the data on to it
longneck
  • 22,793
  • 4
  • 50
  • 84