Problem/Justification
(What is the problem you are trying to solve with this feature/improvement or why should it be considered?)
When you use LSI HBA cards in IT mode, like many users who run TrueNAS do, by default, from my own testing with Toshiba MG09 series drives, when the system is properly shut down, the LSI controller do not seem to send a command to the disks to spindown, which causes them to perform “Emergency Unload”, that is, turn off as if you yanked the power cord out of the system with an audible “click”. This can be confirmed by running sudo smartctl -x /dev/sdX on a given X drive and checking the Number of High Priority Unload Events count, which should increment after a shutdown.
According to Toshiba’s spec document for the drive model I have:
An Emergency Unload is mechanically much more stressful to this drive than a
controlled Unload … Emergency Unload should only be performed when it is not possible to perform a controlled Unload.
Therefore it would be preferred if there was an option OOTB to override the default and let the system manage disk spin down on shutdown.
More than that, from my testing, runtime spindown isn’t driver controlled either, meaning that drives will never spindown due to inactivity.
On my own system, to resolve these issues, I run 2 INIT scripts:
for i in /sys/class/scsi_disk/*/manage_system_start_stop; do echo 1 > $i; done
for i in /sys/class/scsi_disk/*/manage_runtime_start_stop; do echo 1 > $i; done
With these, drives seem to (audibly) properly park and spindown, and `Number of High Priority Unload Events` stops incrementing as well.
The option can be added to the Edit Disk menu from the Disks page under Power Management tab, and called something like Force system managed spindown, which would set the start_stop options i’ve listed above for a given drive.
From what I’ve seen, SATA controllers that are integrated on motherboards do not seem to suffer from this, and only LSI HBAs are impacted. I also can’t confirm whether other vendors are impacted, but I would assume so.
Impact
Given that at lest 1 manufacturer explicitly advice against doing Emergency unloads on drives if possible, I think it would be sensible to provide users with LSA HBAs an OOTB option to prevent them from happening unnecessarily. This would (in theory) extend longevity of the drives if you shutdown your TrueNAS a lot which we can all agree is a good thing.
And of course, it should be turned off by default to not mess with existing setups that are not impacted.
User Story
I figure just having this simple box option in Edit Disk and documenting the situation with LSI HBAs somewhere should be enough.