2

Is there a method for scanning all of the devices in a raid-z array for bad sectors (blocks) simultaneously or must this be performed on a device-by-device basis with a separate drive testing application?

So far scrub just doesn't seem to scan everything since there's effectively no data.

ylluminate
  • 1,155
  • 2
  • 17
  • 35
  • What do you mean exactly by "bad blocks"? Broken sectors? – mzhaase May 08 '17 at 07:28
  • Yes, usually blocks and sectors are used interchangeably anymore with sectors being used more for Windows machines and blocks being used for *nix machines. I understand that sectors are really the more accurate term in that it is generally a smaller component while blocks are generally more aggregate, yet since I was talking about a Unix-based system in this case, I decided to use the more colloquially accepted term of block vs sector. Note also I have begun scanning drives with a 3rd party utility, but have still been curious if ZFS has a method to do this. – ylluminate May 08 '17 at 13:58
  • 1
    Why? What's the purpose here? – ewwhite May 08 '17 at 14:00

1 Answers1

2

ZFS does not have methods to scan unassigned blocks, because it serves no direct purpose:

  • If you have deleted data and want to recover it, you can access the low-level features with zdb. There are also some scripts on the web that try to scrape for usable data on a destroyed pool, although the easier way would be to have backups.
  • If you assume that your drive is faulty (high read/write error counts or weird noises), you generally replace it right away, because the data is more valuable than a single spare drive. If you really don't have much budget, you could scan/verify the disk with low-level tools from the drive manufacturer to detect bad sectors and mark them unusable. Of course, this might result in a smaller disk which may be too small for your existing pool. Also, while scanning without a replacement your pool may be vulnerable depending on layout (mirror, raidz1).
  • If you do not care about the unassigned blocks, there is no need to examine if they have changed. One could argue that hidden errors could accumulate on sparsely used disks, but this use case is not the majority - after all, if you never fill your pools, you could have bought smaller disks (or more of them).
user121391
  • 2,502
  • 13
  • 31