Ubuntu – How to make NFS mounts available while offline

11.10nfsrsyncsync

Problem:

I work on a notebook and while at work I have access to many NFS mounted drives. When I get home they are obviously not available.

Windows 7 solution:

My business partner uses Windows 7 and maps the folders via samba. Windows 7 has a very nice feature that let's he make these folders available offline. So when when he connects to the work network the changes get synchronized!

Question:

Is there a way to mimic that in ubuntu?

What I have now:

Server to local sync: I have added rsync entries on my crontab to copy server folders => local folders every five minutes.

When at work I used the NFS mapped folders and while outside work I use the local copies.

When I get at work I manually run a script that syncs local folders => server folders.

Problems with my setup:

  • slow startup when not at work (I guess do to the fstab trying to map the server folders)
  • no conflict checking/managing
  • I have to remember to sync manually and be careful because of the different file locations
  • recent files do not work between work and home

Best Answer

http://www.linuxpromagazine.com/Issues/2009/99/Offline-FS

Here's some information on various alternatives to do this. Primarily discussing OFS. I've not used it myself, but it seems more mature than my prior suggestions and specifically designed for the task rather than trying to speed up NFS access like CacheFS.

When I need to keep two things in sync, I usually use a Subversion repository as an intermediary between the two systems, but this can be labor intensive.

Related Question