Remounts external media with sync option
fatal_strategy e7aa2e731c Fix README markdown | 4 years ago | |
---|---|---|
README.md | 4 years ago | |
install.sh | 4 years ago | |
media-remount-syncd | 4 years ago | |
media-remount-syncd.service | 4 years ago | |
remove.sh | 4 years ago |
In GNU/Linux distros everything is mounted with write caching enabled by default. This causes some nuissances with external storage devices:
media-remount-syncd
is an experimental workaround for the issues
above.
It is a simple shell script that runs in the background as a systemd
service and automatically remounts any new mounts in the /media
directory with the sync option, which disables write caching. It uses
findmnt --poll=mount
to detect new mounts, then remounts them using
mount -o remount,sync
.
sudo ./install.sh
Plug-in (and mount) some external storage device, then run:
systemctl status media-remount-syncd.service
The output should contain "mount -o remount,sync" log lines.
sudo ./remove.sh