Add badblocks support for drives over 16TB

This commit is contained in:
2Shirt 2022-10-23 13:31:37 -07:00
parent 2706d1a9a5
commit 166ad3198c
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
2 changed files with 4 additions and 0 deletions

View file

@ -15,6 +15,7 @@ ATTRIBUTE_COLORS = (
('Maximum', 'PURPLE'),
)
# NOTE: Force 4K read block size for disks >= 3TB
BADBLOCKS_EXTRA_LARGE_DISK = 15 * 1024**4
BADBLOCKS_LARGE_DISK = 3 * 1024**4
BADBLOCKS_REGEX = re.compile(
r'^Pass completed, (\d+) bad blocks found. .(\d+)/(\d+)/(\d+) errors',

View file

@ -6,6 +6,7 @@ import logging
from subprocess import STDOUT
from wk.cfg.hw import (
BADBLOCKS_EXTRA_LARGE_DISK,
BADBLOCKS_LARGE_DISK,
BADBLOCKS_REGEX,
BADBLOCKS_RESULTS_REGEX,
@ -68,6 +69,8 @@ def run_scan(test_obj, log_path, test_mode=False) -> None:
test_obj.set_status('Working')
# Increase block size if necessary
if dev.size >= BADBLOCKS_EXTRA_LARGE_DISK:
block_size = '8192'
if (dev.phy_sec == 4096
or dev.size >= BADBLOCKS_LARGE_DISK):
block_size = '4096'