Rin*_*ind 12
在 Linux 中有两种检测坏道的方法:您可以使用磁盘实用程序 (gui),或者您可以使用badblocks命令来检查您的硬盘是否有坏道:
sudo badblocks -v /dev/{device}
Run Code Online (Sandbox Code Playgroud)
这应该可以回答这个问题,但是对于其他对如何标记它们感兴趣的人来说,可以使用 2 个简单的命令来完成...
您将坏块添加到文件中...
sudo badblocks /dev/sdb > {/dir/to/filename}
Run Code Online (Sandbox Code Playgroud)
然后告诉fsck将这些标记为不可用...
sudo fsck -l {/dir/to/filename} /dev/{device}
Run Code Online (Sandbox Code Playgroud)
小智 8
例如使用 fsck.ext3 (e2fsck) 并使用 -cc 选项
-c This option causes e2fsck to use badblocks(8) program to do a read-only scan of the device in order to find any bad
blocks. If any bad blocks are found, they are added to the bad block inode to prevent them from being allocated to a
file or directory. If this option is specified twice, then the bad block scan will be done using a non-destructive
read-write test.`
Run Code Online (Sandbox Code Playgroud)
fsck -cc /dev/sda1
| 归档时间: |
|
| 查看次数: |
8711 次 |
| 最近记录: |