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

Indirectelex

Member
May 26, 2021
95
8
13
34
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
 

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!