Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
So what do you really need? Do you just need to be able to open Word documents on the computers or do you need to do lots of syncing? Does file manager integration matter? – digitxp Aug 23 '10 at 22:52
I have a lot of media files that I work with (audio samples, music files, as well as a few video clips) that are on the remote server and I need to access, sometimes to open and read, sometimes just to get the file information. They are collectively far too large to copy to the laptop. Samba was working fine until I started to notice random read errors. For example, in Rhythmbox, the library would often fail to scan the files correctly, even if I had it set to not monitor the remote folder. – meowsqueak Aug 25 '10 at 0:41

I use NFS on my local network, and it's dead easy to mount a symlink.

Use exportfs on the source PC and /etc/fstab on the other. Down sides: Requires you to keep quite a range of ports open, unless you try locking to one port (which I failed at). The other challenge is where UID/GIDs for even the same usernames differ between machines. But that was pretty easy to fix by editing /etc/passwd and /etc/group, then a find piped to a chown.

share|improve this answer
I'd suggest looking at setting up NFS for automount as well. Mounts from automount will play less havoc with your setup if the volume you're mounting is unavailable. – Rich Homolka Dec 7 '10 at 20:41

This started as a comment, but got a bit out of hand...

Services like NFS & Samba are analogous to simple file sharing in Windows:

  1. easy to setup,
  2. tend to be resource hogs and because they are general purpose file system access protocols,
  3. they don't excel at the types of situations you describe: flaky / intermittent connections & moving tens of thousands of files.

For your monitoring & updating, I would use rsync, not nfs or smb...

You may still want to use samba or nfs for simple file sharing, browsing, etc. It gets easier & better with (nearly) every ubuntu release. Start by right-clicking the folder you want to share, and select Share Folder to get started. There is a gnome bug in 10.04 that doesn't offer to install needed packages, but it's being worked on.

share|improve this answer
The problem with rsync is that it copies the files locally - I don't have the space to do that, there's hundreds of gigabytes of files. Samba would actually work fine if it wasn't for the random read errors I mentioned earlier. – meowsqueak Aug 25 '10 at 0:44

For intermittent disconnected usage, coda could be a good choice (if the 2 GB file limit is no hindrance), even when the setup and infrastructure might seem a bit intimidating at first.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.