Skip to content

Instantly share code, notes, and snippets.

@fellipec
Created July 1, 2023 23:42
Show Gist options
  • Save fellipec/1a79435229d214c5bb6727e95cd40d93 to your computer and use it in GitHub Desktop.
Save fellipec/1a79435229d214c5bb6727e95cd40d93 to your computer and use it in GitHub Desktop.
Disable write cache for USB drives in Linux
#/etc/udev/rules.d/99-usb-sync.rules
# rule to disable write cache for usb storage
# requires hdparm to be installed
ACTION=="add|change", KERNEL=="sd[a-z]", ENV{ID_USB_TYPE}=="disk", RUN+="/usr/bin/hdparm -W 0 /dev/%k"
@dimasb69
Copy link

Finalmente!!! meses buscando para solucionar la escritura en cache! de los USB que se quedaban eternamente desmontando!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment