--link-dest isn't linking

darxus at chaosreigns.com darxus at chaosreigns.com
Mon Apr 23 08:31:25 MDT 2012


On 04/23, Paul Slootman wrote:
> On Sun 22 Apr 2012, darxus at chaosreigns.com wrote:
> 
> > rsync -Ha --link-dest=/media/4tb/bak/panic-2012-01-01 /media/2tb/bak/panic-2012-02-01 /media/4tb/bak/
> > 
> > root at dancer:/media/4tb/bak# ls -l panic*/home/darxus/0000_latest.jpg
> > -rw------- 15 darxus darxus 100772 1999-09-14 21:19 panic-2011-12-20/home/darxus/0000_latest.jpg
> > -rw------- 15 darxus darxus 100772 1999-09-14 21:19 panic-2012-01-01/home/darxus/0000_latest.jpg
> > -rw-------  1 darxus darxus 100772 1999-09-14 21:19 panic-2012-02-01/home/darxus/0000_latest.jpg
> > 
> > Why isn't it hard linking?  This is driving me nuts.
> > 
> > When I do --itemize-changes, for that file, it says:
> > >f+++++++++ panic-2012-02-01/home/darxus/0000_latest.jpg
> 
> There is no file "panic-2012-02-01/home/darxus/0000_latest.jpg" in the
> --link-dest directory. There _is_ a home/darxus/0000_latest.jpg file,
> but that's not what's being looked for.

That would make sense IF 0000_latest.jpg got written as
/media/4tb/bak/home/darxus/0000_latest.jpg (omitting "panic-2012-02-01").
But it didn't, it was written as I expected to
/media/2tb/bak/panic-2012-02-01/home/darxus/0000_latest.jpg

Surely this is a bug?

Created intentionally to test my sanity.

> Try modifying your command to:
> 
>     rsync -Ha --link-dest=/media/4tb/bak/panic-2012-01-01/ /media/2tb/bak/panic-2012-02-01/ /media/4tb/bak/panic-2012-02-01/
> 
> (Whenever in doubt, use trailing slashes :-)

That did it.  Thank you very much.

Bug, right?


On 04/23, Henri Shustak wrote:
> > rsync -Ha --link-dest=/media/4tb/bak/panic-2012-01-01 /media/2tb/bak/panic-2012-02-01 /media/4tb/bak/
> 
> It seems that you may be attempting to hard-link between two file systems. One is mounted as "/media/4tb" the other is mounted as "media/2tb". 

No, the source is the 2tb filesystem, the destination and link-dest are
both on the 4tb filesystem.  And when you try to link files on two
different filesystems it gives you a nice clear error.

> My understanding is that it is not normally possible to hard-link between file systems. 

It's not abnormally possible either.


On 04/23, Voelker, Bernhard wrote:
> Interestingly, the first 2 files have  link count of 15.
> Where are the other hardlinks of that file? You can search
> for the inode number e.g. with 
>   find /media/4tb/bak -inum <inum> -ls

Sorry, they're in the same place, in directories with different dates.  I
just trimmed the ls output.

-- 
"Every man, woman and child on the face of this earth is at the mercy
of chaos." - a maxwell smart movie
http://www.ChaosReigns.com


More information about the rsync mailing list