我有一个 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)
似乎已经为坏块制作了一个补丁来添加此特定限制。请参阅此处,标题为: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
是 e2fsprogs 代码库的一部分。git repo在这里可用。看起来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.
Run Code Online (Sandbox Code Playgroud)- Ted
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.
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.