mkfs.vfat -c
对坏块做一个简单的检查。badblocks
以不同的模式运行多次传递,从而检测mkfs.vfat -c
无法捕获的间歇性错误。
mkfs.vfat -l filename
可以从badblocks
. 但是我一直找不到关于如何使用坏块生成文件的示例。
我的猜测是它很简单:
badblocks -w /dev/sde1 > filename
mkfs.vfat -l filename /dev/sde1
Run Code Online (Sandbox Code Playgroud)
但我一直无法证实这一点。是否有权威来源可以确认这一点或解释如何badblocks
用于生成输入mkfs.vfat -l filename
?
来自man badblocks
:
-o output_file
Write the list of bad blocks to the specified file. Without
this option, badblocks displays the list on its standard output.
The format of this file is suitable for use by the -l option in
e2fsck(8) or mke2fs(8).
Run Code Online (Sandbox Code Playgroud)
所以正确的方法是:
badblocks -o filename /dev/sde1
mkfs.vfat -l filename /dev/sde1
Run Code Online (Sandbox Code Playgroud)