badblocks 只接受 32 位整数作为开始/结束值

Mar*_*son 6 badblocks

我有一个 4TB 驱动器,块大小为 4096 字节。我想检查一组非常具体的块,大约第 700,000,000 个块左右是否有坏扇区。

然而,badblocks似乎只支持int32作为停止和开始块计数,这意味着我不可能指定这个范围的块。

有没有另一种方法可以扫描这个驱动器的坏块?我不想等待 7 个小时来测试整个驱动器。它是来自mdadm阵列的单个驱动器,因此它不包含可用的文件系统。

Ian*_*len 12

告诉badblocks使用更大的块大小,它会在 2TB 以上工作。我在 WD 6TB 驱动器上使用了它:

badblocks -b 4096 -v /dev/sda
Run Code Online (Sandbox Code Playgroud)

  • 请注意,这意味着报告为错误的块 ID 对于 mkfs 无效。您需要使用与设备的块大小匹配的“-b”。 (2认同)
  • 这只会延迟问题的出现,直到您获得超过 17.6 TB 的驱动器(或阵列) (2认同)

slm*_*slm 6

将坏块限制为 2^32 的补丁

似乎已经为坏块制作了一个补丁来添加此特定限制。请参阅此处,标题为:Re: [PATCH 04/25] libext2fs: reject 64bit badblocks numbers

From: "Darrick J. Wong" <darrick.wong <at> oracle.com>
Date: Wed, 23 Oct 2013 19:43:32 -0400
Subject: [PATCH] libext2fs: reject 64bit badblocks numbers

Don't accept block numbers larger than 2^32 for the badblocks list,
and don't run badblocks on them either.

Signed-off-by: Darrick J. Wong <darrick.wong <at> oracle.com>
Signed-off-by: Theodore Ts'o <tytso <at> mit.edu>
Run Code Online (Sandbox Code Playgroud)

不会向坏块添加支持?

看起来badblocks在可预见的未来也不会具有此功能。

摘录 -回复:[PATCH 18/31] libext2fs:坏块应该正确处理 48 位块号

Yeah, I think badblocks is vestigal at this point, and for huge disk arrays, almost certainly block replacement will be handed at the LVM, storage array, or HDD level. So it might be better simply to have mke2fs throw an error if there is an attempt to hand it a 64-bit block number.

                      - Ted
Run Code Online (Sandbox Code Playgroud)

Some other way to do this?

I searched in vain to find some fork of badblocks or an alternative to it, but found really nothing. Your only options are to make use of a commercial tool such as SpinRite or the open source tool HDAT2. You could also use one of the many drive fitness tools (DFTs) that are provided by the HDD manufacturers. Perhaps one of these would allow for you to push past the 2^32 barrier.

What to do?

Of the options on the table I've had good success with HDAT2 and SpinRite, so I'd likely use them in that order to try and scan this region of blocks that's at the 700M range.