Score:0

How to automatically turn off write cache after the kernel "hard resetting link"

cn flag

I turned off write caching on an SATA drive using hdparm -W0 $DEV

Now, sometimes, the kernel decides, it's a good idea to hard reset an SATA link in order to get communication to a drive back up and running (maybe it is a good idea, won't judge it here).

However, if that happens, the drive's write cache will be re-enabled. Upon plugging in, I can catch an udev event to automatically run hdparm to turn off the write cache.

But I can't find any information about how to catch this hard resetting link events to fire up hdparm again (or make sure the write cache is disabled again by some other means).

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.