diff --git a/hwmonDaemon.py b/hwmonDaemon.py index 3a429c0..f67cfa5 100644 --- a/hwmonDaemon.py +++ b/hwmonDaemon.py @@ -285,10 +285,13 @@ class SystemHealthMonitor: :param device_path: Path to the device :return: Boolean indicating if it's a relevant physical disk """ + # Strip partition numbers to get base device + base_device = re.sub(r'\d+$', '', device_path) + excluded_mounts = ['/boot', '/boot/efi'] if any(device_path.startswith(mount) for mount in excluded_mounts): return False - return bool(re.match(r'/dev/(sd[a-z]|nvme\d+n\d+|mmcblk\d+)', device_path)) + return bool(re.match(r'/dev/(sd[a-z]|nvme\d+n\d+|mmcblk\d+)$', base_device)) def _check_smart_health(self, device: str) -> Dict[str, Any]: """