Skip to content

Instantly share code, notes, and snippets.

@rudelm rudelm/autofs.md

Last active Aug 12, 2020
Embed
What would you like to do?
Use autofs on Mac OS X to mount network shares automatically during access

Autofs on Mac OS X

With autofs you can easily mount network volumes upon first access to the folder where you want to mount the volume. Autofs is available for many OS and is preinstalled on Mac OS X so I show you how I mounted my iTunes library folder using this method.

Prepare autofs to use a separate configuration file

autofs needs to be configured so that it knows where to gets its configuration. Edit the file '/etc/auto_master' and add the last line:

#
# Automounter master map
#
+auto_master		# Use directory service
/net			-hosts		-nobrowse,hidefromfinder,nosuid
/home			auto_home	-nobrowse,hidefromfinder
/Network/Servers	-fstab
/-			-static
/-          auto_smb    -nosuid,noowners
#/-			auto_afp	-nobrowse,nosuid

This will tell autofs to look for a file in the '/etc' folder with name 'auto_smb'. In this case I want to create a configuration for automatically mount SMB volumes. You are free to choose a different name and can also use afp/cifs/nfs etc.

Content of the configuration file

Normally Mac OS X tries to mount network shares into the '/Volumes' folder. This is the default folder for all mounted shares on a mac. However, if you try to directly mount into this folder, autofs will fail. You just add a '/../' in front of your desired mount path and Mac OS X will even accept the Volumes folder. However, some Mac OS Version doesn't like this so I switched over to use my own folder named '/mount'.

If you want to configure AFP, do it like this:

So add this line to '/etc/auto_afp':

/../Volumes/music	-fstype=afp,rw afp://ip-address:/music

Mac OS X is clever enough to lookup the username and password from the Mac keychain so there's no need to add the username and password in clear text to the configuration file.

If you want to configure SMB, do it like this:

Add this line to '/etc/auto_smb':

/mount/music    -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@ip-address:/music

Unfortunately you will need to add the user and password to the resource :( You can try to lock it down further using the Mac OS permissions but that won't help when the attackers user got admin rights as well.

Access the folder and see autofs in action

You now need to restart the autofs service with the command 'sudo automount -cv'. If you now type mount, you'll see a listing of currently mounted volumes. Your desired volume shouldn't be mounted, so unmount it with 'sudo umount /Volumes/volumename' or 'sudo umount /mount/music' before we continue.

You can now switch to '/Volumes/music' or '/mount/music' folder or let it list on the terminal. Once you do that autofs will automatically try to mount the desired volume into this folder.

See an example and explanation in action

Visit my blog post where I explain this gist a little bit more in detail.

@anvena

This comment has been minimized.

Copy link

anvena commented Jan 19, 2017

Hello,

Thank you for good examples. Would you be able to provide with example how to configure nfs for Mac Os Sierra?

@arontx

This comment has been minimized.

Copy link

arontx commented Feb 23, 2017

This does not work as the share is mounted root only

@deephack1982

This comment has been minimized.

Copy link

deephack1982 commented Mar 22, 2017

I have the same issue as artonx on MacOSX 10.12.1 that the volumes get mounted at root. Is this a known problem or am I doing something wrong?

@uberspeck

This comment has been minimized.

Copy link

uberspeck commented Jan 13, 2018

Anyone have any luck getting this to work in High Sierra? Trying to mount my Synology NAS and nothing I try is working. Is autofs just broken?

@caramdache

This comment has been minimized.

Copy link

caramdache commented Jan 27, 2018

See at the end of the post for a solution on High Sierra http://blog.grapii.com/2015/06/keep-network-drives-mounted-on-mac-os-x-using-autofs/

@tolsadus

This comment has been minimized.

Copy link

tolsadus commented Feb 23, 2018

@turkeyphant

This comment has been minimized.

Copy link

turkeyphant commented Dec 27, 2018

I did this. However, it made my system completely unusable.

Finder and alternatives would instantly become unresponsive and have to be killed from Activity Monitor or the terminal. Several other apps wouldn't even start or would crash instantly on boot. No amount of restoring from old Time Machine system backups helped.

Was I doing something completely wrong? I still don't get why a share being unavailable would make the whole system break.

@turkeyphant

This comment has been minimized.

Copy link

turkeyphant commented Apr 25, 2019

Seems a possible solution is to use "nofail". But does anyone know what "soft,noowners,nosuid,rw" do?

@gabeosx

This comment has been minimized.

Copy link

gabeosx commented Nov 8, 2019

Does this work with Catalina? I am not able to get this working.

iMac:Volumes gabe$ sudo automount -cv
automount: /System/Volumes/Data/home updated (/home -> /System/Volumes/Data/home)
automount: /System/Volumes/Data/Music updated (/Music -> /System/Volumes/Data/Music)
automount: /System/Volumes/Data/Video updated (/Video -> /System/Volumes/Data/Video)
automount: no unmounts
iMac:Volumes gabe$ cd /Video
-bash: cd: /Video: No such file or directory
iMac:Volumes gabe$ cd /System/Volumes/Data/Music/
-bash: cd: /System/Volumes/Data/Music/: No such file or directory

I also do not see any authentication activity on the NAS, so I am skeptical that it is even trying to mount the drive

@rudelm

This comment has been minimized.

Copy link
Owner Author

rudelm commented Nov 10, 2019

Hi guys, sorry I did not notice that there were so many responses to this gist.

I did not install Catalina yet, since it seems to be too buggy in my opinion.

@chadj

This comment has been minimized.

Copy link

chadj commented Dec 20, 2019

@gabeosx I just tested this on Catalina and learned that auto mounts seem to have to go in /System/Volumes/Data now.

So your /etc/auto_smb should look like:

/System/Volumes/Data/mount/music -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@ip-address:/music

Once I made that change it worked fine.

@alextmz

This comment has been minimized.

Copy link

alextmz commented Feb 5, 2020

Worked for me with the caveats:

  • Use domain; (domain and semicolon) before username to indicate a domain if you're in one;
  • Use URL-encoded characters for special chars on password and share (SMB) name
  • Use normal chars for special chars on the local directory target name

So, this worked on MacOs 1.14.6:

/../Volumes/username$ -fstype=smbfs,soft,noowners,nosuid,rw ://domain;username:password%64@server:/username$24

@torrentlord

This comment has been minimized.

Copy link

torrentlord commented Mar 13, 2020

@chadj I followed your method and it mounted my Qnap folders mount and stay mounted in Catalina.

@apwelsh

This comment has been minimized.

Copy link

apwelsh commented May 1, 2020

Just a heads up, I am moving away from autofs. I recently migrated to a Synology NAS and adapted all this to mount my NAS volumes. Recently after the MacOS 10.15.4 update, the automount process is running frequently, and leaving hundreds of mounts open (and breaking current mounts while re-mounting) making the autofs solution impossible to use. If anyone has this issue, and found a solution, I would love to hear from you. Until then, I have converted my system from a multi-user system, to just a single user (me) with AFP/SMB mounts not handled by autofs.

@DanielPaquin

This comment has been minimized.

Copy link

DanielPaquin commented May 13, 2020

Hello I am very knew into this subject and would appreciate getting your help.

Using auto_smb I want to achieve the same as

Go + Connect to Server
smb://username:password@NASipaddress/Data

When going to Terminal I've found the following "/etc/Volumes/Data" . This allow me to access my Synology NAS called FARAMIR giving me access to Data.

At the moment my auto_smb looks like this:
/mount/Data -fstype=smbfs,soft,noowners,nosuid,rw ://username:password:NASipaddress:/Data

When going to Terminal I've found the following "/etc/Mount/Data" and nothing about the NAS under "/etc/Volumes/". Should my auto_smb code look like this instead?
/System/Volumes/Data -fstype=smbfs,soft,noowners,nosuid,rw ://username:password:NASipaddress:/Data

Also, another volume called "Anonymous WebDav" needs to be made available from my NAS. The blank between "Anonymous" and "WebDav" is causing problems. How do I solve this?

MANY THANKS!

@torrentlord

This comment has been minimized.

Copy link

torrentlord commented May 14, 2020

Hi @DanielPaquin,

I’ll try and help with your query, I’ll type under your questions below:

Hello I am very knew into this subject and would appreciate getting your help.

Using auto_smb I want to achieve the same as

When you use Go and Connect to server, it places the share in /Volumes on Mac. This is a special folder and you cannot use this to have a mounted file and autofs. Apple doesn’t want you storing mounts here any more. They need to be stored in /data or elsewhere if using autofs. Its a huge amount of mucking around trying to mount permanently in volumes.

Go + Connect to Server
smb://username:password@NASipaddress/Data

When going to Terminal I've found the following "/etc/Volumes/Data" . This allow me to access my Synology NAS called FARAMIR giving me access to Data.

At the moment my auto_smb looks like this:
/mount/Data -fstype=smbfs,soft,noowners,nosuid,rw ://username:password:NASipaddress:/Data

**Your Auto_SMb needs to look like this for Qnap: /System/Volumes/Data/Nas/Download -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@192.168.0.000/Download. (I have a folder called Nas for my mounted drives (you don’t need this) and my mounted drive is called Download. For Synology use: /System/Volumes/Data/Nas/Download -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@192.168.0.000/Volume1/Download

When going to Terminal I've found the following "/etc/Mount/Data" and nothing about the NAS under "/etc/Volumes/". Should my auto_smb code look like this instead?
/System/Volumes/Data -fstype=smbfs,soft,noowners,nosuid,rw ://username:password:NASipaddress:/Data
Yes this would work
Also, another volume called "Anonymous WebDav" needs to be made available from my NAS. The blank between "Anonymous" and "WebDav" is causing problems. How do I solve this?
Rename the drive to AnonymousWebDav and use the above examples, replace Download with /AnonymousWebDav
MANY THANKS!

Cheers
Casey

@DanielPaquin

This comment has been minimized.

Copy link

DanielPaquin commented May 14, 2020

Thanks @casey for your help.

My NAS is Synology which contains the following three volumes "Data", "MP4files" and "Anonymous WebDav".

I've tried with :
/System/Volumes/Data -fstype=smbfs,soft,noowners,nosuid,rw ://username:password:NASipaddress:/Data
and I had the following message "automount : /System/Volumes/Data: Operation not permitted.
Apple doesn’t want you storing mounts here any more. would that be the reason the Operation is not permitted?

To access the information contained on the NAS I need the mounted volumes to be called "Data", "MP4files" and "Anonymous WebDav". For "Anonymous WebDav" you recommendation is to rename the Volume. I'll see what I can do there as there other programs which currently uses "Anonymous WebDav" renaming it to "AnonymousWebDav" implicates a lot of additional work.

Under the /Volumes/Data/ I have the following structure:

/Data/ZVinformatique/CurrentCompetition/01
/Data/ZVinformatique/CurrentCompetition/02
/Data/ZVinformatique/CurrentCompetition/03 ... 99
/Data/ZVinformatique/MPEGfiles

How can I make the auto_smb command to mount a volume being called "Data"?

For Synology use: /System/Volumes/Data/Nas/Download -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@192.168.0.000/Volume1/Download

This is how I read this command:
/System/Volumes/Data/Nas/Download : "DOWNLOAD" would be the name of the Volume being mounted, then being visible in Finder
192.168.0.000/Volume1/Download : the Volume being fothe Synology NAS is "Download". Why Volume1?

If Apple doesn’t want you storing mounts be in Volumes ? What is the solution ? To me /System/Volumes/Data attempt to do exactly that. Am I correct?

://username:password@192.168.0.000/Volume1/Data What really confuse me here is the /Volume1

System/Volumes/Data/Nas/Data -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@192.168.0.000/Data

@apwelsh

This comment has been minimized.

Copy link

apwelsh commented May 14, 2020

Easy. Don’t mount to a system path.
/System/Volumes/Data is the root directory of your system. With rootless mode of MacOS, nothing is writable under /, nothing. It is a read only file system. Instead, the files you may write to are located under /System/Volumes/Data

So, /Volumes is an auto mount to points to /System/Volumes/Data/Volumes

If you want /Data, then you need to mount it to /System/Volumes/Data/Data

If you want to mount it to /Volumes, then you can do this, but you need to instill a bit of trickery. To mount to /Volumes/Data enter the mount point as /System/Volumes/Data/./Volumes/Data

Again, /System/Volumes/Data is the / mount, the /./ is a relative path to points to the same place, so it does not break your mount but it does trick Apple’s blacklist that prevents you from mounting into /Volumes.

@torrentlord

This comment has been minimized.

Copy link

torrentlord commented May 14, 2020

Thanks @casey for your help.

My NAS is Synology which contains the following three volumes "Data", "MP4files" and "Anonymous WebDav".
Hi Daniel, I will try to explain below, I have a QNAP and my solution works. My friend has a Synology and I got to to work by adding Volume1. I don't know why but it was the only way I could get the shares from Synology to mount on my MAC
I've tried with :
/System/Volumes/Data -fstype=smbfs,soft,noowners,nosuid,rw ://username:password:NASipaddress:/Data
and I had the following message "automount : /System/Volumes/Data: Operation not permitted.

**Try This:
/System/Volumes/Data/Nas/Data -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@192.168.0.000/Volume1/Data
/System/Volumes/Data/Nas/MP4files -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@192.168.0.000/Volume1/MP4files
/System/Volumes/Data/Nas/Anonymous WebDav -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@192.168.0.000/Volume1/Anonymous WebDav

The above solution will add a folder called Nas under /System/Volumes/Data where the drives will be mounted.
**

Apple doesn’t want you storing mounts here any more. would that be the reason the Operation is not permitted?
No this isn't the reason its not working is your script isn't right, the Synology won't mount unless you add Volume1. If you look inside your Synology shares they are probably sitting on Volume1. No need to add volume one for Qnap

@DanielPaquin

This comment has been minimized.

Copy link

DanielPaquin commented May 14, 2020

Many thanks for helping me!

The permission I do have to Volumes is as follow

drwxr-xr-x@ 5 root wheel 170 14 May 03:12 Volumes

Mac-mini-de-danielpaquin:Volumes danielpaquin$ ls -al
total 24
drwxr-xr-x@ 5 root wheel 170 14 May 03:09 .
drwxr-xr-x 41 root wheel 1462 10 May 23:28 ..
lrwxr-xr-x 1 root wheel 1 14 May 03:08 Macintosh HD -> /
drwxrwxr-x 23 danielpaquin staff 850 30 Oct 2019 Macintosh HD2

The result of the execution is:

Mac-mini-de-danielpaquin:etc danielpaquin$ sudo automount -cv
automount: /net updated
automount: /home updated
automount: /System/Volumes/Data/Nas/Data: Operation not permitted
automount: /System/Volumes/Data/Nas/Anonymous: Operation not permitted

As you can see Data is not in the root directory of my system. The only time I've seen Data under Volumes is when I've used the Go to Connect to Server. The Operation not permitted, is it because I do not have the privilege to create /Nas/Data since /Volumes/Data does not even exist at the time I do the "sudoauto mount -cv"

@torrentlord

This comment has been minimized.

Copy link

torrentlord commented May 14, 2020

@DanielPaquin

This comment has been minimized.

Copy link

DanielPaquin commented May 14, 2020

@apwelsh

This comment has been minimized.

Copy link

apwelsh commented May 14, 2020

I don’t have a system running High Sierra to test in, but on that system, just use the target path. No need to use /System/Volumes/Data. But when I am noticing in your replies is that you seem to be trying to mount the NAS — you cannot do that. Instead, you need to mount the shares in your nas. So, for SMB://nas.local/Data you would mount that to /NAS//Data and prior to that, you need to create the folder /NAS and permission it.

(For example)
sudo mkdir /NAS
sudo chmod 775 /NAS

Then edit you auto_smb file to mount the share Data from nas.local to /NAS/Data

@DanielPaquin

This comment has been minimized.

Copy link

DanielPaquin commented May 14, 2020

Thanks @apweish

the auto_smb is as following:
/System/Volumes/Data/Nas/Anonymous WebDav -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@192.168.0.000/Volume1/Anonymous WebDav

if I understand correctly what you are suggesting for the auto_smb is something like the following, does this make sense?
/NAS/Data -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@FARAMIR.local/Data

Where do you recommend I make the NAS directory?

@apwelsh

This comment has been minimized.

Copy link

apwelsh commented May 14, 2020

Correction: I retracted my prior statement, as I was not sitting in front of my computer, and had forgotten that UNC notation is not used for SMBFS. I left my statement about ConnectMeNow and my new aversion to autofs in place, since it still applies.

Not sure if that matters. I stopped using authors and switched to the ConnectMeNow app. The reason is Autofs was too limited. It would remount stuff while in use and cause network issues. Since I got my NAS, I moved away from NFS (which I used because it allowed multiple users to use the same mount point) and concert to afp and smb, but every update I would have to setup my auto_master again and with the glitchy network issues I decided to just let an app manage it. It has been solid since. So if you can’t get this working, just grab a copy of ConnectMeNow

@DanielPaquin

This comment has been minimized.

Copy link

DanielPaquin commented May 14, 2020

Thanks again @apweish

What is the meaning of "unc"?

Would you recommend I make the /Nas folder under /Volumes or somewhere else?

I will look an ConnectMeNow as an alternative. The reason I am looking at auto_master, auto_smb solution is the NAS has be mounted without me having to long onto a user account. My requirements is to turn-on the mac mini and have ready to use FileMaker Server and the NAS volumes (Data and Anonymous WebDav). This is what I mean by in the backend. i.e no need to log onto a specific users to have required resources ready to be used by other filmmaker pro clients.

@jaques-sam

This comment has been minimized.

Copy link

jaques-sam commented May 14, 2020

Hello, can this be updated for MacOS Catalina? This doesn't seem to work anymore :(

@apwelsh

This comment has been minimized.

Copy link

apwelsh commented May 14, 2020

Daniel, I missed that you needed it mounted without a login. Then autofs is your solution. UNC stands for Universal Naming Convention. It is like a URL, but used for all types of protocols, not just web protocols. smb:// afp:// nfs:// are all UNC prefixes.

I just used this, and it works in my auto_smb.

/System/Volumes/Data/NAS/Scratch      -fstype=smbfs,soft,noowners,nosuid,rw ://apwelsh:mypassword@192.168.0.100:/cp-scratch

This creates a mount on my computer at /NAS/Scratch (because /System/Volumes/Data is the writeable mount point for /)

For maximum reliability, automounter should use IP Addresses, so to correct my bad answer (corrected up above), use:

/NAS/Data -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@FARAMIR.local/Data

Make sure in Finder that you Eject anything pointing to FARAMIR or the automouter will fail. My prior answer was wrong, because the UNC is not used with -fstype=smbfs. What does your auto_master look like?

@torrentlord

This comment has been minimized.

Copy link

torrentlord commented May 14, 2020

Hello All, I am using High Sierra. Regards!

**Hi Daniel, sorry for the delay, time differences, the solution for High Sierra is. I have assumed your computer username is danielpaquin. this has worked for years prior to switching to Catalina. Again this will create a folder called Has under username to mount your drives.:

sudo nano /etc/auto_master

Automounter master map

+auto_master # Use directory service
/net -hosts -nobrowse,hidefromfinder,nosuid
/home auto_home -nobrowse,hidefromfinder
/Network/Servers -fstab
/- -static
/- auto_smb -nosuid,noowners

sudo nano /etc/auto_smb

/Users/danielpaquin/Nas/Data -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@192.168.0.000/Volume1/Data
/Users/danielpaquin/Nas/MP4files -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@192.168.0.000/Volume1/MP4files
/Users/danielpaquinNas/Anonymous WebDav -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@192.168.0.000/Volume1/Anonymous WebDav

or

/Users/danielpaquin/Nas/Data -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@192.168.0.000/Data
/Users/danielpaquin/Nas/MP4files -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@192.168.0.000/MP4files
/Users/danielpaquinNas/Anonymous WebDav -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@192.168.0.000/Anonymous WebDav

sudo automount -vc
**

@DanielPaquin

This comment has been minimized.

Copy link

DanielPaquin commented May 14, 2020

Hello @Torrentiord and @apweish

sorry for the confusion and THANKS for your help!

We are progressing quite well!

Yes my computer name is danielpaquin. However, the reason I am looking at auto_master, auto_smb solution is the NAS has to be mounted without me having to long onto a user account. My requirements is to turn-on the mac mini and have ready to use FileMaker Server and the NAS volumes (Data and Anonymous WebDav). This is what I mean by in the backend. i.e no need to log onto a specific users to have required resources ready to be used by other filmmaker pro clients.

WOO HOO!!!

/Nas/Data  -fstype=smbfs,soft,noowners,nosuid,rw ://nasusername:naspassword@10.0.1.60/Data
/Nas/Anonymous WebDav -fstype=smbfs,soft,noowners,nosuid,rw ://nasusername:naspassword@10.0.1.60/Anonymous WebDav

/Data is working, I get to see to the content of my NAS under /Data
/Anonymous WebDav is not working. The auto_smb has a blank between "Anonymous WebDav" and the volume found on my NAS is called "Anonymous WebDav" with a blank. However, the automount is showing updated. I tried to list the content of Anonymous and I am getting an error.

Mac-mini-de-danielpaquin:etc danielpaquin$ sudo automount -cv
automount: /net updated
automount: /home updated
automount: /NAS/Data updated
automount: /NAS/Anonymous updated
automount: no unmounts

Mac-mini-de-danielpaquin:etc danielpaquin$ ls -al /Nas
total 34
drwxrwxr-x 5 root wheel 170 14 May 19:27 .
drwxr-xr-x 43 root wheel 1530 14 May 19:05 ..
dr-xr-xr-x 2 danielpaquin staff 1 14 May 19:44 Anonymous
dr-xr-xr-x 2 root wheel 68 14 May 19:26 AnonymousWebDav
drwx------ 1 danielpaquin staff 16384 24 Jan 2000 Data

Mac-mini-de-danielpaquin:etc danielpaquin$ ls -al /Nas/Data
total 1495296
drwx------ 1 danielpaquin staff 16384 24 Jan 2000 .
drwxrwxr-x 5 root wheel 170 14 May 19:27 ..
-rwx------@ 1 danielpaquin staff 12292 14 May 18:06 .DS_Store
-rwx------@ 1 danielpaquin staff 968 24 Jan 2000 Data
drwx------@ 1 danielpaquin staff 16384 24 Jan 2000 ZVinformatique
-rwx------ 1 danielpaquin staff 613009581 6 Jun 2019 abcD.mov

Mac-mini-de-danielpaquin:etc danielpaquin$ ls -al /Nas/Anonymous
ls: Anonymous: Input/output error

Is there a way to get it to work with the blank?

MANY MANY THANKS!

@torrentlord

This comment has been minimized.

Copy link

torrentlord commented May 15, 2020

Hello @Torrentiord and @apweish

sorry for the confusion and THANKS for your help!

We are progressing quite well!

Yes my computer name is danielpaquin. However, the reason I am looking at auto_master, auto_smb solution is the NAS has to be mounted without me having to long onto a user account. My requirements is to turn-on the mac mini and have ready to use FileMaker Server and the NAS volumes (Data and Anonymous WebDav). This is what I mean by in the backend. i.e no need to log onto a specific users to have required resources ready to be used by other filmmaker pro clients.

WOO HOO!!!

/Nas/Data  -fstype=smbfs,soft,noowners,nosuid,rw ://nasusername:naspassword@10.0.1.60/Data
/Nas/Anonymous WebDav -fstype=smbfs,soft,noowners,nosuid,rw ://nasusername:naspassword@10.0.1.60/Anonymous WebDav

/Data is working, I get to see to the content of my NAS under /Data
/Anonymous WebDav is not working. The auto_smb has a blank between "Anonymous WebDav" and the volume found on my NAS is called "Anonymous WebDav" with a blank. However, the automount is showing updated. I tried to list the content of Anonymous and I am getting an error.

Mac-mini-de-danielpaquin:etc danielpaquin$ sudo automount -cv
automount: /net updated
automount: /home updated
automount: /NAS/Data updated
automount: /NAS/Anonymous updated
automount: no unmounts

Mac-mini-de-danielpaquin:etc danielpaquin$ ls -al /Nas
total 34
drwxrwxr-x 5 root wheel 170 14 May 19:27 .
drwxr-xr-x 43 root wheel 1530 14 May 19:05 ..
dr-xr-xr-x 2 danielpaquin staff 1 14 May 19:44 Anonymous
dr-xr-xr-x 2 root wheel 68 14 May 19:26 AnonymousWebDav
drwx------ 1 danielpaquin staff 16384 24 Jan 2000 Data

Mac-mini-de-danielpaquin:etc danielpaquin$ ls -al /Nas/Data
total 1495296
drwx------ 1 danielpaquin staff 16384 24 Jan 2000 .
drwxrwxr-x 5 root wheel 170 14 May 19:27 ..
-rwx------@ 1 danielpaquin staff 12292 14 May 18:06 .DS_Store
-rwx------@ 1 danielpaquin staff 968 24 Jan 2000 Data
drwx------@ 1 danielpaquin staff 16384 24 Jan 2000 ZVinformatique
-rwx------ 1 danielpaquin staff 613009581 6 Jun 2019 abcD.mov

Mac-mini-de-danielpaquin:etc danielpaquin$ ls -al /Nas/Anonymous
ls: Anonymous: Input/output error

Is there a way to get it to work with the blank?

MANY MANY THANKS!

Great news, glad its working with the space try this

/Nas/Anonymous_WebDav -fstype=smbfs,soft,noowners,nosuid,rw ://nasusername:naspassword@10.0.1.60/Anonymous_WebDav

otherwise just rename the drive, thats the easiest solution to Anonymouswebdav. It's not good practice to have spaces in the name. Sorry I can't more on this issue.

Again, not really sure what you mean "This is what I mean by in the backend. i.e no need to log onto a specific users to have required resources ready to be used by other filmmaker pro clients."

You can set all of your Synology shares to enable access for everyone with no password. Thats all I can think of. Maybe this would work:

/Nas/Data -fstype=smbfs,soft,noowners,nosuid,rw ://guest@10.0.1.60/Data or /Nas/Data -fstype=smbfs,soft,noowners,nosuid,rw ://guest@10.0.1.60/Data

You'll have to play around and see what will mount with a username if that's what you are trying to achieve,

Best of luck!
Casey

@DanielPaquin

This comment has been minimized.

Copy link

DanielPaquin commented May 15, 2020

Hello @Torrentiord and @apweish

Nas/Data -fstype=smbfs,soft,noowners,nosuid,rw ://guest@10.0.1.60/Data is working!

-bash: cd: Anonymous_WebDav: Host is down
Mac-mini-de-danielpaquin:Nas danielpaquin$

My next move will then be to remove the blank.

MANY MANY MANY THANKS!

@DanielPaquin

This comment has been minimized.

Copy link

DanielPaquin commented May 15, 2020

To terminate the test, I've restarted the mac mini, logged on under danielpaquin and went to Terminal.

As you can see when doing a ls -al under /Nas, I got Data: Permission Denied
Would you have an idea why?

The last time I ran auto_smb, I used /Nas/Data -fstype=smbfs,soft,noowners,nosuid,rw ://nasusername:naspassword@10.0.1.60/Data

Mac-mini-de-danielpaquin:NAS danielpaquin$ ls
Anonymous Anonymous_WebDav
AnonymousWebDav Data

Mac-mini-de-danielpaquin:NAS danielpaquin$ ls -al
ls: Data: Permission denied
total 2
drwxrwxr-x 6 root wheel 204 14 May 20:18 .
drwxr-xr-x 43 root wheel 1530 14 May 19:05 ..
dr-xr-xr-x 2 root wheel 68 14 May 19:27 Anonymous
dr-xr-xr-x 2 root wheel 68 14 May 19:26 AnonymousWebDav
dr-xr-xr-x 2 danielpaquin staff 1 14 May 20:42 Anonymous_WebDav

Even if I run a sudo automount -cv, I now get permission denied when attempting to go to Data. The result of the automount is:

automount: /net updated
automount: /home updated
automount: /NAS/Data updated
automount: /NAS/Anonymous_WebDav updated
automount: no unmounts

How can I remove Anonymous, AnonymousWebDav and Anonymous_WebDav from NAS?

Thanks again for your help!

@apwelsh

This comment has been minimized.

Copy link

apwelsh commented May 15, 2020

In autofs you need to replace " " (spaces) with %20 (this is the typical URL encoding scheme). This is true for all implementations of autofs.

/Nas/Anonymous WebDav -fstype=smbfs,soft,noowners,nosuid,rw ://nasusername:naspassword@10.0.1.60/Anonymous%20WebDav

What I have never been able to figure out, is how to define a mount point with a space in the directory name, so instead, I would replace the space like this:

/Nas/Anonymous_WebDav -fstype=smbfs,soft,noowners,nosuid,rw ://nasusername:naspassword@10.0.1.60/Anonymous%20WebDav

I have not found a way to put a space in the mount point, and I have even tried with wildcard mounts, and mount scripts. Maybe someone else knows.

@apwelsh

This comment has been minimized.

Copy link

apwelsh commented May 15, 2020

Even if I run a sudo automount -cv, I now get permission denied when attempting to go to Data. The result of the automount is:

automount: /net updated
automount: /home updated
automount: /NAS/Data updated
automount: /NAS/Anonymous_WebDav updated
automount: no unmounts
How can I remove Anonymous, AnonymousWebDav and Anonymous_WebDav from NAS?

To remove those folders, enter the command mount to search if they are mounted. some may be. If they are, use sudo umount /path/to/unmount. Then run sudo automount -v again. Now you can remove the those stagnant folders if they are still lingering around.

@torrentlord

This comment has been minimized.

Copy link

torrentlord commented May 15, 2020

To terminate the test, I've restarted the mac mini, logged on under danielpaquin and went to Terminal.

As you can see when doing a ls -al under /Nas, I got Data: Permission Denied
Would you have an idea why?

The last time I ran auto_smb, I used /Nas/Data -fstype=smbfs,soft,noowners,nosuid,rw ://nasusername:naspassword@10.0.1.60/Data

Mac-mini-de-danielpaquin:NAS danielpaquin$ ls
Anonymous Anonymous_WebDav
AnonymousWebDav Data

Mac-mini-de-danielpaquin:NAS danielpaquin$ ls -al
ls: Data: Permission denied
total 2
drwxrwxr-x 6 root wheel 204 14 May 20:18 .
drwxr-xr-x 43 root wheel 1530 14 May 19:05 ..
dr-xr-xr-x 2 root wheel 68 14 May 19:27 Anonymous
dr-xr-xr-x 2 root wheel 68 14 May 19:26 AnonymousWebDav
dr-xr-xr-x 2 danielpaquin staff 1 14 May 20:42 Anonymous_WebDav

Even if I run a sudo automount -cv, I now get permission denied when attempting to go to Data. The result of the automount is:

automount: /net updated
automount: /home updated
automount: /NAS/Data updated
automount: /NAS/Anonymous_WebDav updated
automount: no unmounts

How can I remove Anonymous, AnonymousWebDav and Anonymous_WebDav from NAS?

Thanks again for your help!

**Hi Daniel, you are likely getting this permission denied error as the share is expecting a password. In Synology you can try edit the user access or share folder with no password. The link for some info is below.

https://www.synology.com/en-global/knowledgebase/SRM/help/SRM/USBStorage/storage_privileges

You can try /Nas/Data -fstype=smbfs,soft,noowners,nosuid,rw ://guest:naspassword@10.0.1.60/Data`

"How can I remove Anonymous, AnonymousWebDav and Anonymous_WebDav from NAS?:

  • go into share folder on Synology and rename or remove or there may be a setting for Webdav to turn off.

**

@DanielPaquin

This comment has been minimized.

Copy link

DanielPaquin commented May 15, 2020

Thanks, I will look into the privileges tomorrow.

I am very pleased with the progress we've made today.

I'll keep you in touch!

With regards!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.