Hard links not always created

Asked by Jani

I use backintime with two profiles to backup my files.
One profile for multimedia (videos & images) and one for all others.
Usually I run the "all others" for backup.

Today I run the multimedia backup, second time in 3 weeks. I noticed lot of file space usage, which lead me to believe hard linking not done correctly. I compared the two backups with fslint and it found out many duplicates.
As an example, one avi.
ls -i reports different inodes:
9192988 20110118-084959/backup/home/jani/Personal/My Pictures/2009-09-Italia/mvi_4745.avi
13850463 20110208-174303/backup/home/jani/Personal/My Pictures/2009-09-Italia/mvi_4745.avi

md5sum says files identical:
df6c908b9f3353dac7209d97bec5d408 20110118-084959/backup/home/jani/Personal/My Pictures/2009-09-Italia/mvi_4745.avi
df6c908b9f3353dac7209d97bec5d408 20110208-174303/backup/home/jani/Personal/My Pictures/2009-09-Italia/mvi_4745.avi

ls -l shows:
-r--r--r-- 38 jani jani 209913970 Sep 11 2009 20110118-084959/backup/home/jani/Personal/My Pictures/2009-09-Italia/mvi_4745.avi
-r--r--r-- 1 jani jani 209913970 Sep 11 2009 20110208-174303/backup/home/jani/Personal/My Pictures/2009-09-Italia/mvi_4745.avi

What could be the reason for this strange behaviour, why no hard linking with the two files?

Question information

Language:
English Edit question
Status:
Answered
For:
Back In Time Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Dan (danleweb) said :
#1

What is the file systems from snapshots folder ?

Revision history for this message
Jani (z8kprn777v) said :
#2

The file system for snapshots is etx3. The filesystem being backed up is ext4.
As you could see from previous comments, apparently hardlinking had been working. there was 38 hard links existing and then there was new (identical) version of file created.

Later I've learned about "stat" command, giving bit more additional information. Did a backup today, right after updating to backintime 1.0.6.
In this case, the file on my PC has been moved to another folder, but apart from that they should be the same. Am I safe to assume that the expected behaviour would be a hardlink instead of new file?

Output from stat:
Old file:
  File: `20110210-210041/backup/home/jani/Personal/My Pictures/102EOS5D/IMG_9280.JPG'
  Size: 9914360 Blocks: 19400 IO Block: 4096 regular file
Device: fd03h/64771d Inode: 19047805 Links: 14
Access: (0444/-r--r--r--) Uid: ( 500/ jani) Gid: ( 500/ jani)
Access: 2011-02-14 12:51:16.000000000 +0200
Modify: 2010-09-11 12:55:22.000000000 +0300
Change: 2011-02-14 12:31:04.000000000 +0200

New file:
  File: `20110214-122821-589/backup/home/jani/Personal/My Pictures/2010-09-Italia/09/11/IMG_9280.JPG'
  Size: 9914360 Blocks: 19400 IO Block: 4096 regular file
Device: fd03h/64771d Inode: 18702376 Links: 1
Access: (0444/-r--r--r--) Uid: ( 500/ jani) Gid: ( 500/ jani)
Access: 2011-02-14 12:51:13.000000000 +0200
Modify: 2010-09-11 12:55:22.000000000 +0300
Change: 2011-02-14 12:31:04.000000000 +0200

md5sum for each file is the same and they are picked as duplicates by fslint.

Revision history for this message
Dan (danleweb) said :
#3

So this is the problem :)
BIT use hard-links if the file is not changed, and but the file I mean a full path. rsync compare paths not inodes.
If you move a file from BIT point of view there are 2 changes:
1. One file is removed (old file)
2. There is a new file (new path)

Regards,
Dan

Revision history for this message
ceg (ceg) said :
#4

I recommend switching to storebackup for creating the snapshots.

Revision history for this message
ceg (ceg) said :
#5

storebackup:

  * restores easily - even without storeBackup! The most important aspect of a backup tool is easy restoring
  * copies / compresses files to another disk and generates backups with time stamps
  * transparent (native) storage format
  * recognizes when files have been copied, moved or renamed and does not waste time or space to duplicate the backup of such files
  * splits big image files (from eg. TrueCrypt, mbox, Xen, KVM, VMware, etc.) or complete devices into small pieces and saves only differences to existing backups, thereby saving space and time
  * new, copied, renamed or moved or touched only files with identical contents are hardlinked (so each backup set is totally complete, independent and autonomous)
  * sophisticated including and excluding possibilities for files and directories
  * fast backups even over slow or high latency network connections

Can you help with this problem?

Provide an answer of your own, or ask Jani for more information if necessary.

To post a message you must log in.