Re: [Hampshire] de-dupe

Top Page

Reply to this message
Author: Simon Huggins
Date:  
To: hampshire
Subject: Re: [Hampshire] de-dupe
On Wed, May 06, 2009 at 05:22:27PM +0100, Martin A. Brooks wrote:
> James Courtier-Dutton wrote:
> > Hi,
> >
> > Is there any file system that does de-dupe?
> > I.e. I want to have the same pic in 10 different directories, but if I
> > edit one, I don't want all the other 9 to be changed.
> That would be a "copy on write" filesystem. I'm not aware of any mature
> linux implementations.


You could fake it by using hard links and cp over the top again before
you start the edit.

[huggie@the ~/tmp]$ dd if=/dev/zero of=photo1/foobar.jpg bs=1024 count=5
5+0 records in
5+0 records out
5120 bytes (5.1 kB) copied, 6.6e-05 seconds, 77.6 MB/s
[huggie@the ~/tmp]$ cp -al photo1 photo2
[huggie@the ~/tmp]$ cp -al photo1 photo3
[huggie@the ~/tmp]$ ls -li photo?
photo1:
total 8
1196144 -rw-r----- 3 huggie huggie 5120 2009-05-06 17:30 foobar.jpg

photo2:
total 8
1196144 -rw-r----- 3 huggie huggie 5120 2009-05-06 17:30 foobar.jpg

photo3:
total 8
1196144 -rw-r----- 3 huggie huggie 5120 2009-05-06 17:30 foobar.jpg
[huggie@the ~/tmp]$ rm photo2/foobar.jpg; cp photo1/foobar.jpg photo2/foobar.jpg
[huggie@the ~/tmp]$ ls -li photo?
photo1:
total 8
1196144 -rw-r----- 2 huggie huggie 5120 2009-05-06 17:30 foobar.jpg

photo2:
total 8
1196147 -rw-r----- 1 huggie huggie 5120 2009-05-06 17:33 foobar.jpg

photo3:
total 8
1196144 -rw-r----- 2 huggie huggie 5120 2009-05-06 17:30 foobar.jpg


Maybe you can get it to do this automatically. Text editors can do this which
helps a lot with sourcecode trees.

Simon.

-- 
[ '<blitz> mais g la productivité d'une endive :)' #parinux            ]