Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can edit an existing file, but can not create one #7

Closed
sunsongxp opened this issue Jan 27, 2018 · 5 comments
Closed

I can edit an existing file, but can not create one #7

sunsongxp opened this issue Jan 27, 2018 · 5 comments
Assignees

Comments

@sunsongxp
Copy link

sunsongxp commented Jan 27, 2018

How to replicate: just did what you described in README.

Server side: the host is a Mac. I use docker for Mac to spawn a container. The docker logs message looks the same as you mentioned in README.

Client side, a linux server that can connect to the container through host ip. I can rename the file / edit the file / mkdir without problem, but I cannot create file. The mounted directory should have all the permissions enabled (777)

The error is like this:

touch: cannot touch 'cccc': Input/output error

@sjiveson sjiveson self-assigned this Jan 28, 2018
@sjiveson
Copy link
Owner

Hey. I don't have a Mac to test this with I'm afraid. I've done some additional testing with physically and virtually separate hosts and not hit this issue I'm afraid. What are the permissions on the 'source' directory you have used?

@sunsongxp
Copy link
Author

The command I use:

docker run -d -p 2049:2049 --name nfs --privileged -v /Users/username/nfs/mnt:/mnt -e SHARED_DIRECTORY=/mnt itsthenetwork/nfs-server-alpine:latest

ls -alh /Users/username/nfs/mnt

shows

drwxrwxrwx 2 username staff 64B Jan 28 00:15 .

docker logs nfs shows

Starting Confd population of files...
confd 0.14.0 (Git SHA: 9fab9634, Go Version: go1.9.1)
2018-01-29T04:02:56Z 7f08e54ed36e /usr/bin/confd[12]: INFO Backend set to env
2018-01-29T04:02:56Z 7f08e54ed36e /usr/bin/confd[12]: INFO Starting confd
2018-01-29T04:02:56Z 7f08e54ed36e /usr/bin/confd[12]: INFO Backend source(s) set to
2018-01-29T04:02:56Z 7f08e54ed36e /usr/bin/confd[12]: INFO /etc/exports has md5sum 4f1bb7b2412ce5952ecb5ec22d8ed99d should be 1cf6dca1548c07c8e019868dc202be50
2018-01-29T04:02:56Z 7f08e54ed36e /usr/bin/confd[12]: INFO Target config /etc/exports out of sync
2018-01-29T04:02:56Z 7f08e54ed36e /usr/bin/confd[12]: INFO Target config /etc/exports has been updated

Displaying /etc/exports contents...
/mnt *(rw,fsid=0,async,no_subtree_check,no_auth_nlm,insecure,no_root_squash)

Starting NFS in the background...
rpc.nfsd: knfsd is currently down
rpc.nfsd: Writing version string to kernel: -2 -3 +4
rpc.nfsd: Created AF_INET TCP socket.

There are weird behavior happened, because previously I am sure that it was up & running. But it is not now. It may related to ipv6 issue, not sure.

@sjiveson
Copy link
Owner

This may be something to do with MacOS being BSD based? Certainly some of the NFS options specified in the exports file seem to be different. How things might get 'translated' is hard to know.

The no_root_squash option is entirely different and changes to -mapall=. Would you be able to try building the container from scratch after changing this in the nfs-server-alpine/confd/tmpl/exports.tmpl file?

Another suggestion might be to try assigning the source directory (mac) and mount location (linux) ownership by a user with the same UID.

A real shame I have no way of trying any of this out.

@sunsongxp
Copy link
Author

That's fine. Still thanks for the advices. I am closing it now.

@sjiveson
Copy link
Owner

sjiveson commented Feb 4, 2018

OK. Did you get anywhere? Others might find the information useful if you did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants