Unsuccessful in creating a network drive (CIFS/NFS) in Proxmox with Truenas as Server

RiceBuqit

New Member
Jul 16, 2020
8
1
1
43
Hi Proxmox,

First off, I would like to take a moment to show much appreciation for this VE. Whilst I've banged my head through many walls and scoured many corners of the internet for guidance, Proxmox has allowed me to learn so many new things regarding Linux, VE, (re-learn) Networking and many other new things. I am truly grateful for the lessons but please can you make some of the documentations idiot-proof - for I am one big idiot!!

System info:
Proxmox version: 6.4-7
1623207480411.png

Truenas version: 12.4
1623207789484.png

Now, returning to the main point of this post. Whilst I have read through many of the more recent posts on this platform, I am yet to find a thread that has a clear guide on the step-by-step resolution to this permissions issue when trying to create a CIFS / NFS drive on Proxmox whilst using TrueNAS as the storage / server.

I have followed many suggestions which mainly suggests that in order to resolve the below error message:

1623206212356.png

The permissions of the /mnt/pve/ folder needs to change to 777 in order to successfully mount the drive.

As I'm already logged in as root, why do I get operation not permitted message as depicted below:
1623207193305.png

TL:DR - I've created and enabled SMB and NFS share on my TrueNAS server but as I've explained above, I'm not able to create and mount the drive onto Proxmox which in turn means I cannot do a P2V migration of my physical servers. Please can someone help by sharing their step-by-step guide from their playbook so that I can get this up and running and start migrating my physical servers?

Please let me know if I've left out any other information and any help is much loved!!
 
  • Like
Reactions: Admiral Awesome
did you put in the correct permissions for the share/filesystem on the truenas side?

e.g. the smb user you give on the pve side must be able to read/modify/write the files on the share
 
Hi Dominik,

For the CIFS drive I'm trying to create, I entered the valid credentials as any other credentials doesn't show the shared drive (from TrueNAS) and as for the NFS drive, I've set the permission on the TrueNAS side as allowing everyone - as demonstrated below:

1623231271776.png.

Also, I know the credentials work for the SMB share as I can use it to access the drive from my windows directory.

Thanks

EDIT: I have no problems downloading the files or uploading more files to the SMB share via the windows directory and that's the same credentials I'm using for the drives I'm trying to create on Proxmox. Also, you can see from my initial post that within my /mnt/pve folder - the drive folders I'm trying to create is actually there but for some unknown reason (to me), the drives are not showing up on the Web GUI in Storage View:

1623231640866.png
 
Last edited:
oh, did you already mount it before trying to add as a storage? if yes, please unmount it and let pve handle it
if not, please post the output of the command 'mount'
 
Here is the output of the command 'mount':

Code:
root@pve:~# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=16242256k,nr_inodes=4060564,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=3260620k,mode=755)
/dev/mapper/pve-root on / type ext4 (rw,relatime,errors=remount-ro)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=25,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=20502)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/sda2 on /boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
lxcfs on /var/lib/lxcfs type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
/dev/fuse on /etc/pve type fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other)
//192.168.1.5/ChengJiun_Data on /mnt/pve/storage type cifs (rw,relatime,vers=3.0,cache=strict,username=paul,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.5,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=3260616k,mode=700)

I'm not sure I'm explaining myself very well, here's a link to a reddit post where the same problem has happened to someone else and how they resolved the issue... My problem is, I'm not able to do the same thing because I get "Operation not permitted" message when I try to chmod the /mnt/pve folder even though I'm logged in as root.

Reddit post

In summary, there are 2 issues I'm trying to resolve here.

1. I'm unable to create CIFS or NFS drive successfully due to a permissions problem from the Proxmox side and;
2. I cannot change the permission of the /mnt/pve folder as recommended by various different online posts because of the error message "Operation not permitted" even though I'm logged in as root.
 
//192.168.1.5/ChengJiun_Data on /mnt/pve/storage type cifs (rw,relatime,vers=3.0,cache=strict,username=paul,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.5,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1)
so you have already mounted the storage in /mnt/pve/storage
did you add it in /etc/fstab or something like that?
if yes remove it from there, unmount it, and retry from the gui, maybe with a different name

pve mounts the nfs/cifs by itself, there is no need to do that manually
 
so you have already mounted the storage in /mnt/pve/storage
did you add it in /etc/fstab or something like that?
if yes remove it from there, unmount it, and retry from the gui, maybe with a different name

pve mounts the nfs/cifs by itself, there is no need to do that manually
Hi,

I think my problem has been lost in translation somewhere along the lines. From scouring the internet for a solution,this problem seems to have been around for quite some time.

I am not trying to mount the drive via the cli, I am experiencing this permissions problem from the GUI when trying to create both CIFS and NFS. The error message I've attached in my first post on this thread shows the error message from the GUI...

