You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to add hotplug disk detection to smartd. If there are disks defined in smartd.conf that are removable, say in an USB-(S)ATA enclosure, it would be useful to apply any '-e' configuration options when they are plugged in. Also to restart monitoring when plugged even if they weren't present when smartd started (this may already work with '-d removable', not sure - '-e' definitely does not).
Say if I have a line in smartd.conf /dev/disk/by-id/usb-Example_Disk-0:0 -d removable -e standby,48
I would expect the standby timeout setting to be applied whenever the disk is hotplugged, as the setting is volatile, the disk does not remember it.
As this currently isn't possible, I had to resort to a workaround using a udev rule: ACTION=="add", SUBSYSTEM=="block", ENV{ID_USB_TYPE}=="disk", ENV{ID_ATA_ROTATION_RATE_RPM}=="?*", ENV{ID_ATA_ROTATION_RATE_RPM}!="0", RUN+="/usr/bin/hdparm -S 48 $devnode"
This will apply the standby timeout setting to all USB disks with a non-zero rotation rate, hopefully this will exclude any flash and SSD drives.
The text was updated successfully, but these errors were encountered:
This is a really long standing request, see ticket 60.
The following enhancement may work:
Add a -d replaceable or -d hotplug directive for smartd.conf.
If specified and the device is missing, behave like existing -d removable.
If specified and the device is present, re-check the device identity after each device open(). This needs to be implemented separately for ATA, SCSI and NVMe.
If device identity has changed, ignore the device during this check cycle and trigger a smartd reload before next check cycle.
Pros:
It does not require platform specific code.
Cons:
It may not be safe to use if the device type could change (e.g. SATA<=>SAS behind SAS controller, SATA<=>NVMe behind USB bridge).
It does not detect newly added devices if DEVICESCAN is used.
It would be nice to add hotplug disk detection to smartd. If there are disks defined in smartd.conf that are removable, say in an USB-(S)ATA enclosure, it would be useful to apply any '-e' configuration options when they are plugged in. Also to restart monitoring when plugged even if they weren't present when smartd started (this may already work with '-d removable', not sure - '-e' definitely does not).
Say if I have a line in smartd.conf
/dev/disk/by-id/usb-Example_Disk-0:0 -d removable -e standby,48
I would expect the standby timeout setting to be applied whenever the disk is hotplugged, as the setting is volatile, the disk does not remember it.
As this currently isn't possible, I had to resort to a workaround using a udev rule:
ACTION=="add", SUBSYSTEM=="block", ENV{ID_USB_TYPE}=="disk", ENV{ID_ATA_ROTATION_RATE_RPM}=="?*", ENV{ID_ATA_ROTATION_RATE_RPM}!="0", RUN+="/usr/bin/hdparm -S 48 $devnode"
This will apply the standby timeout setting to all USB disks with a non-zero rotation rate, hopefully this will exclude any flash and SSD drives.
The text was updated successfully, but these errors were encountered: