99-usb-sata-write-cache.rules
Files / usb-ssd-pi5 / 99-usb-sata-write-cache.rules
Files in usb-ssd-pi5/
Directoryusb-ssd-pi5/
- 99-usb-sata-write-cache.rules 1.0 KB
- LICENSE 1.0 KB
From Add a USB SSD to a Raspberry Pi 5 running Home Assistant OS. MIT licence: LICENSE.
# USB drives whose USB chip hides the drive's write cache, so Linux stops sending cache flushes:# - UGREEN USB-SATA adapters (Realtek RTL9201, 0bda:9201) with UAS off (usb-storage.quirks=0bda:9201:u# in cmdline.txt) report the drive's write cache as off.# - WD Elements Portable 2 TB (1058:1048, WD's own chip) has no caching mode page, so the kernel# assumes write through.# The drives keep their cache on (smartctl -g wcache), so an fsync could sit in the drive's cache and be# lost in a power cut. "temporary" changes only the kernel's view: it sends flushes again, nothing is# written to the drive. See raspberry-pi/README.md (UAS off and write cache).# On the Pi: /etc/udev/rules.d/99-usb-sata-write-cache.rules (HAOS keeps it on the overlay partition).ACTION=="add|change", SUBSYSTEM=="scsi_disk", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="9201", ATTR{cache_type}="temporary write back"ACTION=="add|change", SUBSYSTEM=="scsi_disk", ATTRS{idVendor}=="1058", ATTRS{idProduct}=="1048", ATTR{cache_type}="temporary write back"Text, photos and drawings: CC BY 4.0. Code: MIT. Share and adapt them, crediting HomeLab Guides (blog.jacq.cc). Licence and privacy