Add badblocks support for drives over 16TB
This commit is contained in:
parent
2706d1a9a5
commit
166ad3198c
2 changed files with 4 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ ATTRIBUTE_COLORS = (
|
||||||
('Maximum', 'PURPLE'),
|
('Maximum', 'PURPLE'),
|
||||||
)
|
)
|
||||||
# NOTE: Force 4K read block size for disks >= 3TB
|
# NOTE: Force 4K read block size for disks >= 3TB
|
||||||
|
BADBLOCKS_EXTRA_LARGE_DISK = 15 * 1024**4
|
||||||
BADBLOCKS_LARGE_DISK = 3 * 1024**4
|
BADBLOCKS_LARGE_DISK = 3 * 1024**4
|
||||||
BADBLOCKS_REGEX = re.compile(
|
BADBLOCKS_REGEX = re.compile(
|
||||||
r'^Pass completed, (\d+) bad blocks found. .(\d+)/(\d+)/(\d+) errors',
|
r'^Pass completed, (\d+) bad blocks found. .(\d+)/(\d+)/(\d+) errors',
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import logging
|
||||||
from subprocess import STDOUT
|
from subprocess import STDOUT
|
||||||
|
|
||||||
from wk.cfg.hw import (
|
from wk.cfg.hw import (
|
||||||
|
BADBLOCKS_EXTRA_LARGE_DISK,
|
||||||
BADBLOCKS_LARGE_DISK,
|
BADBLOCKS_LARGE_DISK,
|
||||||
BADBLOCKS_REGEX,
|
BADBLOCKS_REGEX,
|
||||||
BADBLOCKS_RESULTS_REGEX,
|
BADBLOCKS_RESULTS_REGEX,
|
||||||
|
|
@ -68,6 +69,8 @@ def run_scan(test_obj, log_path, test_mode=False) -> None:
|
||||||
test_obj.set_status('Working')
|
test_obj.set_status('Working')
|
||||||
|
|
||||||
# Increase block size if necessary
|
# Increase block size if necessary
|
||||||
|
if dev.size >= BADBLOCKS_EXTRA_LARGE_DISK:
|
||||||
|
block_size = '8192'
|
||||||
if (dev.phy_sec == 4096
|
if (dev.phy_sec == 4096
|
||||||
or dev.size >= BADBLOCKS_LARGE_DISK):
|
or dev.size >= BADBLOCKS_LARGE_DISK):
|
||||||
block_size = '4096'
|
block_size = '4096'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue