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>
Kokizzu
  • 209
  • 1
  • 2
  • 12

2 Answers2

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.

Vinícius Ferrão
  • 5,520
  • 11
  • 55
  • 95
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
Baruch Even
  • 1,073
  • 6
  • 18