Container not mounting /etc/fstab on boot

sweaty-tim

New Member
Feb 3, 2023
3
0
1
I am in the process of moving my containers from native LXC on Debian 11 to Proxmox and thus learning Proxmox in the process.

I have setup a Debian 11 container using 'pct' to mount a remote file system (SSHFS) using /etc/fstab. It mounts when I execute 'mount -a' without issue from inside the running container.

Is there something special I need to enable for Proxmox to execute /etc/fstab on boot?
 
Hi, I was able to have an sshfs mounted at boot inside a Debian 11 LXC with the following fstab entry:
Code:
user@HOST:PATH /mnt/sshshare fuse.sshfs defaults,reconnect 0 0
Can you post your /etc/fstab?
 
I'm having the exact same issue as OP. Works with 'mount -a', but doesn't work automatically after a reboot.
My container is Debian 10 (Turnkey), trying to connect to a VM of OMV6 on the same node.

/etc/fstab
docker@172.16.11.22:/srv/mergerfs/snapraid/conf /mnt/config fuse.sshfs noauto,x-systemd.automount,_netdev,user,idmap=user,follow_symlinks,identityfile=/home/docker/.ssh/id_rsa,allow_other,default_permissions,ServerAliveInterval=15,ServerAliveCountMax=3,uid=1001,gid=101,reconnect 0 0 docker@172.16.11.22:/srv/mergerfs/snapraid/data /mnt/media fuse.sshfs noauto,x-systemd.automount,_netdev,user,idmap=user,follow_symlinks,identityfile=/home/docker/.ssh/id_rsa,allow_other,default_permissions,ServerAliveInterval=15,ServerAliveCountMax=3,uid=1001,gid=101,reconnect 0 0

I've been struggling with this for weeks, so this config has kept growing. user,idmap=user,follow_symlinks,uid=1001,gid=101
May not be needed, but various tutorials used them. ServerAliveInterval=15,ServerAliveCountMax=3 were added to try and avoid the connection from closing. But if I understand the purpose of x-systemd.automount correctly, I shouldn't need them?
 
Can you try removing the x-systemd.automount option, and replacing noauto with auto? Apparently systemd.automount doesn't work inside a LXC because autofs is not namespace-aware (some more info here). However, at least in my Debian 11 LXC, systemd does mount the sshfs at boot without the x-systemd.automount option.
 
Can you try removing the x-systemd.automount option, and replacing noauto with auto?
That worked! Thank you!! I haven't fully tested, re permissions, etc, but it's mounted and navigable.
What does auto vs noauto do?
 
  • Like
Reactions: fweber
  • Like
Reactions: dvdwsn
The mount is working well so far. I haven't had any issues doing backups either which older posts said can cause the system to hang. One small issue is that the permissions set by newly created folders aren't how I'd like them. When created automatically it's set to rwxr-sr-x, but I would like rwsrwsr-x.
Any way I change this?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!