Created
October 12, 2015 14:51
-
-
Save Enzime/ae35ee30c3f4d3ac42c4 to your computer and use it in GitHub Desktop.
Hacky solution to use systemd-automount to always mount an external HDD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SUBSYSTEM=="block", ENV{ID_FS_UUID}=="548C310362B58070", ACTION=="add", SYMLINK+="ext", RUN+="/bin/systemctl daemon-reload", RUN += "/bin/systemctl start mnt-ex.automount" | |
SUBSYSTEM=="block", ENV{ID_FS_UUID}=="548C310362B58070", ACTION=="remove", RUN+="/bin/systemctl stop mnt-ex.automount" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UUID=548C310362B58070 /mnt/ex ntfs rw,uid=1000,gid=1000,dmask=027,fmask=137,nofail,x-systemd.device-timeout=1,x-systemd.automount,noauto 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Fix mnt-ex.automount hanging on startup | |
After=local-fs.target | |
[Service] | |
ExecStart=/bin/bash -c "[ ! -b /dev/ext ] && systemctl stop mnt-ex.automount" | |
[Install] | |
WantedBy=local-fs.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment