Expand Your Proxmox Storage: A Guide to Adding CIFS (SMB) Storage to Proxmox

With the start of the New Year, I have been auditing my homelab, trying to identify areas where I can optimize its current loadout. Out of this audit, I noticed that I had accumulated a lot of files that were taking up valuable local NVME storage on my Proxmox server. These were files like iso images for installing new VMs, backups, container templates- all things that just didn't necessarily need to be kept in hot storage. Wouldn't it be nice to be able to free up valuable NVME drive space by shifting those files to a more centralized file storage server? In today's tutorial, we will be discussing how to add CIFS storage to Proxmox.


This is a companion discussion topic for the original entry at https://engineerworkshop.com/blog/how-to-add-cifs-storage-to-proxmox/

Thanks for the post - I have been looking for a solution to the stale file handle issue with CIFS mounts that are restarted on the server. I have been restarting the proxmox server to resolve which isnt ideal. I might try and script a umount if required. I wonder why this hasnt been picked up by the proxmox team though - server software that doesnt gracefully manage loss of connection. :confused:

Welcome to the blog/forum. Yeah, it’s pretty unfortunate; believe it or not, it’s even worse on NFS than on CIFS/SMB. I have been meaning to investigate it further, but that investigation is lower on my priority list since I really only use my network share for large static files like backups.

Not sure if you saw the troubleshooting section or not but you should be able to fix the stale file handle issue with the following commands:

umount -f -a -t cifs -l
mount -t cifs

Hopefully that will save you from having to restart your Proxmox host.

What are you serving your SMB share out of? I’m using unRAID, so if you’re using something else, that information would be helpful.

-TorqueWrench

I was going to use NFS to see if that solved it but if it’s worse you have saved me a few hours so thanks.

My SMB server is currently a Windows 10 box that runs 24/7 except for monthly updates. I had the same problem on Linux samba servers so hoped a real windows install may help.

I will be switching to FreeNAS but will likely have the same issues until I can find a real fix or way to reconnect if connection is lost. Or may through everything into one vm and be done with it. Because I need the data shared between multiple services, iscsi is out of the question unfortunately.

Yeah, when I switched over to NFS the problem became much worse. With SMB, I would only run into the problem every few days; on NFS, I now run into it every time I do a large file transfer. Very inconvenient when you’re using that NFS storage for automated backups.

Interestingly, as it sounds like you may have also had the same observation, I do not have the problem from within a given VM. If I pass the SMB share to individual VMs, they never exhibit this behavior and happily go about their business without any intervention ever, even when their Proxmox host is complaining about connection to the exact same share.

Thanks for your information. Given that both of us have used different servers for our NFS and SMB shares, and the fact that I don’t run into the problem when I am within a VM, I do have to conclude the problem is most likely on Proxmox itself. That at least narrows the field a bit. I’ll try to dig into it in the next few days. I’ll let you know if I come up with something.

I’d like to hear about your FreeNAS build. Are you thinking ZFS? It’s part of the future upgrade roadmap for my homelab. Would you mind sharing your plans in a post about it in the storage forum?

-TorqueWrench