question

CostaFrancescColorandImagingBarcel-1695 avatar image
0 Votes"
CostaFrancescColorandImagingBarcel-1695 asked DmitryKutetsky-3958 answered

Azure Files mounted on Ubuntu fail after starting VM

Hi,

I have followed this tutorial and mounted Azure Files in Ubuntu persistently with /etc/fstab

https://docs.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-linux

My VM's at Azure are normally stop. I find out that sometimes when I start them for the first time the mount does not have the Azure Files. If I restart the VM, the problem normally disappears.

What can be the issue here?

Thanks in advance,

Francesc

azure-virtual-machinesazure-files
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

deherman-MSFT avatar image
0 Votes"
deherman-MSFT answered

@CostaFrancescColorandImagingBarcel-1695
Since you are using Ubuntu you can try adding the option x-systemd.automount to /etc/fstab. If you are using an older version of Ubuntu you can try using _netdev. For some discussion on this issue you can checkout this StackExchange thread.

Hope this helps. Let me know if you are still facing issues or have further questions.



Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

CostaFrancescColorandImagingBarcel-1695 avatar image
0 Votes"
CostaFrancescColorandImagingBarcel-1695 answered deherman-MSFT commented

Thanks @deherman-MSFT

I have added x-systemd.automount as a separate line in /etc/fstab but still the Azure Files don't get mounted at start-up.

I also have run this:

 After adding x-systemd.automount to an fstab line, you need to run:

 sudo systemctl daemon-reload

 and then one, or both, of the following:

 sudo systemctl restart remote-fs.target
 sudo systemctl restart local-fs.target

 only then will the automount become active.

but the Azure Files do not get mounted.

What else can I do?

Why do they get mounted with restart the VM but not with start?

Francesc

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@CostaFrancescColorandImagingBarcel-1695
Sorry to hear that didn't resolve your issue. Can you let me know what version of Ubuntu you are using? Also please provide your fstab entry. I will work on reproducing to see if I can find the answer.

0 Votes 0 ·
CostaFrancescColorandImagingBarcel-1695 avatar image
0 Votes"
CostaFrancescColorandImagingBarcel-1695 answered

@deherman-MSFT

Thanks. I am using Linux (ubuntu 18.04) and this is my fstab:


CLOUD_IMG: This file was created/modified by the Cloud Image build process

UUID=8c0a4742-2f51-40b4-b659-357cfb0bb2a3 / ext4 defaults,discard 0 0
UUID=5BCE-FF6A /boot/efi vfat defaults,discard 0 0
//evokerstorageuser.file.core.windows.net/3dsamples /mnt/evokerstorageuser/3dsamples cifs nofail,uid=azureuser,file_mode=0777,dir_mode=0777,vers=3.0,credentials=/etc/smbcredentials/evokerstorageuser.cred,serverino
x-systemd.automount
/dev/disk/cloud/azure_resource-part1 /mnt auto defaults,nofail,x-systemd.requires=cloud-init.service,comment=cloudconfig 0 2

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DmitryKutetsky-3958 avatar image
0 Votes"
DmitryKutetsky-3958 answered

@CostaFrancescColorandImagingBarcel-1695, the /mnt directory are used by Azure/cloud-init as ephemeral storage as you can see in a fstab.
As the simplest option, you can try mounting your share in another directory, like /data.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.