Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    [Help!] Repairing broken raid

    Hi! I'm trying to repair system raid and that's what figures out:


    Anyone can help?

  2. #2
    Linux Newbie reginaldperrin's Avatar
    Join Date
    Oct 2010
    Christchurch, New Zealand
    Quote Originally Posted by Lantir View Post
    Hi! I'm trying to repair system raid and that's what figures out:


    Anyone can help?

    Your image seems to be indicating that there is a sector error, and the system is trying to relocate the sector elsewhere.
    If this is the case, then you can try a few things:
    1. Repair the affected drive
    2. Simply replace the affected drive

    Trying to repair the drive can be tricky (and I mean software repair, not literally fix the hardware). You will need to get something like Spinrite, then run it on the affected drive until it has recovered all the data it can. But you will also have to move the drive to another computer first, otherwise it may not "see" the affected drive, only the raid array as a whole.
    In my experience, Spinrite has the ability to rescue drives which are in the same position your drive is possibly in.
    If recovered, I would still consider replacing the drive, after backing up all the data on the array.

    If you go down the "simply replace it" road, there is the risk that the system will simply correctly build an array, but incorrectly lose whatever partitioning and data was present.
    You may end up with a good worlking array, but no OS or data.

  3. #3
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Anyone can help?

    1. Repair the affected drive
    2. Simply replace the affected drive
    It depends on the type of RAID you've got there.

    1] If it is a RAID0 you got a problem as replacing the drive will actually destroy the RAID. Once the drive has bad sectors and actually tries to read data from there, you have lost that data. You should take the system offline such that there are as less read/write operations as possible. Then try to recover as much as possible and backup the recovered data as long as the drive still spins. And you should definitely start with the important data first.

    2] If it is a RAID1, RAID5 or RAID6 that has redundancy built-in the data is not lost unless a second (or third) drive fails. Your options are:
    2.1] remove the bad drive from the RAID, force the drive to relocate the bad sectors and trigger the raid to resync
    2.2] replace the drive and resync the RAID

    Doing 2.1 can take a long time and chances are good that the drive may become even more damaged (or even destroyed) by the resync. But if you have less money to spend for a new drive than spare time trying to fix it, it may be an option. I did it just a week ago and I had to buy a new drive anyway. If you try to fix the bad sectors, you first remove the drive from the raid (mark it with mdadm as failed and remove it with mdadm), then identify a bad sector (using smart or a tool like badsectors), then force the disk to mark those sectors as bad by writing zeros to those sectors (using a tool like hdparm) and finally let md resync the data to the disk that now will ignore the bad sectors by readding the drive to the raid.

    Doing 2.2 takes also a long time (because of the resync), but the RAID will be as good as new afterwards. You have to mark the drive as failed and remove the drive from the raid (using mdadm), power down the system, physically replace the disk, start the system, partition the drive if you have to (using fdisk), add the replacement drive to the raid (with mdadm). The raid should start the resync automatically.

    Good luck!

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts