You are not logged in.
Pages: 1
Hi,
i have a mount definition in my fstab.
Unfortunately it only comes up when i give the command " mount -a "
Any idea why it is not during boot?
Thanks in advance
Offline
Yes, it's not correct.
...
https://bbs.archlinux.org/viewtopic.php?id=57855
Offline
i have a mount definition in my fstab.
I have a glass with some liquid in it. Why is it orange?
Please post your fstab.
EDIT: alright, I am not familiar with systemd mounting at all, so I am unfortunately not able to help here.
Last edited by ayekat (2018-02-04 16:29:43)
Offline
Sorry...
the entry is a little mixed up after trying many suggestions i've read:
//fs01.intern.domain/music /mnt/music cifs nofail,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=10,credentials=/etc/smbcredentials,domain=intern.domain,sec=ntlmv2,vers=3,ro 0 0
Thanks again...
Offline
x-systemd.automount mounts on demand, ie. the device is mounted on your first try to access it.
You can *not* expect it to be mounted right after boot, but eg. "ls /mnt/music" should mount it.
I'm not sure whether that alone or only in combination w/ systemd.requires=network-online.target implies "noauto"; passing "auto" as explicit option might "fix" this - if you actually want that.
Offline
Actually, i tried to do the things through system.d but that didn't work out at all... so i inserted this entry in fstab.
I'm building an MPD-server to stream music over a share (from a windows file-server) so i would like the mount to be up as soon the mpd-daemon is started.
I think I could skip the " x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=10 " part..
"ls /mnt/music " does not mount the share :-(
Offline
Did you check "systemctl status network-online.target" is actually reached?
You should add _netdev if you want this to be automounted.
Offline
Thanks, i'm learning here..
It says:
Feb 04 18:22:46 mpd01 systemd[1]: Reached target Network is Online.
Offline
_netdev should be added in the fstab?
Nah, didn't work :-(
Last edited by godfather007 (2018-02-04 17:42:06)
Offline
What does yout entire fstab now actually look like?
I don't understand why no mount would be triggered when attempting to access the path.
Does systemd-fstab-generator fail?
Did you try to write an explicit mount service? (see "man systemd.mount")
Edit:
systemctl list-units | grep mount
Last edited by seth (2018-02-04 20:07:19)
Offline
Thanks for your help!
fstab:
//fs01.intern.domain/music /mnt/music cifs nofail,x-systemd.automount,credentials=/etc/smbcredentials,domain=intern.domain,sec=ntlmv2,vers=3,ro,_netdev 0 0
and with command " systemctl list-units | grep mount "
● mnt-music.automount loaded failed failed mnt-music.automount
proc-sys-fs-binfmt_misc.automount loaded active waiting Arbitrary Executable File Formats File System Automount Point
-.mount loaded active mounted Root Mount
boot.mount loaded active mounted /boot
dev-hugepages.mount loaded active mounted Huge Pages File System
dev-mqueue.mount loaded active mounted POSIX Message Queue File System
● mnt-music.mount loaded failed failed Music Share at boot
run-user-1000.mount loaded active mounted /run/user/1000
sys-kernel-config.mount loaded active mounted Kernel Configuration File System
sys-kernel-debug.mount loaded active mounted Kernel Debug File System
tmp.mount loaded active mounted Temporary Directory (/tmp)
systemd-remount-fs.service loaded active exited Remount Root and Kernel File Systems
I created the " /etc/systemd/system/mnt-music.mount " which looks like this:
[Unit]
Description=Music Share at boot
Requires=systemd-networkd.service
After=network-online.target
Wants=network-online.target[Mount]
What=//fs01.intern.domain/music
Where=/mnt/music
Options=credentials=/etc/sbmcredentials,sec=ntlmv2,vers=3,domain=intern.domain,ro,x-systemd.automount
Type=cifs
TimeoutSec=30[Install]
WantedBy=multi-user.target
The systemd-fstab-generator creates a fresh entry... let me try
Offline
mnt-music.automount loaded failed failed mnt-music.automount
"Why"?
systemctl status mnt-music.automount
Offline
Good morning,
honestly, i don't know where it came from.
● mnt-music.automount
Loaded: loaded (/etc/fstab; generated)
Active: active (waiting) since Sun 2018-02-04 22:06:55 CET; 10h ago
Where: /mnt/music
Docs: man:fstab(5)
man:systemd-fstab-generator(8)
Offline
Of course that doesn't tell much ;-)
There's also been
mnt-music.mount loaded failed failed Music Share at boot
So what's the status about that (remove the x-systemd.automount option from the file, you also may want to comment the fstab entry to prevent the autogenerated service)
Offline
I created the " /etc/systemd/system/mnt-music.mount " which looks like this:
... Options=credentials=/etc/sbmcredentials,sec=ntlmv2,vers=3,domain=intern.domain,ro,x-systemd.automount ...
Looks like a typo in your unit as well(, unless the typo is in your fstab): /etc/sbmcredentials
Offline
my god... quess what.... it works :-)
Thanks for pointing my typo
Offline
So this ...
Unfortunately it only comes up when i give the command " mount -a "
... was simply not true... ?
Offline
strangely thing, the fstab didnt work out finally.
It did using the " mount -a" command. Still strange..
Are the 2 entries related to each other in some way?
Offline
We need this in English, please ;-)
Do you mean the path fix worked on the mnt-music.mount service, but not the service autogenerated from fstab?
What is the exact condition at this point (is your mnt-music.mount still in place and what does fstab look like?)
Offline
Oh well,
after correcting and reload the mnt-music.mount, the mount was made.
Yesterday evening i tried to figure out that generator-fstab-thing but it didn't like me.
My fstab is still filled with the entry... i will remark it to see how it behaves.
Offline
Hm... it does show up when remarked
//fs01.intern.domain/music /mnt/music cifs nofail,x-systemd.automount,credentials=/etc/smbcredentials,domain=intern.domain,sec=ntlmv2,vers=3,ro,_netdev 0 0
Last edited by godfather007 (2018-02-05 20:19:23)
Offline
So, they are related?
Offline
Please edit your posts rather than bumping (if no reply was made inbetween) and elaborate on "it does show up when remarked" (what is "it" and what is "remarked") and on what excatly you concern to be related (a service - and which - to the fstab entry?)
Also your fstab still contains the typo.
If you want it automounted at boot you'll also have to remove the "x-systemd.automount" and maybe "nofail" options.
Offline
Oh well,
after correcting and reload the mnt-music.mount, the mount was made.
Yesterday evening i tried to figure out that generator-fstab-thing but it didn't like me.
My fstab is still filled with the entry... i will remark it to see how it behaves.Hm... it does show up when remarked
...
I think I can decipher what you mean, but I believe you would make yourself easier to understand if you just posted the the line you edited in fstab, together with the terminal output that you see when trying it out. Like it says in the link seth posted in the first response to this thread.
Now to what you did, I guess(?):
# sed 's/,x-systemd.automount//g' /etc/fstab && cat /etc/fstab
//fs01.intern.domain/music /mnt/music cifs nofail,credentials=/etc/smbcredentials,domain=intern.domain,sec=ntlmv2,vers=3,ro,_netdev 0 0
# systemctl daemon-reload
# systemctl status mnt-music.automount
Unit mnt-music.automount could not be found.
$ ls /mnt/music
ls: cannot access '/mnt/music': No such file or directory
# sed 's/nofail/nofail,x-systemd.automount/g' /etc/fstab && cat /etc/fstab
//fs01.intern.domain/music /mnt/music cifs nofail,x-systemd.automount,credentials=/etc/smbcredentials,domain=intern.domain,sec=ntlmv2,vers=3,ro,_netdev 0 0
# systemctl daemon-reload
# systemctl status mnt-music.automount
mnt-music.automount
Loaded: loaded (/etc/fstab; generated)
Active: active (waiting) since Sun 2018-02-04 22:06:55 CET; 10h ago
Where: /mnt/music
Docs: man:fstab(5)
man:systemd-fstab-generator(8)
Something like that? Maybe removed some other options or something, but still missed to post it here.
So, they are related?
Yes, everything is related. x-systemd.automount tells systemd to generate the mnt-music.automount unit. The mnt-music.automount unit in turn trigger the mnt-music.mount unit that specifies for systemd.mount what to mount. Since you created your own (with a bad credential path), systemd never generated one (with the credential path from /etc/fstab) and the mount failed.
You only posted the output from:
systemctl status mnt-music.automount
But the output from:
systemctl status mnt-music.mount
would probably tell us all about it. The mount option nofail in /etc/fstab sets the mnt-music.automount not required by the local/remote-fs.target, but it is still a dependency as wanted and will probably try to mount early. One good/bad thing with nofail is that it suppress the fails, so the system boots even if some mount fail. This probably does not matter because of all the cross dependencies you have set up right now, I'm not sure how anything really links in your setup.
Something like this would probably be enough:
//fs01.intern.domain/music /mnt/music cifs noauto,x-systemd.automount,credentials=/etc/smbcredentials,vers=3,ro 0 0
domain=intern.domain goes in your credentials file. noauto solves everything about the dependencies at boot while x-systemd.automount will create the mnt-music.automount with some requirements on network. Remove the mnt-music.mount unit you created yourself and let systemd create one from this /etc/fstab.
Offline
Pages: 1