You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Input/output error" when accessing an NFS share via bindfs #164
I am working on a Ubuntu install which is a client of an NFS share, mounted at /mnt/nas. This is mounted via a /etc/fstab entry using the nfs type.
Due to the NFS server's MAPALL configuration, chown fails with "Invalid argument" whenever it is run against any file/folder within /mnt/nas. This is causing issues with Docker, where a large amount of available prebuilt containers are designed to run chown on startup and will terminate if this fails.
I am aiming to work around this by using a FUSE/bindfs mount to make the share available at /mnt/nasfix with the --chown-ignore option.
From what I can tell this use of bindfs isn't entirely novel: it seems like vagrant-bindfs is designed with something similar in mind. (But I'm not using Vagrant)
I'm having a lot of trouble finding anything online about this error. I looked at #78, but if my understanding is correct this is about running bindfs on the NFS server (and exposing the bindfs mount via an NFS share). I want to run bindfs on the NFS client.
When running bindfs with the debug option and then attempting to do a directory listing I get the following output:
Strange, since bindfs should be reading the source directory like any other process.
To debug this, you could try running bindfs with strace -f to see which syscall it is exactly that returns that -5.
Very strange. I don't have any great ideas then. You could try adding debug prints to various places in bindfs.c's functions bindfs_getattr, bindfs_fgetattr and getattr_common to see where it fails. Example:
if (lstat(real_path, stbuf) == -1) {
free(real_path);
DPRINTF("lstat failed: %s (%d)", strerror(errno), errno); <------ you could add this one
return -errno;
}
To enable the debug prints, you need to run ./configure --enable-debug-output before recompiling and reinstalling.
But I'm not specifying a GID offset in my command...
EDIT: Ah, if I explicitly set gid-offset to 0 I get the same behaviour. The issue is that my share reports file ownership as nobody, and so even applying an offset of 0 still results in nobody, which is apparently not valid.
I ended up changing some settings on my NAS so that it wouldn't report ownership as nobody and that fixed the issue. I don't have a good way to test this anymore sorry.
I did run into the same issue with my ganesha server running in NFS4, I think this is due to NFSv4 idmapping not being properly set and I ended up getting all files owned by 4294967294 which resulted in the EIO error with bindfs
Activity
mpartel commentedon May 13, 2025
Strange, since bindfs should be reading the source directory like any other process.
To debug this, you could try running bindfs with
strace -fto see which syscall it is exactly that returns that -5.YoshiWalsh commentedon May 15, 2025
Command:
strace -f /usr/local/bin/bindfs -f -s -d /mnt/nas /mnt/nasfixRelevant part of output (emitted when attempting to
ls /mnt/nasfix)I'm not familiar with strace (or programming in lower-level languages generally), but it looks to me like nothing is returning -5?
mpartel commentedon May 17, 2025
Very strange. I don't have any great ideas then. You could try adding debug prints to various places in
bindfs.c's functionsbindfs_getattr,bindfs_fgetattrandgetattr_commonto see where it fails. Example:To enable the debug prints, you need to run
./configure --enable-debug-outputbefore recompiling and reinstalling.YoshiWalsh commentedon May 20, 2025
After adding some debug prints and running with debug outfit:
But I'm not specifying a GID offset in my command...
EDIT: Ah, if I explicitly set gid-offset to 0 I get the same behaviour. The issue is that my share reports file ownership as
nobody, and so even applying an offset of 0 still results innobody, which is apparently not valid.mpartel commentedon Jun 8, 2025
Sorry for the very slow response. Does branch uid-size-fix fix it for you?
YoshiWalsh commentedon Jul 14, 2025
I ended up changing some settings on my NAS so that it wouldn't report ownership as
nobodyand that fixed the issue. I don't have a good way to test this anymore sorry.coolheavynest commentedon Oct 15, 2025
I did run into the same issue with my ganesha server running in NFS4, I think this is due to NFSv4 idmapping not being properly set and I ended up getting all files owned by 4294967294 which resulted in the EIO error with bindfs