The LSI Megaraid controller has a Battery back up for its write cache, which allows, in the event of an unanticipated power outage, to retain the cached, not yet written data, so it can write it out to disk next time the server is booted up. In the event of a clean shutdown, this back up is presumably not necessary, as part of the clean shutdown will involve the controller writing out the cached data to disk.
How does the raid controller get informed that the shutdown is about to happen? Presumably this flush must be the last thing to occur after other OS shutdown code, which might involve writing out data or logs to the raid.
Is there some PCIe level signalling that informs peripherals of a pending power down? Does the Megaraid_sas kernel module inform the card of the pending shutdown? Or does a MegaCli
command to flush the cache need to be run from an init script for the shutdown?
I've manually added a Megaraid card and additional set of drives to a Linux system which was installed without one, and want to be sure that I don't need to manually add something in to guarantee the cache is consistent on shutdown.