Drop sat,auto detection for smartctl

This was needed twofold.  First is that it was not working as expected
for some time.  Second is that it conflicts with the delayed attribute
updating needed for faster WKClone menus.
This commit is contained in:
2Shirt 2023-07-05 14:57:54 -07:00
parent d6f3455236
commit 7499639c5c
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
2 changed files with 2 additions and 8 deletions

View file

@ -56,18 +56,12 @@ class Disk:
ssd: bool = field(init=False)
tests: list[Test] = field(init=False, default_factory=list)
trim: bool = field(init=False)
use_sat: bool = field(init=False, default=False)
def __post_init__(self):
self.path = pathlib.Path(self.path_str).resolve()
self.update_details()
self.set_description()
self.known_attributes = get_known_disk_attributes(self.model)
if not self.attributes and self.bus == 'USB':
# Try using SAT
LOG.warning('Using SAT for smartctl for %s', self.path)
self.notes = []
self.use_sat = True
self.initial_attributes = copy.deepcopy(self.attributes)
if not self.is_4k_aligned():
self.add_note('One or more partitions are not 4K aligned', 'YELLOW')

View file

@ -104,7 +104,7 @@ def enable_smart(dev) -> None:
cmd = [
'sudo',
'smartctl',
f'--device={"sat,auto" if dev.use_sat else "auto"}',
'--device=auto',
'--tolerance=permissive',
'--smart=on',
dev.path,
@ -461,7 +461,7 @@ def update_smart_details(dev) -> None:
cmd = [
'sudo',
'smartctl',
f'--device={"sat,auto" if dev.use_sat else "auto"}',
'--device=auto',
'--tolerance=verypermissive',
'--all',
'--json',