Strange behavior for automounted directory.

I. am working on an app that uses automounted files using nfsv4 where the server has zfs filesystems. As a test I've created a very simple example and the directory in question seems to automount correctly, but when I try to access it, I get strange behavior. The directory is mounted on is /System/Volumes/Data/mnt/subdir and I can change to that directory just fine. However I get the following:

63 rrsum@Anywhere:subdata% pwd
/System/Volumes/Data/mnt/subdata

64 rrsum@Anywhere:subdata% ls -la
total 3
drwxr-xr-x  3 nobody  nobody   4 Jan 10 13:03 .
dr-xr-xr-x  3 root    wheel    2 Jan  8 17:27 ..
drwxr-xr-x  2 nobody  nobody   3 Jan  9 11:20 dir
-rw-r--r--  1 nobody  nobody  12 Jan 10 13:09 file.txt

65 rrsum@Anywhere:subdata% cd dir
cd: string not in pwd: ls

The directory appears in the 'ls -la' properly, but I cannot cd to it.

How are you creating this directory:

/System/Volumes/Data/mnt/

The issue here is that the contents that are visible at "/" are created by basically "merging" the contents of the ROSV ("Read Only System Volume") and the data volume of its volume group. Within that context, I think there are two ways to create something like a common "mnt" directory:

  1. Bypass these issues by placing the directory inside one of the existing standard directories. For example, create "/Library/mnt/".

  2. If you specifically want the directory to exist at "/", then use the "/etc/synthetic.conf" config file to create a new directory or symbolic link (see man synthetic.conf) for details.

...but what I would NOT do is simply create a new directory at the root of the "Data" volume and use it through /System/Volumes/ like this:

/System/Volumes/Data/mnt/

The BEST case here is that you only get weird UI issues, since "mnt" won't be visible at "/" but will be visible in the path above (which is not a "standard" path). The worst case is that:

I am working on an app that uses automounted files using nfsv4 where the server has ZFS filesystems. As a test I've created a very simple example and the directory in question seems to automount correctly, but when I try to access it, I get strange behavior.

...you get strange behavior as you're trying to manipulate files through a path hierarchy that the system is trying to hide.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Strange behavior for automounted directory.
 
 
Q