7

I've got a Windows Server VM on Azure. I also have a File Share. According to the MS documentation, one can mount the drive using the following command:

net use <drive-letter>: \\<storage-account-name>.file.core.windows.net\<share-name>

This does indeed work.

Unfortunately, the documentation makes no mention of how to unmount the storage...

Does anyone know how to do this?

pookie
  • 3,796
  • 6
  • 49
  • 105

3 Answers3

9

To unmount a File Share drive, simply use:

net use <drive-letter> /delete

This will detach the drive.

Gaurav Mantri
  • 128,066
  • 12
  • 206
  • 241
  • Great. Thank you! It would be nice if we could use /detach rather than /delete. Delete sounds scary, like all disk contents will be removed... – pookie Mar 30 '17 at 08:05
  • 1
    `Delete` actually detaches it. But I agree that it does sound scary. BTW, I have updated the documentation to include these instructions there. Submitted a Pull Request. Hopefully it will get approved :). – Gaurav Mantri Mar 30 '17 at 08:11
  • This works. I have to add that you need to do it as an Administrator, otherwise it just hangs (in my case). And reboot Windows, otherwise Explorer was acting weird. – Huy Hoang Mar 01 '23 at 15:32
2

I found this looking for an answer for a Linux VM. Since the question title may lead others here too, I'll add a Linux solution:

sudo umount /mnt/<yourfileshare> #sudo is required

This assumes that your Azure FileShare was mounted at /mnt/<yourfileshare>, which is what the pre-built script does.

John
  • 1,018
  • 12
  • 19
1

how to unmount the storage

You can login your VM via RDP, then select network locations and select the file share disk. select disconnect.
enter image description here

Jason Ye
  • 13,710
  • 2
  • 16
  • 25