我们希望通过以下方法来识别错误的块或磁盘问题
umount /grid/sdd
badblocks -n -vv /dev/sdd
Checking for bad blocks in non-destructive read-write mode
From block 0 to 20971519
Checking for bad blocks (non-destructive read-write test)
Testing with random pattern: 14.38% done, 2:46 elapsed. (0/0/0 errors)问题是,验证需要很长的时间,如果我们有5T的磁盘,那么需要超过30小时。
还有其他更快的选择或工具吗?
用20G检查磁盘,其工具为30分钟。
badblocks -n -vv /dev/sdd
Checking for bad blocks in non-destructive read-write mode
From block 0 to 20971519
Checking for bad blocks (non-destructive read-write test)
Testing with random pattern: done
Pass completed, 0 bad blocks found. (0/0/0 errors)发布于 2019-01-15 19:35:10
首先,您可以使用破坏性( badblocks )模式(而不是非破坏性-n)将运行时间D2减半。
您还可能希望优化块大小和块数:
-b block_size
Specify the size of blocks in bytes. The default is 1024.
-c number of blocks
is the number of blocks which are tested at a time. The default
is 64.块的数量仅限于可用内存。块大小应该与磁盘的块大小相匹配,现在磁盘大小通常为4096。您可以通过以下方法来检查:
lsblk -o NAME,PHY-SeC至于检测磁盘问题,现在常用的方法是智能的。现代磁盘将重新映射正在失败的扇区,它们甚至不会出现在badblocks上。您可以让智能运行它的课程,并不时检查它(smartctl -H /dev/sda),或者您可以强制测试,例如smartctl -t long。此测试不会(或在较小程度上)干扰磁盘的正常操作。换句话说,badblocks被SMART所取代。
https://unix.stackexchange.com/questions/494228
复制相似问题