[SOLVED] How to automatically mount a SMB share on an LXC

Indirectelex

Member
May 26, 2021
95
11
13
35
Canada
I have an Ubuntu LXC on PVE and I want it to mount automatically after a reboot to a Samba share because doing mount -a each time sucks.
So I checked the SMB/CIFS box and as I said I can access the share manually after mount -a. My guess is I should type a magic command into the /etc/fstab, but please have a look at my line there:

\\192.168.XXX.XXX\media /mnt/media cifs credentials=/root/.smbcredentials,users,uid=1000,gid=1000 0 0

Have you an idea what I need to add?
 
Last edited:
So here is the command line that works for me :
Code:
//192.168.XX.XX/media /mnt/media       cifs    noperm,iocharset=utf8,rw,credentials=/root/.storage_credentials,uid=root,gid=root,file_mode=0660,dir_mode=0770 0       0
then do nano /root/.storage_credentials
username=sambauser
password=sambauserspassword
 
Last edited:
So here is the command line that works for me :
Code:
//192.168.XX.XX/media /mnt/media       cifs    noperm,iocharset=utf8,rw,credentials=/root/.storage_credentials,uid=root,gid=root,file_mode=0660,dir_mode=0770 0       0
then do nano /root/.storage_credentials
username=sambauser
password=sambauserspassword
I have Plex installed in a Proxmox container (CT), TrueNAS in a vm with SMB share for me access the directory from windows 10 that I can upload movies. The Share works and I can save movies.
I have followed your guide and many other suggestions to mount the drive in FSTAB but does not work when I boot the Proxmox Server or the CT thus Plex shows media Unavailable.
However, when I run mount -a in the Console of the CT then it mounts & plex shows media is available.
What is it that I miss?
 
  • Like
Reactions: s_p2003
I have Plex installed in a Proxmox container (CT), TrueNAS in a vm with SMB share for me access the directory from windows 10 that I can upload movies. The Share works and I can save movies.
I have followed your guide and many other suggestions to mount the drive in FSTAB but does not work when I boot the Proxmox Server or the CT thus Plex shows media Unavailable.
However, when I run mount -a in the Console of the CT then it mounts & plex shows media is available.
What is it that I miss?
Did you ever figure all this out? Essentially doing the same thing. TrueNAS Scale on a VM, then qBittorrent/plex/Arr's on LXC's
 
Seeing as this topic hasn't been updated in a while...

Installing/re-installing one or more of these packages fixed it for me, plus putting the creds file in the right location! Using 'mount -a' will give you a clue on that issue.

apt-get smbclient
apt-get keyutils
apt-get cifs-utils
 
Seeing as this topic hasn't been updated in a while...

Installing/re-installing one or more of these packages fixed it for me, plus putting the creds file in the right location! Using 'mount -a' will give you a clue on that issue.

apt-get smbclient
apt-get keyutils
apt-get cifs-utils
Greetings
,Could you assist me in providing further clarification? What I am seeking is a container with shared storage that I can utilize with another servers within a private network. My intention is to use it for adding preset templates for deployment on other servers.