Score:1

Bind mount ONLY if Samba mount is present? (Ex: BIND MOUNT Requires NFS Mount \\172.16.x.x\files... )

ru flag

I have a mount with SAMBA using the following in fstab:

//source/files /mnt/files cifs user,_netdev,cache=none,credentials=/usr/src/access.smb 0 0

And then i have the following mount --bind line:

/mnt/files /var/www/html/data none defaults,bind 0 0

But the second mount is not working. If i reboot the computer only the first mount works. I need to manually mount the second one (Using bind)

Please, can someone help me? I saw this post on Unix Stack Exchange but i did'nt understand: https://unix.stackexchange.com/questions/216287/how-do-i-set-up-bind-mounts-on-startup-correctly-in-the-systemd-world

Thanks in advance.

Score:1
de flag

Something like this:

/mnt/files /var/www/html/data none x-systemd.requires=/mnt/files,x-systemd.automount,bind 0 0
ru flag
Hello! Sorry - Something like this or is your comment actually the solution?
de flag
Just try it. Possibly, some some corrections might be needed
ru flag
Also, please: What does x-systemd.automount do ? I read this documentation, here: https://www.freedesktop.org/software/systemd/man/systemd.automount.html# but i didnt really understanding... Do you know what is it for or did you find this elsewhere ? Thank you.
ru flag
I think this worked but i did'nt use this systemd.automount option since i didnt understand what it does .. Thank, if you could just complement specifiying what systemd.automount i would be glad. Have a superb day :)
de flag
It dynamically creates systemd mount units from fstab entries
ru flag
For some reason when i test it with this x-systemd.automount option it doesnt mount.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.