When I try to mount with the following command:
mount -v -t cifs //<storageaccount>.file.core.windows.net/<sharename> <localfolder> -o username=<myuser>,password=<storageaccountkey>,dir_mode=0777,file_mode=0777,vers=3.0
It works perfectly if I run it from an Azure Ubuntu VM or my Windows machine with the equivalent command.
Trying to run the same command on my Linux box I get the following error:
mount error(13): Permission denied
And this from dmesg:
[ 9421.865985] Status code returned 0xc0000022 STATUS_ACCESS_DENIED
[ 9421.865994] CIFS VFS: Send error in SessSetup = -13
[ 9421.866098] CIFS VFS: cifs_mount failed w/return code = -13
I have the same version of CIFS as the VM: 6.4.
I enabled SMB2-SMB3-SMB3.1.1 (experimental) in my kernel (4.4.21-gentoo).
I have samba installed as well (and it doesn't work with smbclient either) but it is my understanding they are unrelated.
Unfortunately, you can't yet. Atm only Windows 8, 10 and Window Server 2012 (R2) are supported if mounting outside Azure Datacenter.
The Linux SMB client doesn’t yet support encryption, so mounting a file share from Linux still requires that the client be in the same Azure region as the file share. However, encryption support for Linux is on the roadmap of Linux developers responsible for SMB functionality. Linux distributions that support encryption in the future will be able to mount an Azure File share from anywhere as well.
More Info:
https://azure.microsoft.com/en-us/documentation/articles/storage-how-to-use-files-linux/#overview
I would definitely recommend you to spawn a Windows-based virtual machine to do the job. I am doing a different story on Windows when I need a reliable NFS server/client on Windows.
Does it work for you with smbclient?
This works for me, while "mount -t cifs -overs=3.0"... does not.
smbclient //foo.file.core.windows.net/test -mSMB3 -e -Ufoo%longkeyhere==
Here is the case for me....
When I tried with in Azure (My VM is on Azure and My Storage account is also on the same region) with SMB 3.0, I have been getting mount errors. But when I changed the SMB Version to 2.1, it got succeed. See Below with Examples
Eg:
sudo mount -t cifs //storageaccountname.file.core.windows.net/shared /mnt/mount -o vers=3.0,username=xxxxxxx,password=xxxxxxxx,dir_mode=0777,file_mode=0777
Result:
mount error(11): Resource temporarily unavailable Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
sudo mount -t cifs //storageaccountname.file.core.windows.net/shared /mnt/mount -o vers=2.1,username=xxxxxxx,password=xxxxxxxx,dir_mode=0777,file_mode=0777
Result:
It got mounted successfully
Recently I was facing same problem. I was trying to mount Azure file service to Azure Linux VM. After multiple attempts, it mounted.
In the last attempt (RHEL 7.4), I upgraded Kernel and added Samba-client, samba-client-libs.
yum install kernel-3.10.0-862.el7.x86_64
yum install samba-client samba-client-libs
I believe the issue was with either, it used samba client rather cifs-util or kernel version was not had some bug.
According to your description, I test it again. Unfortunately, we can’t mount File Share outside the Azure VMs. You could use commands to check the installed packages and OS’s kernel for your VMs.
Even though the VM’s packages and OS’s kernel are the same, we could not mount Azure File Share on on-premises VMs. Actually, Linux server hosted in Azure VM will work is because Azure File Storage accept SMB2.1 connection if the client is in the same Azure region as the file share.
However, when you try mount from on-premises, Azure File Storage request SMB 3.0 with Encryption enforced from client, but SMB 3.0 Encryption is something Linux doesn’t support yet, so it won’t work at this moment even your specified SMB 3.0 in your commands.
User contributions licensed under CC BY-SA 3.0