freebsd jails rclone mounting
so there are some things that i need to make a quick note of about this because i’ve been pulling my hair out for a while trying to get it to work.
HOST SIDE
---------
** there's other shit in loader.conf. this is just what is needed for jails.
# /boot/loader.conf
kern.racct.enable=1
fdescfs_load="YES"
linprocfs_load="YES"
linsysfs_load="YES"
tmpfs_load="YES"
fusefs_load="YES"
** NEED to link it to THIS to create a helper for mount HAS to be rclonefs
# ln -s /usr/local/bin/rclone /usr/local/bin/rclonefs
** This needs to be in the jail.conf so you can mount fuse in it
# some_fucking_jail.conf
some_fucking_jail {
enforce_statfs = 1;
allow.mount = 1;
allow.mount.fusefs = 1;
... other jail shit
}
this is where it might get a little different depending on how you are managing jails. i am using bastille which puts things in /usr/local/bastille/jails/some_fucking_jail by default (whatever the name of the jails is). in this dir there is a fstab that gets called by bastille start some_fucking_jail which mounts on start and unmounts on stop.
# /usr/local/bastille/jails/some_fucking_jail/fstab
server:share /usr/local/bastille/jails/some_fucking_jail/root/mnt/server/share fusefs.rclone auto,allow_other,rw,mountprog=/usr/local/bin/rclonefs,args2env,vfs_cache_mode=writes,config=/root/.config/rclone/rclone.conf,uid=1234,gid=1234,cache_dir=/var/cache/rclone 0 0
so a quick rundown. this assumes that you have rclone set up and configured as root. you configure this on the host side. you then shove it into the jail’s root dir. in my case i actually set up ad in the jail so i have a particular user who needs to access stuff this way. if you want read/write access then pay attention to the uid= and gid= and set it to what you need so people can rw the shares inside the jail. also… it took me a minute to realize it but the fstype is considered fusefs.rclone. you can use anythign in the fstab and it will mount but when bastille tries to unmount it then it spits out errors about it not being that type of fs.