I am trying to make my NAS being mounted on boot.
I followed from this forum [root tip] [How To] systemd mount unit samples and [root tip] [How To] Use systemd to mount ANY device with addition of wiki NFS - ArchWiki and landed on:
(changing What= to //192.168.1.173:/volume1/Dyskowicz/ or //192.168.1.173:/Dyskowicz/ doesn’t make a difference, at least for now)
of course in the /etc/systemd/system/ folder.
I have folder /Dyskowicz created in my /mio-chibana user folder and it is empty. Removing it dosen’t change a thing though.
As far as I understand, I can run systemctl show -p ActiveState -p SubState --value home-mio\x2dchibana-Dyskowicz.mount
to check if my file is good, but I get: inactive dead so I am not surprised, when I try sudo systemctl enable home-mio\x2dchibana-Dyskowicz.mount and get Failed to enable unit: Unit file home-miox2dchibana-Dyskowicz.mount does not exist.
The problem is, I really can’t figure out why and what does it mean? What am I doing wrong? I am executing these commands while in /etc/systemd/system/ folder.
Besides which … the slash is the wrong way. Is this somehow intentional?
I’m not sure how to interperet this. Is the user ‘mio-chibana’ ?
In that case this means: /home/mio-chibana/Dyskowitz
Or if you mean in your HOME, and I do not know the username… /home/$USER/mio-chibana/Dyskowitz
Okay, I figured out that I need to use ' with my systemctl show -p ActiveState -p SubState --value home-mio\x2dchibana-Dyskowicz.mount so really systemctl show -p ActiveState -p SubState --value 'home-mio\x2dchibana-Dyskowicz.mount' and so on with the rest of the commands containing my troublesome filename 'home-mio\x2dchibana-Dyskowicz.mount'. So I got active mounted but still after trying sudo systemctl start 'home-mio\x2dchibana-Dyskowicz.mount' I get Job failed. See "journalctl -xe" for details.
journalctl -xe
lis 09 03:56:24 Radiota systemd[1]: home-mio\x2dchibana-Dyskowicz.mount: Deactivated successfully.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░
░░ The unit home-mio\x2dchibana-Dyskowicz.mount has successfully entered the 'dead' state.
lis 09 03:56:24 Radiota sudo[9633]: pam_unix(sudo:session): session closed for user root
lis 09 03:56:33 Radiota dbus-daemon[927]: [system] Activating via systemd: service name='org.freedesktop.home1' unit='dbus-or>
lis 09 03:56:33 Radiota dbus-daemon[927]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.home1.service>
lis 09 03:56:33 Radiota sudo[9654]: mio-chibana : TTY=pts/2 ; PWD=/etc/systemd/system ; USER=root ; COMMAND=/usr/bin/systemct>
lis 09 03:56:33 Radiota sudo[9654]: pam_unix(sudo:session): session opened for user root(uid=0) by mio-chibana(uid=1000)
lis 09 03:56:33 Radiota systemd[1]: Mounting Dyskowicz mount...
░░ Subject: A start job for unit home-mio\x2dchibana-Dyskowicz.mount has begun execution
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░
░░ A start job for unit home-mio\x2dchibana-Dyskowicz.mount has begun execution.
░░
░░ The job identifier is 1827.
lis 09 03:56:33 Radiota mount[9659]: mount.nfs: mounting 192.168.1.173:/Dyskowicz/ failed, reason given by server: No such fi>
lis 09 03:56:33 Radiota systemd[1]: home-mio\x2dchibana-Dyskowicz.mount: Mount process exited, code=exited, status=32/n/a
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░
░░ An n/a= process belonging to unit home-mio\x2dchibana-Dyskowicz.mount has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 32.
lis 09 03:56:33 Radiota systemd[1]: home-mio\x2dchibana-Dyskowicz.mount: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░
░░ The unit home-mio\x2dchibana-Dyskowicz.mount has entered the 'failed' state with result 'exit-code'.
lis 09 03:56:33 Radiota systemd[1]: Failed to mount Dyskowicz mount.
░░ Subject: A start job for unit home-mio\x2dchibana-Dyskowicz.mount has failed
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░
░░ A start job for unit home-mio\x2dchibana-Dyskowicz.mount has finished with a failure.
░░
░░ The job identifier is 1827 and the job result is failed.
lis 09 03:56:33 Radiota sudo[9654]: pam_unix(sudo:session): session closed for user root
I can’t really not use a dash in my folder path, since my user name is mio-chibana, so my home folder is mio-chibana. So I used the workaround from [root tip] [How To] Use systemd to mount ANY device and used touch $(systemd-escape -p --suffix=mount "/home/mio-chibana/Dyskowicz/"), that’s the reason for the wrong slash, the \x2 part in home-mio\x2dchibana-Dyskowicz.
allowed me to finally execute sudo systemctl enable on my file and get the NAS mounted with sudo systemctl start. Though after rebooting it’s not visible in Dolphin file manager, and systemctl show -P ActiveState -P SubState --value 'home-mio\x2dchibana-Dyskowicz.mount' gives failed failed, so it’s is some kind of progress?
sudo systemctl start 'home-mio\x2dchibana-Dyskowicz.mount' does mount it properly. Until now I always used sudo umount -t nfs -o vers=4 192.168.1.173:/volume1/Dyskowicz/ /home/mio-chibana/Dyskowicz/ in terminal after logging in, but I got tired of that, so now I want to make that cli command automatic. I am using laptop and Wi-Fi network connection: from what I gathered _netdev gives systemd information that it should wait for the network before executing the rest of the instructions.