I don't understand why I cannot create the account when my truenas share drive is set to allow everybody but proxmox still denies me when I'm trying to create the drive - even if I've deleted and removed the previous folders via the cli... The only solution I've found on the internet says I need to chmod the /mnt/pve folder to 777 but when I try to do this as root,I get the error message "operation not permitted"!

Please can you provide some insight why following the documentation on the proxmox wiki doesn't work? And also,how can I resolve this matter?
 
ok from the beginning

the error you got in the first post when doing chmod 777 is because the folder mounted at '/mnt/pve/CJ_TrueNAS' did not allow that, why that is i cannot retroactively say but it seems there nothing mounted there anymore

you should not run 'chmod -R 777' anywhere (it does so recursively)
and especially in /mnt/pve this should not be necessary (since we create those as root anyway)

please provide the output of the following (so that i can help you)
Code:
ls -lh /mnt/pve
cat /etc/pve/storage.cfg
mount

this will get me an overview what is mounted/configured/there/etc.

then please post the config you want to add via the gui (server/username/etc)
and also the relevant config from the nfs/cifs server
 
ok from the beginning

the error you got in the first post when doing chmod 777 is because the folder mounted at '/mnt/pve/CJ_TrueNAS' did not allow that, why that is i cannot retroactively say but it seems there nothing mounted there anymore

you should not run 'chmod -R 777' anywhere (it does so recursively)
and especially in /mnt/pve this should not be necessary (since we create those as root anyway)

please provide the output of the following (so that i can help you)
Code:
ls -lh /mnt/pve
cat /etc/pve/storage.cfg
mount

this will get me an overview what is mounted/configured/there/etc.

then please post the config you want to add via the gui (server/username/etc)
and also the relevant config from the nfs/cifs server
Please find screenshots attached below:

Output of first 2 commands:
1623892750136.png

Output of mount command
1623892787243.png

Information I'm adding to create CIFS drive - Username and pw is related to an account information on TrueNAS and I've already set CIFS to allow everyone as I have mentioned in my previous posts on this thread.
1623892919308.png

SMB Share ACL which shows I'm allowing everyone with full permissions (I'm not concerned about security at this stage as I just want to get this working)
1623893209900.png

TrueNAS SMB Share configs:
1623893476692.png

TrueNAS configs continued:
1623893563095.png

Please feel free at any point to tell me this is a TrueNAS config matter and I'll happily continue this conversation on their community page.

Thank you once again for all your help. I understand that this is a community page and any help is greatly appreciated.

RB
 

Attachments

  • 1623892955196.png
    1623892955196.png
    5.4 KB · Views: 4
ok i tried to reproduce by setting up a truenas instance here, and the problem is probably that the user you selected does not have the correct permissions on the directory on the truenas server
the user you login to must be able to create directories and write to the directory on truenas, otherwise it will not work...
 
  • Like
Reactions: RiceBuqit
ok i tried to reproduce by setting up a truenas instance here, and the problem is probably that the user you selected does not have the correct permissions on the directory on the truenas server
the user you login to must be able to create directories and write to the directory on truenas, otherwise it will not work...
Now what if I told you that even using the root login for truenas still doesn't let me create the CIFS drive? I still get that same Permission denied message.

But from your post,I understand that this is a truenas permissions issue...so maybe I just need to look at my smb settings again.
 
But from your post,I understand that this is a truenas permissions issue...so maybe I just need to look at my smb settings again.
Did you changed the user and group of the dataset to the one used for the SMB share? You need to check the "Apply User" and "Apply Group" checkboxes or the user/group won't be changed. And the "Apply permissions recursively" checkbox is important if that dataset already got files on it. If it is not checked the owners of existing folders on that dataset won't be changed. And you should restart your SMB service on the TrueNAS server after that.
Unbenannt.png
 
Last edited:
  • Like
Reactions: RiceBuqit
Did you changed the user and group of the dataset to the one used for the SMB share? You need to check the "Apply User" and "Apply Group" checkboxes or the user/group won't be changed. And the "Apply permissions recursively" checkbox is important if that dataset already files on it. If it is not checked the owners of existing folders on that dataset won't be changed. And you should restart your SMB service on the TrueNAS server after that.
View attachment 26900
Thanks, I'll look into it again and see where this is. I don't think I've come across this settings page which is probably why I'm having this issue.
 
Thanks, I'll look into it again and see where this is. I don't think I've come across this settings page which is probably why I'm having this issue.
Storage -> Pool -> YourPool -> YourDataset -> click on the three dots on the right -> edit permissions
 
@RiceBuqit I tried to make it work some time ago. But then I gave up and made a new truenas Unix share NFS 1631871364255.png
And I shared that instead with proxmox using NFS mount. No pws/issues/etc. It "works", probably unsecure aff, but I'm only sharing iso/vm data etc.
Maybe this will work for you.
 
The cifs/smb shares are allways mounted as root(755) in proxmox even though the samba permissions might be everyone read/wright 777 and are immutable (see the mount options) and managed by the proxmox storage subsystem! This is much too strict imo...
 

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!