DBrocks
September 29th, 2009, 03:40 PM
Hey guys,
I am setting up a server at my house with 4x1tb in RAID6, with the possibility of expanding in the future. (Ubuntu software RAID with mdadm).
I know that sometimes RAID rebuilds can fail if, during the rebuild process, a bad block is encountered. This bad block travels up the chain of command, until the RAID controller (mdadm in this case), marks the drive as failed and drops the drive during the rebuild. I am using RAID 6, so I have a bit better security then RAID 5. However, with the rate hard drive capacity is expanding these days, bad blocks are becoming an unfortunate, and usually unpreventable, fact of storage. When I add another 2X1 TB drives in the not-too-distant future, that's 6 TB for bad blocks to be found on. I want to know how, to scan for bad blocks, and repair/remap them in the array, so the array rebuild will not fail due to bad blocks. (I know it can still fail if there is a mechanical failure, but re-mapped bad blocks is another variable removed). The array is separate from my OS, so unmounting it to fix the blocks is not a problem. Give me a hand, I'm stuck on this one!
I dug up some code from a site that said to do this:
Identify bad Block: badblocks /dev/hda1 > badblocks
To repair blocks: fsck -t ext3 -| badblocks /dev/hda1
How would I do this on RAID? Do I use /dev/hda1 (and all the other drives), or do I do /dev/md0 (the array?)
I am setting up a server at my house with 4x1tb in RAID6, with the possibility of expanding in the future. (Ubuntu software RAID with mdadm).
I know that sometimes RAID rebuilds can fail if, during the rebuild process, a bad block is encountered. This bad block travels up the chain of command, until the RAID controller (mdadm in this case), marks the drive as failed and drops the drive during the rebuild. I am using RAID 6, so I have a bit better security then RAID 5. However, with the rate hard drive capacity is expanding these days, bad blocks are becoming an unfortunate, and usually unpreventable, fact of storage. When I add another 2X1 TB drives in the not-too-distant future, that's 6 TB for bad blocks to be found on. I want to know how, to scan for bad blocks, and repair/remap them in the array, so the array rebuild will not fail due to bad blocks. (I know it can still fail if there is a mechanical failure, but re-mapped bad blocks is another variable removed). The array is separate from my OS, so unmounting it to fix the blocks is not a problem. Give me a hand, I'm stuck on this one!
I dug up some code from a site that said to do this:
Identify bad Block: badblocks /dev/hda1 > badblocks
To repair blocks: fsck -t ext3 -| badblocks /dev/hda1
How would I do this on RAID? Do I use /dev/hda1 (and all the other drives), or do I do /dev/md0 (the array?)