[ncolug] Unison for File Sync NTFS and Ext3 (with a little Samba for fun)

  • From: "M. Knisely" <charon79m@xxxxxxxxx>
  • To: ncolug@xxxxxxxxxxxxx
  • Date: Mon, 25 Jan 2010 10:05:42 -0500

So, I've run into this issue about a half dozen times, but it's always been
several months apart so I never really documented the solution.  It's oh so
much easier to Google for it... Unfortunately, the blog that I would always
find that had the solution had since died, and the looking back though the
WayBackMachine for a cached version is just a little to much work.  So...
Here goes creating a new post for Google to cache!

Here's the setup:

I have a TrueCrypt volume formatted as NTFS that I keep a bunch of Junk in
on each of my laptops/desktops/home server/etc.  I use Unison to keep this
volume synced between all my machines, so I always have the most recent
version of whatever file on each of my machines.  This setup works GREAT
when syncing inside the NTFS volume!

Here's the issue:

I need to sync one of the folders in this volume to a another system.  This
system is available to me via a samba share an the underlying volume is
ext3.  Whenever I try to have Unison sync, I get a permissions error because
it's unable to replicate the owner and permissions given the file system
differences.

Here's the fix:

When using Unison-GTK, a GUI interface to Unison, it creates a file in your
~/.unison/ directory.  That file looks a lot like this: (assuming your local
directory is /compA/folder and you've mounted your Samba share as
/Samba_Share/)

#####
root = /compA/folder
root = /Samba_Share/folder

Yeah, exciting... I know.  So, to this file, add the following:

owner=false
perms=0

This will ignore syncing the owner and permissions and allow them to
default.  Are there better ways to fix this that will make sure this vital
information is syncronized?  Sure, but I just don't care for my needs.  Yes,
it's a little self serving... perhaps this could be a topic for a future
NCOLUG meeting?!!?

Mike K.

Other related posts: