NFS nightmare

71 views
Skip to first unread message

Saint Michael

unread,
May 5, 2023, 9:14:57 AM5/5/23
to LXC users mailing-list
I need to mount an NFS share inside a privileged LXC container, but it fails. I am not using AppArmor, for I disabled it on /proc/cmdline (apparmor=0).  So what is keeping me from mounting the NFS share? I get this error: "mount: /remote: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program."
The command is :
mkdir -p /remote;mount -t nfs 208.73.236.249:/master /remote
my config file has:

lxc.mount.auto=
lxc.mount.auto=proc:rw sys:rw cgroup:rw
lxc.apparmor.profile=unconfined
lxc.tty.max = 10
lxc.pty.max = 1024
lxc.cgroup2.devices.allow = c 1:3 rwm
lxc.cgroup2.devices.allow = c 1:5 rwm
lxc.cgroup2.devices.allow = c 5:1 rwm
lxc.cgroup2.devices.allow = c 5:0 rwm
lxc.cgroup2.devices.allow = c 4:0 rwm
lxc.cgroup2.devices.allow = c 4:1 rwm
lxc.cgroup2.devices.allow = c 1:9 rwm
lxc.cgroup2.devices.allow = c 1:8 rwm
lxc.cgroup2.devices.allow = c 136:* rwm
lxc.cgroup2.devices.allow = c 5:2 rwm
lxc.cgroup2.devices.allow = c 254:0 rwm
lxc.cgroup2.devices.allow = c 10:137 rwm # loop-control
lxc.cgroup2.devices.allow = b 7:* rwm    # loop*
lxc.cgroup2.devices.allow = c 10:229 rwm #fuse
lxc.cgroup2.devices.allow = c 10:200 rwm #docker
lxc.cgroup2.devices.allow= a
lxc.cap.drop=
lxc.cgroup2.devices.deny=
lxc.autodev= 1
lxc.hook.autodev = sh -c 'mknod ${LXC_ROOTFS_MOUNT}/dev/fuse c 10 229'

Do I need to add something to the config file?

Andreas Laut

unread,
May 5, 2023, 9:26:11 AM5/5/23
to Saint Michael, lxc-...@lists.linuxcontainers.org
Hi,

it says it needs a helper program.

mount: /remote: bad option; for several filesystems (e.g. nfs,
cifs) you might need a /sbin/mount.<type> helper program

ls -l /sbin/mount.nfs*

What give you this command? The error message looks like missing a package.

Cheers,

Andreas Laut
System-Administrator
--
Spark 5 GmbH
Rheinstr. 97
64295 Darmstadt
Germany
--
Fon: +49-6151-8508-021
Fax: +49-6151-8508-111
E-Mail: andrea...@spark5.de


Web: https://www.spark5.de
--
Geschäftsführer: Henning Munte, Michael Mylius
Amtsgericht Darmstadt, HRB 7809
--

Am 05.05.23 um 15:14 schrieb Saint Michael:

Dr. Todor Dimitrov

unread,
May 5, 2023, 9:26:47 AM5/5/23
to Saint Michael, LXC users mailing-list
We are using NFS shares, make sure that you have the kernel modules loaded:

CONFIG_PACKAGE_kmod-fs-nfs=y
CONFIG_PACKAGE_kmod-fs-nfs-common=y
CONFIG_PACKAGE_nfs-utils=y

(might be different for your host).

Best, Todor

--
You received this message because you are subscribed to the Google Groups "lxc-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lxc-users+...@lists.linuxcontainers.org.
To view this discussion on the web visit https://groups.google.com/a/lists.linuxcontainers.org/d/msgid/lxc-users/CAC9cSOD7qS-jo6FE5fn4WH42HaK0k2EJYqcSsR%2Be10j8Xcv%2B4A%40mail.gmail.com.

Saint Michael

unread,
May 5, 2023, 10:20:01 AM5/5/23
to Dr. Todor Dimitrov, LXC users mailing-list
I solved it. It needed the package nfs-common.
many thanks to all.
Reply all
Reply to author
Forward
0 new messages