Alternative to badblocks

Tell us your most wanted new features, or recommendation.
Post Reply
User avatar
dhfh522
Posts: 15
Joined: 23 Mar 2023, 22:53

Alternative to badblocks

Post by dhfh522 »

Could a quick read check be implemented as an alternative to doing a full badblock scan?

Alternatives
Since badblocks was originally written to verify floppy disks, its design isn’t construed for modern HDD drives. With sizes such as 18 TB drives, even the regular tip to use -b 4096 won’t help anymore. This is an alternative: Span a crypto layer above the device:

# cryptsetup open /dev/device name --type plain --cipher aes-xts-plain64
Fill the now opened decrypted layer with zeroes, which get written as encrypted data:

# shred -v -n 0 -z /dev/mapper/name
Compare fresh zeroes with the decrypted layer:

# cmp -b /dev/zero /dev/mapper/name
If it just stops with a message about end of file, the drive is fine. This method is also way faster than badblocks even with a single pass.
Setup:
TOS 5.1.37
T9-423(16GB)
1 x Intel 1Tb 670P Hyper-Cache
9 x 3TB HGST Ultrastar 7K4000
8 - members in TRaid array, 1 - Hot Spare
1 Storage pool with 2 Volumes
Backup
D5-300C
4x14TB ST14000NM0018 in TRaid array
1 Storage pool with 1 volume
Post Reply