Skip to contentSkip to conversation

git, hardlinks and backups

DISCUSSION Pavel Machek 3 participants 4 messages Jul 10, 2006 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hi!

I know this may be stupid, but...

I'm backing up my linux kernel trees, and found out that backup (done by rsync) is twice as big as original. That's quite bad... it is because git uses hardlinks heavily but rsync can't preserve them.

I'm pretty sure someone hit this before... what is the trick?
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#1 lore raw
Quoted 9 lines · Pavel Machek

Hi!

I know this may be stupid, but...

I'm backing up my linux kernel trees, and found out that backup (done by rsync) is twice as big as original. That's quite bad... it is because git uses hardlinks heavily but rsync can't preserve them.

I'm pretty sure someone hit this before... what is the trick?

$ rsync --help | grep "preserve hard links"
 -H, --hard-links            preserve hard links
$ 
Quoted 1 line

Pavel

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#3 lore raw
In reply to a message not in the archive

Hi!

Quoted 9 lines
Quoted 7 lines

I know this may be stupid, but...

I'm backing up my linux kernel trees, and found out that backup (done by rsync) is twice as big as original. That's quite bad... it is because git uses hardlinks heavily but rsync can't preserve them.

I'm pretty sure someone hit this before... what is the trick?

The -H option of rsync?

Okay, I was blind, sorry.

For those who made same mistake... utility called freedups should be able to clean that up.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#4 lore raw
In reply to Pavel Machek
Quoted 10 lines · Pavel Machek

Hi!

I know this may be stupid, but...

I'm backing up my linux kernel trees, and found out that backup (done by rsync) is twice as big as original. That's quite bad... it is because git uses hardlinks heavily but rsync can't preserve them.

I'm pretty sure someone hit this before... what is the trick?
Pavel

Why can't rsync preserve them? Doesn't 'rsync --hard-links' work? (however, it can only work if you rsync all paths at once so rsync gets to see that the inodes match)

Signature · 3 lines
Rutger Nijlunsing ---------------------------------- eludias ed dse.nl
never attribute to a conspiracy which can be explained by incompetence
----------------------------------------------------------------------