On 10/09/2018 01:49, Don NetBSD wrote:
I'm not concerned with automatically detecting insertion/removal; that's
the job that the operator performs (above) -- along with the tagging of
the media, etc.
I've done a lot of work with SAS disk enclosures that support SES. They
often have an SES command that can turn off the drive in a bay prior to
removal (but support is optional).
But, I'd be concerned about pulling a drive that was still *spinning*.
atactl(8) doesn't seem to work with sd(4) devices. I'll have to see if
drvctl -d spins the drive down as it is disconnected (and maybe a timeout
to ensure the operator doesn't remove the drive before its had a chance
to spin down sufficiently)
A SCSI stop unit command may spin down a SAS disk but its not guaranteed
as it depends on whether or not the SAS HBA or expander is sending the
drive periodic NOTIFY primitives (which trigger drive spinup). What
works with one SAS HBA may not work with a different one.
On a more practical note. As long as you disconnect the drive from the
connector gently and give it 5-10 seconds to spin down before any
significant movement SAS/SATA drives tend to survive removal even if
they are spinning.
In SAS hotplug is not optional. ALL SAS HBAs should support it
regardless of whether the drive is directly plugged in or in some of
drive carrier. I don't know if NetBSD will deal with these events though.
Mike