如何加速坏块

如何加速坏块

它已经存在50h,而且只是0.04%其中一种方式...如果我的数学是正确的,那么它将在一个又一个之后完成2,000,000h(不是真正的数学)

hutber@hutber:~$ badblocks -svw -b 4096 -c 200000 /dev/sda -o bb_sdc.txt
Checking for bad blocks in read-write mode
From block 0 to 1953506645
Testing with pattern 0xaa:   0.04% done, 50:47:27 elapsed. (0/783975/0 errors)

有没有什么方法可以让我运行它而不用花太长时间?

答案1

正确的破坏磁盘块的一种方法就是使用e2fsck,而不是badblocks直接使用。man badblocks有关详细信息,请参阅...

强烈建议用户不要直接运行 badblocks,而是使用 e2fsck 和 mke2fs 程序的 -c 选项

注意:不要中止坏块扫描!

注意:不要对 SSD 造成坏块

注意:请先备份您的重要文件!

注意:这将花费很多小时

注意:您可能面临硬盘故障

在“尝试 Ubuntu”模式下启动 Ubuntu Live DVD/USB。

terminal...

sudo fdisk -l# 识别所有“Linux 文件系统”分区

sudo e2fsck -fcky /dev/sdXX# 只读测试

或者

sudo e2fsck -fccky /dev/sdXX# 非破坏性读写测试(受到推崇的)

-k 很重要,因为它会保存之前的坏块表,并将任何新的坏块添加到该表中。如果没有 -k,您将丢失所有之前的坏块信息。

-fccky 参数...

   -f    Force checking even if the file system seems clean.

   -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 direc‐
         tory.  If this option is specified twice, then the bad block scan
         will be done using a non-destructive read-write test.

   -k    When combined with the -c option, any existing bad blocks in the
         bad blocks list are preserved, and any new bad blocks found by
         running badblocks(8) will be added to the existing bad blocks
         list.

   -y    Assume an answer of `yes' to all questions; allows e2fsck to be
         used non-interactively. This option may not be specified at the
         same time as the -n or -p options.

答案2

在更改默认变量之前,您应该了解它们的作用。

你的问题在这里:

-b 4096 -c 200000

表明你做错了的是:

(0/783975/0 个错误)

您要求驱动器每次写入和读取 781MB(200000次4096)。这超出了任何 SOHO 驱动器的能力,甚至大多数企业驱动器也无法处理这种情况。这些选项用于优化不常见的驱动器。有些驱动器会受到总线瓶颈的影响,有些驱动器会受到技术限制。安装这些选项可以在更快的速度下实现更好的精度 - 您只是走了相反的方向。

以下是这两者背后的解释(man badblocks):

-b block_size 指定块的大小(以字节为单位)。默认值为 1024。

-c 块数是一次测试的块数。默认值为 64。

关于在 SSD 上使用坏块,没有理由永远不这样做。只是不要无缘无故地这样做。SSD 的使用寿命有限,并且不是块设备。这意味着您无法获得 NAND 的实际块信息,而只是测试驱动器填充数据的能力。

相关内容