I have two Linux hosts (both running Ubuntu 10.04) and I want one of them to have access to part of the filesystem of the other. I.e. I want remote1 to be able to access the files of remote2:/home/username
This is simply to allow me to access my home directory on the other machine, read-write, and there's no need for other users to be able to access this too.
The used IDs for 'username' are different on each host, for reasons I won't go into (Likewise, ADS, etc).
I tried Samba but I found it unreliable. For example, I have a program that monitors a directory and updates a list of around 12,000 files. I found that this list was constantly changing with files dropping out and some files being randomly unreadable. It was too unreliable.
I had something working quite well on remote1 with:
sshfs remote2:/home/username ~/remote2 -o idmap=user -o uid=$(id -u) -o gid=$(id -g)
This works perfectly for a while. Unfortunately remote1 is a laptop and is regularly disconnected from the LAN. This seems to completely break things when this sshfs filesystem is mounted, and typically requires a reboot to recover.
I started to look into NFS but I ran into problems with this a few years ago with regards to user id mappings. At the time, I found there was a user-space NFS server that dealt with this but it had a bunch of its own problems. But that was NFSv3. Can NFSv4 'kernel server' handle different user ids and map between them properly? I really don't want to use NIS, and I can't actually change the user IDs anyway - they are set by external means.
Also, how does NFS handle an 'unreliable' network connection? Will it automatically reconnect or will the share be broken until it is remounted?
What about something like CIFS? Can this cope with the network being regularly and unpredictably broken? This might have the same problems that Samba did, but it's worth a try if it will be suitable.
Are there any other options I should consider?