Open GrumpyMeow opened 2 years ago
the -O _netdev
code path is only run if the earlier unmount failed, so you prob want to look into that
since our mountinfo
command supports --netdev
, i'm not sure why we still need the -O _netdev
fallback. not that i see a big deal with relying on this option since util-linux has supported it forever.
Thank you for your reply.
I'll try to pinpoint the exact origin of the problems and post it on this thread.
I suspect it has got something to do with that I try to do the binding in a LXC containers (in Proxmox). Maybe some services are not available in the container...
For instance the command
umount -a -O _netdev
is not available in the Alpine version of umount.
As a side-note, I raised a "crude" fix for this several months ago: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/35149
A more correct fix was written by another Alpine dev (https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/35484) but not yet applied in Alpine Edge as he was waiting for upstream Busybox to accept the fix: http://lists.busybox.net/pipermail/busybox/2022-June/089769.html
Hi, I have had very similar situation: a container in proxmox, in which I wanted to mount a cifs share at a boot time. Architecturally sound solution seemed to use etc/fstab entry and netmount service from openrc - as described here and in couple of fora. And it did not work.
The solution:
make netmount launch AFTER network service by doing one of the two:
either edit /etc/init.d/netmount to comment out line
keyword -docker -jail -lxc -prefix -systemd-nspawn -vserver
Explanation: This line EXCLUDES netmount from any openrc dependencies (launch sequencing), making netmount being started before net is started. (see openrun-rc(8) man page.
or edit /etc/rc.conf rc_sys variable from "lxc" to "".
I have tested script edit and it works. The disadvantage is I went against openrc recommendations. Editing rc.conf would be in line with recommendations, but its potential scope of influence is broader, and I had not time to check.
rc_need=net
Explanation: This should work regardless of the actual networking service used in Alpine openrc (default, dhcpcd). More on that in "Sources" section below.
//server/Music /mnt/music cifs user=samba-user,pass=secret,_netdev 0 0
Note: fstab line can be improved e.g. by moving user and pass to credential file. More on that in "Sources" section below.
At Proxmox UI:
Install additional packages needed in Alpine (nano, cifs-utils, util-linux, see source below).
reboot - and check if the folder is mounted and ready for use.
Good luck in further works.
stan
Sources (thanks!): https://www.hiroom2.com/2017/08/21/alpinelinux-3-6-cifs-utils-en/ https://techoverflow.net/2021/07/06/how-to-automount-cifs-smb-on-alpine-linux/ https://wiki.gentoo.org/wiki/OpenRC#Logging https://manpages.debian.org/testing/openrc/openrc-run.8.en.html https://wiki.gentoo.org/wiki/Dhcpcd https://forum.proxmox.com/threads/container-options-features-cifs.96915/
@sbochnak @GrumpyMeow
I had similar issue and solved it by removing the -lxc
param from the keyword
call. See also my recent post on servervault.com
I'm migrating my LXC containers to Alpine as they are super light-weight. I ran into trouble with mounting cifs/samba shares during boot. I've defined the shares in the /etc/fstab file and also added the "_netdev" parameter. I guess this setup is not very common as i noticed there are multiple issues when running this script in Alpine in a LXC container. My current solution was to strip the script /etc/init.d/netmount down to:
For instance the command
umount -a -O _netdev
is not available in the Alpine version of umount.