summarylogtreecommitdiffstats
path: root/99-usb-sync.rules
blob: 68c3a3d2d0b5d6e6f6d290545f587813d51b3358 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# 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"
#
# rules to impose buffer limits on USB devices
# requires kernel > 6.1
# https://docs.kernel.org/admin-guide/abi-testing.html#abi-sys-class-bdi-bdi-strict-limit
# https://docs.kernel.org/admin-guide/abi-testing.html#abi-sys-class-bdi-bdi-max-ratio
# https://docs.kernel.org/admin-guide/abi-testing.html#abi-sys-class-bdi-bdi-max-bytes
# implemented using  /usr/bin/udev-usb-tweak.sh 
# optional configuration in /etc/udev-usb-tweak/udev-usb-tweak.sh
ACTION=="add|change", KERNEL=="sd[a-z]", ENV{ID_USB_TYPE}=="disk", RUN+="/usr/bin/udev-usb-sync %k"