Hacker News new | ask | show | jobs
by teddyfrozevelt 1855 days ago
Fair. I think it's because systemd lets you use slashes in unit names, but you can't represent those as files so you have to use a dash instead. This is the worst for the root filesystem mounted at / since that's the entire name. In systemd's defense, it warns you when you try systemctl status the normal way.

  Hint: to specify units starting with a dash, use "--":
        systemctl [OPTIONS...] COMMAND -- -.mount ...
I found my mount names by running systemctl list-units, so it's not something I had to look up.
1 comments

You can use systemd-escape(1) to have it generate the correct unit name for you, e.g.: systemctl status $(systemd-escape --path /home --suffix mount) Yeah, complicated and verbose, but reliable and integrates into systemd mindset very well.