LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Bad Sectors on mdadm Raid 5 array (https://www.linuxquestions.org/questions/linux-general-1/bad-sectors-on-mdadm-raid-5-array-826200/)

The Jester 08-14-2010 09:23 AM

Bad Sectors on mdadm Raid 5 array
 
Hi all,

I'm running a Debian homeserver, with a 3-disk (1GB each) raid 5 array using mdadm (the OS is on a separate disk).
Now, smartmontools noticed some bad sectors on one of the disks, and I'm not sure what to do next (except for backup of valuable data).
I found some articles on how to fix these sectors, but I'm unaware what the result on the whole array will be.
What to do? Thanks in advance!

(I'm not a linux expert, just started tinkering with it a few months ago).

xeleema 08-15-2010 01:59 AM

Greetingz!

Well, for starters I would have to strongly suggest that if you have *anything* important on the arry, you should have already made a backup.
As for taking care of the bad sectors; you should just be able to unmount (for safety) the filesystem(s) on the RAID5, then run a full fsck to pickup and remap any bad sectors.

If that doesn't work, then as long as you're sure which device is reporting the problem, you could rip it out of the RAID5, reformat it, then add it back. By "reformat" it, I specifically mean run mkfs on it, then do a full fsck on the disk (check the man page for the options you will need).

If you're new to Linux, then I'd like to pass on one major tip:

Read the "man" pages for the various commands you see used in your google results. Not every Linux distrbution behaves the *exact* same way (For example: Red Hat-based distros vs Debian-based ones).

One more thing; Grab O'reily's "Essential System Administration, Third Edition", it'll give you a great start on some of the "Common Good Practise" things that make UNIX/Linux system administration really easy.

Good Luck!

P.S: If this helps, click the "Thanks" button on the bottom-right of this post.

xeleema 08-17-2010 06:44 AM

The_Jester,
Thank you for marking the post as "[SOLVED]". However, I was wondering what exactly the solution was?
If I helped, I'd really appreciate a little click on that "Thanks" button in the bottom right-hand corner of whichever post happened to help out the most. ;)

Have a good one!

The Jester 08-17-2010 07:13 AM

xeleema, I'd really want to, but I don't see a thanks button (only a quote).

What I did was mark the drive as faulty, removed it from the mdadm-array. Then formatted it and let the array rebuild overnight.
No errors reported yet.

tg1000 08-21-2010 05:47 AM

Hi!

I've got a similar problem. Running Ubuntu with a 6-disk mdadm raid5 array (OS on different drive). Yesterday, two of the disks started reporting bad sectors (and the raid, of course, is not able to assemble with two disks missing):

root@sandman:~# smartctl -a /dev/sdf
<...>
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed: read failure 10% 4383 2930270838
<...>

...and the same for /dev/sdg.

I've read a bit of this howto: smartmontools.sourceforge.net/badblockhowto.html
but I'm not sure how to apply this on a mdadm raid.
Is there _any_ way to remove the bad sectors on raid drives and remount the raid without losing _all_ of the data?

Edit: both disks report LBA_of_first_error 2930270838, strange coincidence?


All times are GMT -5. The time now is 06:27 PM.