Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
This might be a bit late since there are already potential answers, but: 1) What kind of RAID 1 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 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.