diff --git a/scripts/wk/clone/ddrescue.py b/scripts/wk/clone/ddrescue.py index ae5d0220..8d58613f 100644 --- a/scripts/wk/clone/ddrescue.py +++ b/scripts/wk/clone/ddrescue.py @@ -30,6 +30,7 @@ from wk.cfg.ddrescue import ( from wk.hw import disk as hw_disk from wk.hw.smart import ( check_attributes, + enable_smart, smart_status_ok, update_smart_details, ) @@ -775,6 +776,12 @@ class State(): source_parts = select_disk_parts(self.mode, self.source) self.add_image_block_pairs(source_parts) + # Update SMART data + ## TODO: Verify if needed + for dev in (self.source, self.destination): + enable_smart(dev) + update_smart_details(dev) + # Safety Checks #1 if self.mode == 'Clone': self.safety_check_destination() diff --git a/scripts/wk/hw/diags.py b/scripts/wk/hw/diags.py index 2c1fa61b..7a673c45 100644 --- a/scripts/wk/hw/diags.py +++ b/scripts/wk/hw/diags.py @@ -171,6 +171,9 @@ class State(): # Add HW Objects self.system = hw_system.System() self.disks = hw_disk.get_disks(skip_kits=True) + for disk in self.disks: + hw_smart.enable_smart(disk) + hw_smart.update_smart_details(disk) # Add test objects for name, details in menu.options.items(): diff --git a/scripts/wk/hw/disk.py b/scripts/wk/hw/disk.py index 659a6bc1..eaea2fbf 100644 --- a/scripts/wk/hw/disk.py +++ b/scripts/wk/hw/disk.py @@ -16,10 +16,8 @@ from wk.cfg.python import DATACLASS_DECORATOR_KWARGS from wk.exe import get_json_from_command, run_program from wk.hw.test import Test from wk.hw.smart import ( - enable_smart, generate_attribute_report, get_known_disk_attributes, - update_smart_details, ) from wk.std import PLATFORM, color_string, strip_colors @@ -64,15 +62,11 @@ class Disk: self.update_details() self.set_description() self.known_attributes = get_known_disk_attributes(self.model) - enable_smart(self) - update_smart_details(self) 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 - enable_smart(self) - update_smart_details(self) 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')