I’m in the process of trying to get a Ceph installation working. For the most part, I have it down, but then I hit a roadblock when I tried to mount the cephfs file system. Eventually, I want to do this at boot for my Plex server but I can’t even mount it manually, through fileSystems, or systemd mount.
In all cases, when I try to mount, I get this error:
systemd[1]: Mounting /media...
mount[3174]: sh: line 1: modprobe: command not found
mount[3173]: mount error 22 = Invalid argument
mount[3173]: failed to load ceph kernel module (127)
systemd[1]: media.mount: Mount process exited, code=exited, status=32/n/a
systemd[1]: media.mount: Failed with result 'exit-code'.
systemd[1]: Failed to mount /media.
Looking up the code, I found this discussion which talks about how modprobe is hard-coded to not have a path but the PATH has been wiped out because of the setuid mount program which means it can’t mount it at all.
I do have the Ceph modules loaded already in the system.
I’m not really sure how to move forward with this. I tried a number of ways of trying to override that package to try getting in ${kmod}/bin/modprobe, but kept getting an infinite recursion so I suspect that is a poor understanding of Nix.
The various Ceph commands are working fine, so I suspect it is currently hung up on that modprobe.
If it helps, I’m working with a flake-based setup using colmena to deploy. Everything else is pretty stable.
Any help or suggestions would be greatly appreciated. My children are harassing me about not having their Plex running.
It can’t find the modprobe command in PATH. You can either expand PATH to contain the directory if the SUID wrapper but I am not sure if ceph has even permissions to run that. You could also remove the modprobe command entirely or add a modprobe dummy command which always returns true.
FWIW, I get similar errors when I need to remount a cephfs volume by hand. (eg mount /mnt/ceph). But despite the errors, the volume does get mounted.
Comparing your config to mine, I think you maybe need to swap user for name. AFAICT that’s the only difference. If that works, my vague guess is that the actual error is that, and the shown error message is just a red herring.
I tried swapping the name for user, but still got the modprobe issue. I eventually got it working last night, but I had to recompile all of ceph to change this line from “modprobe” to ${kmod}/bin/modprobe. Takes about 2-3 hours to run but it actually worked and now fileSystems, FUSE, and manually mounting are all good.
Well, I also found an issue with building the tools where it appeared to be using the wrong version of lua and I reported an issue an issue with that also.
I ended up going with a more generic and ham-fisted approach.
preConfigure = ''
substituteInPlace src/common/module.c --replace "/sbin/modinfo" "modinfo"
substituteInPlace src/common/module.c --replace "/sbin/modprobe" "true"
substituteInPlace src/common/module.c --replace "/bin/grep" "grep"
# install target needs to be in PYTHONPATH for "*.pth support" check to succeed
# set PYTHONPATH, so the build system doesn't silently skip installing ceph-volume and others
export PYTHONPATH=${ceph-python-env}/${sitePackages}:$lib/${sitePackages}:$out/${sitePackages}
patchShebangs src/script src/spdk src/test src/tools
'';
I just replaced it with true instead of ${kmod}/bin/modprobe. I had a problem with the kmod also, but I couldn’t really tell what the “correct” fix was and I already had it modprobe’d, so I could just ignore the statement entirely.
If Sandro didn’t have made that additional comment, the forum system would have denied the post as “empty”, as just quoting a previous post is not enough. The forum is unaware of the fact that the quote actually contains corrections.
Each post requires 20 chars or so of “fresh” content.