# How come everything is written when I decide to unmount a usbdrive?

**URL:** <https://forum.endeavouros.com/t/how-come-everything-is-written-when-i-decide-to-unmount-a-usbdrive/37178>\
**Category:** Kernel, boot, graphics & hardware\
**Created:** [February 12, 2023, 10:21am UTC](https://forum.endeavouros.com/t/how-come-everything-is-written-when-i-decide-to-unmount-a-usbdrive/37178 "2023-02-12T10:21:47Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![kwg](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/kwg/32/16326_2.png) [@kwg](https://forum.endeavouros.com/u/kwg)\
**Post date:** [February 13, 2023, 4:03am UTC](https://forum.endeavouros.com/t/how-come-everything-is-written-when-i-decide-to-unmount-a-usbdrive/37178/10 "2023-02-13T04:03:47Z")

</div>

I agree with everyone who has cautioned you not to disable write caching. However, should you _really_ want to do so, here’s the article to read:

[https://wiki.archlinux.org/title/hdparm](https://wiki.archlinux.org/title/hdparm)

In particular, read these sections:

[https://wiki.archlinux.org/title/hdparm#Write\_cache](https://wiki.archlinux.org/title/hdparm#Write_cache)

[https://wiki.archlinux.org/title/hdparm#Persistent\_configuration\_using\_udev\_rule](https://wiki.archlinux.org/title/hdparm#Persistent_configuration_using_udev_rule)

**Warning:** What I write below has not been tested by me, and I may be completely wrong. Experiment at your own risk.

> [@unix\_lover](#):
>
> how would I do this to any USB drive I connect to without having to run this command?

Assuming that you want to disable write caching only for non-rotational drives, my **guess** is that you would do the following…

Create this file:

`/etc/udev/rules.d/69-hdparm.rules`

Then add this code to the file:

`ACTION=="add|change", KERNEL=="sd[a-z]", ATTRS{queue/rotational}=="0", RUN+="/usr/bin/hdparm -W 0 /dev/%k"`

Assuming that you want to disable write caching for all drives, even rotational drives—which would be an even worse idea, in my opinion—my **guess** is that you would add this code instead:

`ACTION=="add|change", KERNEL=="sd[a-z]", RUN+="/usr/bin/hdparm -W 0 /dev/%k"`

---

_[View the full topic](https://forum.endeavouros.com/t/how-come-everything-is-written-when-i-decide-to-unmount-a-usbdrive/37178)._
