-
Notifications
You must be signed in to change notification settings - Fork 324
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
Mounting NFS Share using pathfs.LoopbackFileSystem #49
Comments
what happens if you do: ls 192.168.1.7:/home ? |
$ ls 192.168.1.102:/home |
I've exported NFS directories from Server following article below: I can mount in a standard way; like on client machine I can mount it like this: bfs := pathfs.NewLoopbackFileSystem("/mnt/nfs/home") But I can't mount remote NFS directory directly; I'm trying to do it like: So what can be I missing above; or is it possible to mount it directly using go-fuse; or I first have to mount in explicitly and then loopback over already mounted directory though this doesn't makes sense to me; please guide...
|
you have to mount explicitly first, or write your own NFS client in Go (which is a lot of work). |
alright, Thanks for your help! |
Hi Dear,
I can mount local folder using "FileSystem: pathfs.NewLoopbackFileSystem("/mnt/local")" and can do listing and all other operations; but I can't mount an NFS Share (/home directory) using: "FileSystem: pathfs.NewLoopbackFileSystem("192.168.1.7:/home")".
What could I be missing here? Remember, I can mount NFS Share using normal NFS Client.
code snippet:
//nfsRoot := "192.168.1.7:/home"
nfsRoot := "/tmp/nvd"
mountPoint := "/mnt/storage/1"
os.MkdirAll(mountPoint, 0777)
cffs := fs.NewCFFileSystem(nfsRoot)
vfs := pathfs.NewPathNodeFs(cffs, nil)
vfs.SetDebug(false)
conn := nodefs.NewFileSystemConnector(vfs.Root(), nil)
mOpts := fuse.MountOptions{
AllowOther: true,
RememberInodes: true,
}
server, err := fuse.NewServer(conn.RawFS(), mountPoint, &mOpts)
if err != nil {
log.Fatalf("Mount fail: %v\n", err)
}
log.Println("start server")
server.Serve()
Looking forward to your response...
The text was updated successfully, but these errors were encountered: