hardlinks not working with inode number > 2^31

Paul Slootman paul+rsync at wurtel.net
Sat Feb 2 12:34:11 GMT 2008

I've been using 3.0.0pre8 to move a Debian archive from one filesystem
to another. This archive contains a daily snapshot of the Debian ftp
site, with common files hardlinked to save space.

I noticed that it was using far more space than necessary. Upon
investigation it seems that all the source files that have inode numbers
greater than 2^31 aren't being hardlinked together at the destination.

XFS uses a sparse inode number distribution. Here is an ls -i of a
random directory:

3239109826 libtomcat4-java_4.0.3-3woody3_all.deb
  18105717 libtomcat4-java_4.1.31-3_all.deb
1092085178 libtomcat4-java_4.1.31-4_all.deb
  18105718 tomcat4-admin_4.1.31-3_all.deb
1092085181 tomcat4-admin_4.1.31-4_all.deb
3239109829 tomcat4-webapps_4.0.3-3woody3_all.deb
  18105719 tomcat4-webapps_4.1.31-3_all.deb
1092085183 tomcat4-webapps_4.1.31-4_all.deb
3239109831 tomcat4_4.0.3-3woody3.diff.gz
3239109832 tomcat4_4.0.3-3woody3.dsc
3239109833 tomcat4_4.0.3-3woody3_all.deb
3239109834 tomcat4_4.0.3.orig.tar.gz
  18105720 tomcat4_4.1.31-3.diff.gz
  18105721 tomcat4_4.1.31-3.dsc
  18105722 tomcat4_4.1.31-3_all.deb
1092085188 tomcat4_4.1.31-4.diff.gz
1092085190 tomcat4_4.1.31-4.dsc
1092085191 tomcat4_4.1.31-4_all.deb
1091849984 tomcat4_4.1.31.orig.tar.gz

The files with 3239109xxx inodes aren't getting hardlinked.
Note that this is still less than 2^32, so should fit in an unsigned 32 bit int.
Note also that on large (>1TB) XFS filesystems on 64bit systems, a mount
option "inode64" is recommended, as otherwise inodes are only allocated
from the 1st 1TB space. This will reduce performance (the inodes are
then not always located near the data), and can also lead to not being
able to create new files if the 1st 1TB is full.

If rsync cannot currently cope with larger than 31bit inodes, than this
would need to be dealt with IMHO. It's not like larger than 1TB
filesystems are a rare thing nowadays, with single 3,5inch SATA disks
already available at 1TB sizes for very reasonable prices.

Paul Slootman

More information about the rsync mailing list