Search code examples
azureazure-storage

"Unable to find suitable address" when trying to mount Azure File storage


Basically I created a file storage account in Azure, with the settings allowing any network to mount this storage.

When I go to my VM (in Azure as well) and I run the following command (redacted)

sudo mount -t cifs //redacted.file.core.windows.net/redacted-media /mnt/redacted-media/ -o vers=3.0,username=redacted,password=redacted,dir_mode=0777,file_mode=0777,sec=ntlmssp

I get the error Unable to find suitable address. I already opened ports 445 and 139 in the network settings for the VM but still no luck.

The logs errors are the following:

Feb 11 13:26:25 redacted kernel: Firewall: *TCP_OUT Blocked* IN= OUT=eth0 SRC=x.x.x.x DST=40.116.232.108 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=4094 DF PROTO=TCP SPT=57282 DPT=445 WINDOW=29200 RES=0x00 SYN URGP=0 Feb 11 13:26:27 redacted kernel: Firewall: *TCP_OUT Blocked* IN= OUT=eth0 SRC=x.x.x.x DST=40.116.232.108 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=4095 DF PROTO=TCP SPT=57282 DPT=445 WINDOW=29200 RES=0x00 SYN URGP=0 Feb 11 13:26:27 redacted kernel: Firewall: *TCP_OUT Blocked* IN= OUT=eth0 SRC=x.x.x.x DST=40.116.232.108 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=46253 DF PROTO=TCP SPT=50176 DPT=139 WINDOW=29200 RES=0x00 SYN URGP=0


Solution

  • When you want to mount the file share in Azure storage account to your Azure Linux VM, you could follow this DOC: Use Azure Files with Linux. In your case, the problem probably is your password which should be a storage account key. You could find it from storage account--settings---Access keys---select Key1 or Key2. Also, default the Azure VM outbound traffic has no restriction on port 445. You should ensure that the outbound traffic from Azure VM to your storage account is not blocking port 445.

    The detailed steps:

    1. For a connection in other Azure regions, differ from your storage account, you must use SMB 3.0, SMB 3.0 encryption support was introduced in Linux kernel version 4.11.
    2. The cifs-utils package is installed. For example, you could run this on Ubuntu. sudo apt-get update sudo apt-get install cifs-utils
    3. Decide on the directory/file permissions of the mounted share. In the examples below, permission 0777 is used to give read, write, and execute permissions to all users.
    4. Ensure port 445 is open: SMB communicates over TCP port 445 - check to see if your firewall is not blocking TCP ports 445 from the client.

    Remember to replace storage-account-name, share-name, smb-version, storage-account-key, and mount-point with the appropriate information for your environment. This works on my side, I use Linux Ubuntu 4.15.0-1036.

    sudo mount -t cifs //storageaccountname.file.core.windows.net/fileshare  /mnt/MyAzureFileShare -o vers=3.0,username=storageaccountname,password=xxxstorageaccountkeyxxx,dir_mode=0777,file_mode=0777,serverino
    

    enter image description here enter image description here