You are not logged in.
I have "/usr/lib/systemd/system/mnt-shared.mount" with
[Unit]
Description=/mnt/shared
Wants=rpc-statd.service
After=network.target rpc-statd.service
[Mount]
What=10.0.0.3:/home/shared
Where=/mnt/shared
Type=nfsbut when I reboot the mount never occurs. I have to manually do "systemctl start mnt-shared.mount" every time.
Is there something special I have to do for systemd to use .mount files automatically?
Last edited by boast (2012-07-13 20:43:21)
Asus M4A785TD-V ;; Phenom II X4 @ 3.9GHz ;; Ripjaws 12GB DDR3-1600 ;; 128GB Samsung 830 ;; MSI GTX460 v2 w/ blob ;; Arch Linux + KDE 4.x
Offline
What's wrong with using /etc/fstab?
from the wiki, it says fstab trys to mount before the nfs service is started, so it doesn't work.
Asus M4A785TD-V ;; Phenom II X4 @ 3.9GHz ;; Ripjaws 12GB DDR3-1600 ;; 128GB Samsung 830 ;; MSI GTX460 v2 w/ blob ;; Arch Linux + KDE 4.x
Offline
i simply use autofs
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
In the beginning with systemd I had nfs mounting problems too. But after some extensive testing I found that the fstab mounting was the best with some systemd adjustments.
192.168.1.250:/ /mnt/SERVER_NYTT nfs4 noauto,rw,hard,async,intr,rsize=81920,wsize=81920,_netdev,clientaddr=192.168.1.251,x-systemd.automount 0 0All these options might not suit you but noauto and x-systemd.automount are the important ones. You can test it by doing systemd-analyze blame. With this setup systemd takes care of all the before, after, requires stuff pretty well by itself.
Last edited by swanson (2012-07-13 08:35:50)
Offline
Is there something special I have to do for systemd to use .mount files automatically?
You'll have to enable the unit file with "systemctl enable ..."
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline
boast wrote:Is there something special I have to do for systemd to use .mount files automatically?
You'll have to enable the unit file with "systemctl enable ..."
This won't work because the mount file doesn't have an [Install] section.
@boast : you should put custom unit files into /etc/systemd/system/ , not /usr/lib/systemd/system/. Nevertheless, as mentioned, you should use /etc/fstab instead in this case. I will update the wiki about this.
Offline
great, working now. thanks everyone
Asus M4A785TD-V ;; Phenom II X4 @ 3.9GHz ;; Ripjaws 12GB DDR3-1600 ;; 128GB Samsung 830 ;; MSI GTX460 v2 w/ blob ;; Arch Linux + KDE 4.x
Offline
Well, how?
Offline
Just so it is clear to other users, the solution to having systemd mount your nfs mounts after the network comes up:
nfserver:/exportname /path/to/mount nfs4 defaults,x-systemd.automount 0 0Offline