[SOLVED] PBS - Mounting Windows SMB Share as Datastore

Aarolain

Member
Oct 13, 2019
5
10
23
34
I have a PBS that, currently, is working fine as a backup server for my PVE node. On that PVE node I have a WindowsVM running Backblaze personal. What I would like to do is backup the PBS to Backblaze through that Windows VM. My plan for accomplishing that:

(Assume that the normal backups are on a datastore called 'backup_ds'
  • Mount a share from the Windows VM to /mnt/windows ('windows_ds')on PBS.
  • Create a datastore in PBS pointing to /mnt/windows.
  • Create a remote in PBS for itself, and create a sync job to sync backup_ds and windows_ds.

Where this all breaks down for me is mounting the SMB share to PBS:
/etc/fstab: //1.2.3.4/proxmoxbackups /mnt/windows cifs credentials=/etc/samba/creds/.windows,defaults 0 0 output of mount command: //1.2.3.4/proxmoxbackups on /mnt/windows type cifs (rw,relatime,vers=3.1.1,cache=strict,username=winuser,uid=0,noforceuid,gid=0,noforcegid,addr=1.2.3.4,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1)

What this does for me is create /mnt/windows that, from the command line, I have full control over(read/write, add and delete files). However, if I try to use /mnt/windows as a datastore, PBS throws 'Permission denied (os error 13)'. I assume the problem is with how I'm mounting the windows share. Does it need to be mounted with a specific permission and/or user for PBS to properly access it as a datastore?
 
  • Like
Reactions: ChrisC
Here user "backup" with UID "34" needs access to the datastore. But I got PBS ontop of Debian. Not sure if its the same with a installation from the PBS ISO.
 
Here user "backup" with UID "34" needs access to the datastore. But I got PBS ontop of Debian. Not sure if its the same with a installation from the PBS ISO.
That was it. I found that out around the same time you posted the reply. Mounting with UID and GID 34 (backup:backup) did the trick.
 
  • Like
Reactions: peterge and Colonal
That was it. I found that out around the same time you posted the reply. Mounting with UID and GID 34 (backup:backup) did the trick.
Hello Aarolain

I'am rather new to Proxmox / PBS / Linux. Ever worked with Hyper-V , unfortunately there is no free Version of Hyper-V anymore.
Could you please post here the steps, needed to mount SMB in PBS to datastore?
I just would like to copy backup of the VMs to a NAS (so copy of backup)
PBS natively allows only backupsync to "remote" PBS, which could be pointed to local PBS... but no possibility like in PVE to make/mount SMB Datastore.

thanks for your help...
 
Hello Aarolain

I'am rather new to Proxmox / PBS / Linux. Ever worked with Hyper-V , unfortunately there is no free Version of Hyper-V anymore.
Could you please post here the steps, needed to mount SMB in PBS to datastore?
I just would like to copy backup of the VMs to a NAS (so copy of backup)
PBS natively allows only backupsync to "remote" PBS, which could be pointed to local PBS... but no possibility like in PVE to make/mount SMB Datastore.

thanks for your help...

I'm not sure how much you know about PBS/Proxmox/Debian/Linux currently, but I'll do my best briefly explain what I did. I'm also assuming that you already have a working SMB share setup on some other machine.

First, you'll need to install CIFS utilities on PBS:
sudo apt install cifs-utils

Create a folder that you will mount the remote SMB share into:
mkdir /mnt/somefolder

Create a credentials file to store the credentials to access the remote machine:
nano /etc/samba/.smbcreds

... and set the username and password:
username=smb_username password=smb_password

Save your file and make it readable by root only:
chmod 400 /etc/samba/.smbcreds

Finally, mount your SMB share in PBS:
sudo mount -t cifs -o rw,vers=3.0,credentials=/etc/samba/.smbcreds //1.2.3.4/sharename /mnt/somefolder

Try to access the folder, and if it works attempt to write to it. If it works, make it auto-mount at boot by adding the following to /etc/fstab:
nano /etc/fstab
//1.2.3.4/sharename /mnt/somefolder cifs credentials=/etc/samba/.smbcred,uid=34,gid=34,defaults 0 0
Save the file. If for some reason something listed in /etc/fstab does not mount on reboot or if you made a change to it and need to test it, you can issue a mount -a to remount all shares.

Note: you may or may not need the vers=3.0 option when mounting.I didn't need it, so if it doesn't work with try again without it. Also, the uid=34,gid=34 means that you are mounting this share as the backup user in PBS; as stated earlier in this thread that is a necessary to allowing PBS read/write access to the mount.

The final step is adding your SMB share as a datastore in PBS. For that you simply use the GUI to Add Datastore and set the backup path to /mnt/somefolder and it should mount.

Hope this was of use to you. Let me know how it goes when you try it out.
 
I'm not sure how much you know about PBS/Proxmox/Debian/Linux currently, but I'll do my best briefly explain what I did. I'm also assuming that you already have a working SMB share setup on some other machine.

First, you'll need to install CIFS utilities on PBS:
sudo apt install cifs-utils

Create a folder that you will mount the remote SMB share into:
mkdir /mnt/somefolder

Create a credentials file to store the credentials to access the remote machine:
nano /etc/samba/.smbcreds

... and set the username and password:
username=smb_username password=smb_password

Save your file and make it readable by root only:
chmod 400 /etc/samba/.smbcreds

Finally, mount your SMB share in PBS:
sudo mount -t cifs -o rw,vers=3.0,credentials=/etc/samba/.smbcreds //1.2.3.4/sharename /mnt/somefolder

Try to access the folder, and if it works attempt to write to it. If it works, make it auto-mount at boot by adding the following to /etc/fstab:
nano /etc/fstab
//1.2.3.4/sharename /mnt/somefolder cifs credentials=/etc/samba/.smbcred,uid=34,gid=34,defaults 0 0
Save the file. If for some reason something listed in /etc/fstab does not mount on reboot or if you made a change to it and need to test it, you can issue a mount -a to remount all shares.

Note: you may or may not need the vers=3.0 option when mounting.I didn't need it, so if it doesn't work with try again without it. Also, the uid=34,gid=34 means that you are mounting this share as the backup user in PBS; as stated earlier in this thread that is a necessary to allowing PBS read/write access to the mount.

The final step is adding your SMB share as a datastore in PBS. For that you simply use the GUI to Add Datastore and set the backup path to /mnt/somefolder and it should mount.

Hope this was of use to you. Let me know how it goes when you try it out.
Thank you very much!
Since I am an IT pro - it was possible to mount and make "copy" :-)

my /etc/fstab line is:
"//x.x.x.x/server /mnt/backup cifs credentials=/etc/samba/.nas1,iocharset=utf8,rw,file_mode=0777,dir_mode=0777,mapchars,uid=34,noforceuid,gid=34,noforcegid 0 0"

I got it yesterday to work, but I will try your suggestions...
Question, since it is a NAS (from WD) , it took 4 hours to make a datastore , because of all the chunks. Is it normal?
My backup-copy is still running since 23.00pm.... very slow. Is it normal too? It should copy local pbs backup to the nas, it seems that pbs make some loop...

thanks in advance...
Greets
 
I got it yesterday to work, but I will try your suggestions...
Question, since it is a NAS (from WD) , it took 4 hours to make a datastore , because of all the chunks. Is it normal?
My backup-copy is still running since 23.00pm.... very slow. Is it normal too? It should copy local pbs backup to the nas, it seems that pbs make some loop...
Thats normal. PBS should be used with local SSDs as it needs alot of IOPS performance, not with HDDs or over a network stack that adds additional latency.
Its by design that there are millions of small chunk files which need to be read and written. For every 1TB of backups you get around 500,000 (atleast 250,000) chunk files. And HDDs are terrible at accessing millions of files. You will have to check if it is fast enough, especially when doing re-verify tasks.
 
Last edited:
Thats normal. PBS should be used with local SSDs as it needs alot of IOPS performance, not with HDDs or over a network stack that adds additional latency.
Its by design that there are millions of small chunk files which need to be read and written. For every 1TB of backups you get around 500,000 (atleast 250,000) chunk files. And HDDs are terrible at accessing millions of files. You will have to check if it is fast enough, especially when doing re-verify tasks.
Yep, SSD's would be the way to go here. Not giving myself any points for speed and I'm wondering how effective super slow backups of relatively small snapshots really is. But hey, slow backups are better than no backups.
 
I understood - thank you all!
For my part - I deleted the smb mount and will make backup copies to usb HDD or SSD...
 
With SMB/CIFS I got some lock issues and permission issues. Also the folder naming was at some point in 8.3 DOS style (but that was an issue of my QNAP NAS). Tried iocharset, mapchars but it was not a success story.

After all I switched from SMB/CIFS to NFS and everything is working fine now. (just mounting in /etc/fstab with default settings and all user squashing at the NAS)

Thanks for all the info!
 
I'm not sure how much you know about PBS/Proxmox/Debian/Linux currently, but I'll do my best briefly explain what I did. I'm also assuming that you already have a working SMB share setup on some other machine.

First, you'll need to install CIFS utilities on PBS:
sudo apt install cifs-utils

Create a folder that you will mount the remote SMB share into:
mkdir /mnt/somefolder

Create a credentials file to store the credentials to access the remote machine:
nano /etc/samba/.smbcreds

... and set the username and password:
username=smb_username password=smb_password

Save your file and make it readable by root only:
chmod 400 /etc/samba/.smbcreds

Finally, mount your SMB share in PBS:
sudo mount -t cifs -o rw,vers=3.0,credentials=/etc/samba/.smbcreds //1.2.3.4/sharename /mnt/somefolder

Try to access the folder, and if it works attempt to write to it. If it works, make it auto-mount at boot by adding the following to /etc/fstab:
nano /etc/fstab
//1.2.3.4/sharename /mnt/somefolder cifs credentials=/etc/samba/.smbcred,uid=34,gid=34,defaults 0 0
Save the file. If for some reason something listed in /etc/fstab does not mount on reboot or if you made a change to it and need to test it, you can issue a mount -a to remount all shares.

Note: you may or may not need the vers=3.0 option when mounting.I didn't need it, so if it doesn't work with try again without it. Also, the uid=34,gid=34 means that you are mounting this share as the backup user in PBS; as stated earlier in this thread that is a necessary to allowing PBS read/write access to the mount.

The final step is adding your SMB share as a datastore in PBS. For that you simply use the GUI to Add Datastore and set the backup path to /mnt/somefolder and it should mount.

Hope this was of use to you. Let me know how it goes when you try it out.

Hi, I successfully added a mount point that's pointed at my Synology NAS and I've added it as a data store. However, it shows the storage size of the data store to be the same size as the PBE drive (64GB). I cannot figure out why it would do this. Any ideas?

My next thought was to add the Synology Share in PVE and then add it to the PBE as a drive, but not sure yet if that'd work or have any disadvantages.

Any help would be greatly appreciated!
 
Let me ask, I use a physical server running windows server 2019 to backup data from proxmox, creating standard SMB/CIFS storage, but when connecting to the server running windows server 2019, I get an error (create storage failed: sotrage 'backupsvr' is notes online 500)
 

Attachments

  • error.jpg
    error.jpg
    184.5 KB · Views: 139
Let me ask, I use a physical server running windows server 2019 to backup data from proxmox, creating standard SMB/CIFS storage, but when connecting to the server running windows server 2019, I get an error (create storage failed: sotrage 'backupsvr' is notes online 500)
Having the some problem with a fresh 8.0.3 install... all good on 7.4
 
  • Like
Reactions: PSz
I'm not sure how much you know about PBS/Proxmox/Debian/Linux currently, but I'll do my best briefly explain what I did. I'm also assuming that you already have a working SMB share setup on some other machine.

First, you'll need to install CIFS utilities on PBS:
sudo apt install cifs-utils

Create a folder that you will mount the remote SMB share into:
mkdir /mnt/somefolder

Create a credentials file to store the credentials to access the remote machine:
nano /etc/samba/.smbcreds

... and set the username and password:
username=smb_username password=smb_password

Save your file and make it readable by root only:
chmod 400 /etc/samba/.smbcreds

Finally, mount your SMB share in PBS:
sudo mount -t cifs -o rw,vers=3.0,credentials=/etc/samba/.smbcreds //1.2.3.4/sharename /mnt/somefolder

Try to access the folder, and if it works attempt to write to it. If it works, make it auto-mount at boot by adding the following to /etc/fstab:
nano /etc/fstab
//1.2.3.4/sharename /mnt/somefolder cifs credentials=/etc/samba/.smbcred,uid=34,gid=34,defaults 0 0
Save the file. If for some reason something listed in /etc/fstab does not mount on reboot or if you made a change to it and need to test it, you can issue a mount -a to remount all shares.

Note: you may or may not need the vers=3.0 option when mounting.I didn't need it, so if it doesn't work with try again without it. Also, the uid=34,gid=34 means that you are mounting this share as the backup user in PBS; as stated earlier in this thread that is a necessary to allowing PBS read/write access to the mount.

The final step is adding your SMB share as a datastore in PBS. For that you simply use the GUI to Add Datastore and set the backup path to /mnt/somefolder and it should mount.

Hope this was of use to you. Let me know how it goes when you try it out.
There is a Typo in "//1.2.3.4/sharename /mnt/somefolder cifs credentials=/etc/samba/.smbcred,uid=34,gid=34,defaults 0 0[/ICODE]" smbcreds instead of smbcred
 
  • Like
Reactions: Boerny41
Thx for the hint with "uid=34,gid=34" with SMB-Shares!!
After messing around 1 hour, this solved my problem ...
Can this be find somewhere in the documentation?!?!
 
I'm not sure how much you know about PBS/Proxmox/Debian/Linux currently, but I'll do my best briefly explain what I did. I'm also assuming that you already have a working SMB share setup on some other machine.

First, you'll need to install CIFS utilities on PBS:
sudo apt install cifs-utils

Create a folder that you will mount the remote SMB share into:
mkdir /mnt/somefolder

Create a credentials file to store the credentials to access the remote machine:
nano /etc/samba/.smbcreds

... and set the username and password:
username=smb_username
password=smb_password

Save your file and make it readable by root only:
chmod 400 /etc/samba/.smbcreds

Finally, mount your SMB share in PBS:
sudo mount -t cifs -o rw,vers=3.0,credentials=/etc/samba/.smbcreds //1.2.3.4/sharename /mnt/somefolder

Try to access the folder, and if it works attempt to write to it. If it works, make it auto-mount at boot by adding the following to /etc/fstab:
nano /etc/fstab

//1.2.3.4/sharename /mnt/somefolder cifs credentials=/etc/samba/.smbcreds,uid=34,gid=34,defaults 0 0
Save the file. If for some reason something listed in /etc/fstab does not mount on reboot or if you made a change to it and need to test it, you can issue a mount -a to remount all shares.

Note: you may or may not need the vers=3.0 option when mounting.I didn't need it, so if it doesn't work with try again without it. Also, the uid=34,gid=34 means that you are mounting this share as the backup user in PBS; as stated earlier in this thread that is a necessary to allowing PBS read/write access to the mount.

The final step is adding your SMB share as a datastore in PBS. For that you simply use the GUI to Add Datastore and set the backup path to /mnt/somefolder and it should mount.

Hope this was of use to you. Let me know how it goes when you try it out.

For some reason this works but when I restart Proxmox Backup Server it doesn't mount the smb automatically so I have to run /mount -a

Why is that?
 
Solved!

Just add x-systemd.automount to the fstab mount options.

For example:

//NAS/SMB_Share /mnt/SMB_Share cifs credentials=/etc/samba/.smbcreds,x-systemd.automount,defaults 0 0
 
Last edited:
I'm not sure how much you know about PBS/Proxmox/Debian/Linux currently, but I'll do my best briefly explain what I did. I'm also assuming that you already have a working SMB share setup on some other machine.

First, you'll need to install CIFS utilities on PBS:
sudo apt install cifs-utils

Create a folder that you will mount the remote SMB share into:
mkdir /mnt/somefolder

Create a credentials file to store the credentials to access the remote machine:
nano /etc/samba/.smbcreds

... and set the username and password:
username=smb_username
password=smb_password

Save your file and make it readable by root only:
chmod 400 /etc/samba/.smbcreds

Finally, mount your SMB share in PBS:
sudo mount -t cifs -o rw,vers=3.0,credentials=/etc/samba/.smbcreds //1.2.3.4/sharename /mnt/somefolder

Try to access the folder, and if it works attempt to write to it. If it works, make it auto-mount at boot by adding the following to /etc/fstab:
nano /etc/fstab

//1.2.3.4/sharename /mnt/somefolder cifs credentials=/etc/samba/.smbcred,uid=34,gid=34,defaults 0 0
Save the file. If for some reason something listed in /etc/fstab does not mount on reboot or if you made a change to it and need to test it, you can issue a mount -a to remount all shares.

Note: you may or may not need the vers=3.0 option when mounting.I didn't need it, so if it doesn't work with try again without it. Also, the uid=34,gid=34 means that you are mounting this share as the backup user in PBS; as stated earlier in this thread that is a necessary to allowing PBS read/write access to the mount.

The final step is adding your SMB share as a datastore in PBS. For that you simply use the GUI to Add Datastore and set the backup path to /mnt/somefolder and it should mount.

Hope this was of use to you. Let me know how it goes when you try it out.

I managed to solve it this way:

The Mapping needed to go in UID and GID the user name: "backup" did not go with UID and GID 34

Note: I am using a CIFS share on Windows

Code:
mkdir /mnt/somefolder

Code:
chown -R backup:backup /mnt/somefolder

Code:
chmod -R 770 /mnt/somefolder

nano /etc/fstab

Code:
//1.2.3.4/BKP-PBS  /mnt/somefolder  cifs credentials=/etc/samba/.smbcred,vers=3.0,iocharset=utf8,file_mode=0777,dir_mode=0777,rw,uid=backup,gid=backup  0  0
 

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!