Can you see if the switches have been activated from within the OS? On my server I have a script that runs every minute which checks a bunch of things and if certain conditions are met it unmounts and locks the disks, you could do something like that.
If your motherboard doesn’t have a way of interfacing with these switches you could use an arduino or something like that and just have a service running which monitors it and runs the unmount script when the switches are opened. You could simply use your sudo password to enable or disable the service or you could add some other kind of password system to it. If you wanted to physically activate/deactivate it then maybe a key switch or something like that.