Closed wyuenho closed 7 years ago
Since d4m-nfs and be setup in an unlimited number of ways, it is important for you to fully review https://github.com/IFSight/d4m-nfs/blob/master/README.md
If you are still having problems after that, since it is so complicated to provide help with limited information please provide all the information requested in the README. Without the requested information we will not consider further responses.
I've attached the missing info. Thank you for helping.
@wyuenho when d4m-nfs does not find exactly /Users/<USERNAME>
, it tries to export it as /mnt
so you are effectively trying to export things under /Users/jwong
3 times. I would suggest to simply export the top level /Users/jwong
once and then use the subdirectories of it appropriately.
Both of the exports begin with my home dir, so the condition *"\"/Users/$USER"*
will not be true, thats why you don't see "/Users/jwong" -alldirs -mapall=501:20 localhost
in /etc/exports
.
/mnt
is created when AUTO_MOUNT_HOME
is true
and /mnt
doesn't exist in /tmp/d4m-nfs-mounts.txt
according to here.
That mkdir -p /mnt
won't give you any errors when it already exists.
As you can see from the screen logs, both of my overlapping dirs are exported successfully, just $HOME
isn't. The reason is because a non-empty /mnt
already exists in MobyVM, so mounting it to somewhere else will solve this problem.
@wyuenho the files that you have give suggest that you have not turned off AUTO_MOUNT_HOME
:
if true && ! $(grep ':/mnt' /tmp/d4m-nfs-mounts.txt > /dev/null 2>&1); then
The true
in /tmp/d4m-mount-nfs.sh that you provided is reflective of that. It is not enough to simply have a ephemeral AUTO_MOUNT_HOME, you need to have it exported.
export AUTO_MOUNT_HOME=false; ./d4m-nfs.sh
We did not add the AUTO_MOUNT_HOME, it was from a PR, so it was not something we documented.
Of course it's not turned off, how else do I recreate that permission error by turning it off? :P
On 10 Mar 2017, at 3:40 am, Kenn Herman notifications@github.com wrote:
@wyuenho the files that you have give suggest that you have not turned off AUTO_MOUNT_HOME:
if true && ! $(grep ':/mnt' /tmp/d4m-nfs-mounts.txt > /dev/null 2>&1); then The true in /tmp/d4m-mount-nfs.sh that you provided is reflective of that. It is not enough to simply have a ephemeral AUTO_MOUNT_HOME, you need to have it exported.
export AUTO_MOUNT_HOME=false; ./d4m-nfs.sh
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Sorry @wyuenho but I am at a loss of what you are asking for then.
Mount $HOME to somewhere else other than /mnt On Fri, 10 Mar 2017 at 2:43 pm, Kenn Herman notifications@github.com wrote:
Sorry @wyuenho https://github.com/wyuenho but I am at a loss of what you are asking for then.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/IFSight/d4m-nfs/issues/37#issuecomment-285686126, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJxHFQcixdi5zbUPMuh_tpShmaL3PB6ks5rkWGtgaJpZM4MWMcP .
I was trying to do the same thing, but it appears that you don't want to take my suggestion to make AUTO_MOUNT_HOME false and instead give conflicting information.
I don't know if you have realized this yet, but you are arguing with the person who wrote this, and who knows the, at least intended, business logic.
It doesn't seem like you understand how d4m-nfs works, /mnt is not on your Mac, it is in the MobyVM. If you don't want your HOME directory mounted how it already does it by default, then turn it off.
You having /Users/jwong
entries in etc/d4m-nfs-mounts.txt and then refusing to turn off AUTO_MOUNT_HOME from what I can tell appears to be causing this. If you don't try what I suggested, then I will not try to help any further.
Allow me to quote myself from the issue description:
I have to turn off AUTO_MOUNT_HOME to get rid of that permission error. I'm not sure if a better solution is to have $HOME mounted on somewhere else other than /mnt.
I have gotten it to work by setting AUTO_MOUNT_HOME to false, just because I didn't show you, it doesn't mean I haven't done it.
/mnt is not on your Mac, it is in the MobyVM.
That's what I've been saying from the moment I filed this issue. /mnt is non-empty directory pre-created with root root on the latest MobyVM. You can't mount to it without changing the perm. Since it comes with MobyVM now, to prevent clobbering, you probably should mount $HOME to somewhere else other than /mnt.
Does it make sense now?
@wyuenho, yes it appears that the Docker changed the MobyVM again and has new directories /mnt and /mnt/db. However, you are conflating multiple issues that others are not experiencing since they are not using this the way you are.
In *NIX when you mount something over an existing directory if anything under that directory existed it is masked. For instance it still works just fine for on my system with the exact same build of Docker for Mac that you have, the location is not the issue, the fact you are trying to reexport something is.
What I think you are not mentioning is the initial NFS export error message that you got:
exports:4: /Users/jwong/Documents/workspace/cloudflare/repos conflicts with existing export /Users/jwong
exports:5: /Users/jwong/dev-stack-data conflicts with existing export /Users/jwong
So I think you attempted to fix that by turning off AUTO_MOUNT_HOME when actually what you are doing is simply not having a parent directory that conflicts with a child directory, that one of the reasons I suggested:
I would suggest to simply export the top level /Users/jwong once and then use the subdirectories of it appropriately.
Both your suggestion and the PR break backwards compatibility for everyone else besides you, who are not experiencing what you are, for that reason I cannot except it.
If you still insist on exporting multiple directories under you home directory, I think a better approach would be to be able to give an alternative auto home mount location variable, say AUTO_HOME_PATH, in your case you would be free to give it /host-home
. If you want to do this please make a new PR.
Closing this as we aren't using this solution anymore.
On the latest Docker for Mac CE, MobyVM by default has /mnt created with a db/ subdirectory in it. When d4m-nfs.sh tries to mount $HOME from the host to the VM, a permission error results.
I have to turn off
AUTO_MOUNT_HOME
to get rid of that permission error. I'm not sure if a better solution is to have $HOME mounted on somewhere else other than /mnt.