1

Without RAID-0, I usually check bad sectors using this command:

fsck -yvckfC -E fragcheck /dev/sdX

How to check bad sectors when the harddisk was using RAID-0? should I run it for each drive? /dev/sdb and /dev/sdc or using information from /proc/mdstat ?

# cat /proc/mdstat 
Personalities : [linear] [raid0] [raid1] 
md1 : active raid0 sda2[0] sdb2[1]
      7808789888 blocks 64k chunks

md0 : active raid1 sdb1[1] sda1[0]
      524224 blocks [2/2] [UU]

unused devices: <none>
4
  • Why are you using RAID 0?
    – EEAA
    Apr 19, 2014 at 4:31
  • 1
    because it's faster than JBOD (I'm using NAS to backup my files, ShareCenter DNS-320)
    – Kokizzu
    Apr 19, 2014 at 4:32
  • So you have doubled the chance of losing all your backups to gain a bit of speed?
    – Grant
    Apr 21, 2014 at 0:02
  • yes, I am a speed freak..
    – Kokizzu
    Apr 22, 2014 at 4:12

2 Answers 2

2

Bad block check must be done in the disk device itself, since you are using mdadm RAID you should stop the array and run checks on /dev/sda2 and /dev/sdb2.

But before doing this, if you value your data I do recommend a backup, the possibility of losing the entire RAID-0 array exists.

1

What I'd do in such a case is to simply use find, xargs and cat to read the entire disk content and if anything fails you lost data and will need to recover it. But this way you will immediately know which file lost data or which directory is lost. If you just use badblocks it will tell you a sector but not what to do to recover from the failure.

find . -type f | xargs -IX cat X

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .