I am trying to use mount as in man mount, on MacOS. Ultimately, what I am trying to do is mount a directory which is outside of the Docker build context and put the directory inside the Docker build context. Apparently symlinks do not work, and so I am trying to do this with the mount command. (If you know of a better way, pls lmk).

So I have this:

mkdir -p "$(pwd)/some_local_dir"
mount -t auto "${project_root}" "$(pwd)/some_local_dir"

which is attempting to mount the project into a local directory

I get this error:

mount: exec /Library/Filesystems/auto.fs/Contents/Resources/mount_auto for /Users/alexamil/test/some_local_dir: No such file or directory

I tried deleting the directory, and not calling mkdir -p, and same problem. Super weird.

Anyone know what might be wrong with my mount command?

  • 1
    Only the root user can mount a filesystem with the mount command in macOS, so preface it with sudo, e.g. sudo mount .... Also, read the manual page: "The argument following the −t is used to indicate the file system type. There is no default local file system for use with mount. A type must be specified in order to mount a non-NFS filesystem." So I take that to be you actually have to specify the filesystem type, not use auto. Jul 14, 2017 at 23:32
  • thanks, apparently (according to docs somewhere) "auto" is a filesystem type, where mount will try to automatically determine your fs type. Jul 14, 2017 at 23:45
  • 2
    Let me rephrase that, since using -t auto with the mount command under macOS is throwing an error, use the actual formatted filesystem type of the device being mounted, instead. Jul 15, 2017 at 0:04
  • yeah I will try that, still seems like a bad error that's thrown from the command line parser. Jul 15, 2017 at 0:07


You must log in to answer this question.

Browse other questions tagged .