moving to freebsd / jails / bhyve (part 6): rclone smb mounting
i wrote an earlier post about this but i think i need to revamp it. most of it is the same. install rclone and run through rclone config. the problem i was having was with it auto mounting when jails start. i was unable to find a solution for this so i just did it the sketchy way and added it as a crontab for the root user. what is important here is that rclone MUST be linked (ln -s) to /usr/local/bin/rclonefs in order to function in the fstab. this is hard coded in rclone where it detects that it is being run using the command ‘rclonefs’ and turns itself into a mount helper. weird, but it is what it is. maybe some day there will be a freebsd mount.cifs but until then this is what we have.
azazil# cat /etc/fstab
server:/smbmount /mnt/server/smbmount fusefs.rclone allow_other,rw,mountprog=/usr/local/bin/rclonefs,args2env,vfs_cache_mode=off,config=/root/.config/rclone/rclone.conf,uid=<number of user>,gid=<number of group>,cache_dir=/var/cache/rclone 0 0
azazil# crontab -l
@reboot /sbin/mount /mnt/server/smbmount
azazil# df -h
Filesystem Size Used Avail Capacity Mounted on
platters/bastille/jails/azazil/root 25T 1.9G 25T 0% /
/usr/local/bastille/releases/15.0-RELEASE 25T 487M 25T 0% /.bastille
devfs 1.0K 0B 1.0K 0% /dev
fdescfs 1.0K 0B 1.0K 0% /var/run/samba4/fd
server:smbmount 71T 48T 24T 67% /mnt/server/smbmount
this is assuming that you have a smb share using samba or anything else that supports it up and running and functional. i’ll try to find a cleaner way than using crontab later. for now this gives me what i need.