rdiff-backup-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[rdiff-backup-users] saving disk space with hardlink


From: Alexander 'Leo' Bergolth
Subject: [rdiff-backup-users] saving disk space with hardlink
Date: Sat, 08 Mar 2008 18:52:37 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.9) Gecko/20071115 Fedora/2.0.0.9-1.fc7 Thunderbird/2.0.0.9 Mnenhy/0.7.5.0

Hi!

As I'm currently backing up many similar machines to one large
backup-volume, I could save a _lot_ of space if I could hardlink
identical files in the different backup directories together.
However, since file-attributes like mtime, ownership and permissions are stored in the inode and not in the directory entry, this information will potentially change in the backup-repository after files have been hardlinked.

I've done some tests that verify the behavior of rdiff-backup when processing changed files that have been hardlinked in the backup-repo or when restoring files that are hardlinked in the repo.
(The tests are attached.)

So far rdiff-backup seems to handle this situation very well, it seems to fulfill all the requirements:

- File-attributes (permissions, ownership and file-timestamps) are taken from the metadata-file at the backup-side both at backup-time (when verifying if a file changed) and to restore-time.

- Files that changed in the source are created as new files and are not modified inline on the backup-side.

However, I don't know if there will be any other potential problems that I've missed in my test cases, so I'd be glad if some rdiff-backup developer could comment on this issue.

Thanks in advance,
--leo

P.S.: I'll use hardlinkpy, since it has an option to exclude directories. (rdiff-backup-data should probably be excluded...)
http://code.google.com/p/hardlinkpy/source/browse/trunk/hardlink.py

--
e-mail   ::: Leo.Bergolth (at) wu-wien.ac.at
fax      ::: +43-1-31336-906050
location ::: Computer Center | Vienna University of Economics | Austria


# echo test > src-a/f1
# chmod 600 src-a/f1
# chown nobody src-a/f1
# echo test > src-b/f1
# ls -l --full-time src*/f1
-rw------- 1 nobody users 5 2008-03-06 16:35:09.657568812 +0100 src-a/f1
-rw-r--r-- 1 leo    users 5 2008-03-06 16:36:36.983569588 +0100 src-b/f1

# rdiff-backup -v5 src-a backup/a
Using rdiff-backup version 1.1.15
escape_dos_devices not required by filesystem at src-a
-----------------------------------------------------------------
Detected abilities for source (read only) file system:
  Access control lists                         On
  Extended attributes                          On
  Case sensitivity                             On
  Escape DOS devices                           Off
  Mac OS X style resource forks                Off
  Mac OS X Finder information                  Off
-----------------------------------------------------------------
escape_dos_devices not required by filesystem at 
backup/a/rdiff-backup-data/rdiff-backup.tmp.0
-----------------------------------------------------------------
Detected abilities for destination (read/write) file system:
  Ownership changing                           On
  Hard linking                                 On
  fsync() directories                          On
  Directory inc permissions                    On
  High-bit permissions                         On
  Symlink permissions                          Off
  Extended filenames                           On
  Windows reserved filenames                   Off
  Access control lists                         On
  Extended attributes                          On
  Case sensitivity                             On
  Escape DOS devices                           Off
  Mac OS X style resource forks                Off
  Mac OS X Finder information                  Off
-----------------------------------------------------------------
Backup: must_escape_dos_devices = 0
Starting mirror src-a to backup/a
Processing changed file .
Processing changed file f1

# rdiff-backup -v5 src-b backup/b
Using rdiff-backup version 1.1.15
escape_dos_devices not required by filesystem at src-b
-----------------------------------------------------------------
Detected abilities for source (read only) file system:
  Access control lists                         On
  Extended attributes                          On
  Case sensitivity                             On
  Escape DOS devices                           Off
  Mac OS X style resource forks                Off
  Mac OS X Finder information                  Off
-----------------------------------------------------------------
escape_dos_devices not required by filesystem at 
backup/b/rdiff-backup-data/rdiff-backup.tmp.0
-----------------------------------------------------------------
Detected abilities for destination (read/write) file system:
  Ownership changing                           On
  Hard linking                                 On
  fsync() directories                          On
  Directory inc permissions                    On
  High-bit permissions                         On
  Symlink permissions                          Off
  Extended filenames                           On
  Windows reserved filenames                   Off
  Access control lists                         On
  Extended attributes                          On
  Case sensitivity                             On
  Escape DOS devices                           Off
  Mac OS X style resource forks                Off
  Mac OS X Finder information                  Off
-----------------------------------------------------------------
Backup: must_escape_dos_devices = 0
Starting mirror src-b to backup/b
Processing changed file .
Processing changed file f1


# ls -l --full-time backup/*/f1
-rw------- 1 nobody users 5 2008-03-06 16:35:09.000000000 +0100 backup/a/f1
-rw-r--r-- 1 leo    users 5 2008-03-06 16:36:36.000000000 +0100 backup/b/f1

# hardlink -cv backup/


Directories 7
Objects 27
IFREG 20
Mmaps 1
Comparisons 1
Linked 1
saved 4096

# ls -l --full-time backup/*/f1
-rw-r--r-- 2 leo users 5 2008-03-06 16:36:36.000000000 +0100 backup/a/f1
-rw-r--r-- 2 leo users 5 2008-03-06 16:36:36.000000000 +0100 backup/b/f1

# rdiff-backup -v5 src-a backup/a
Using rdiff-backup version 1.1.15
escape_dos_devices not required by filesystem at src-a
-----------------------------------------------------------------
Detected abilities for source (read only) file system:
  Access control lists                         On
  Extended attributes                          On
  Case sensitivity                             On
  Escape DOS devices                           Off
  Mac OS X style resource forks                Off
  Mac OS X Finder information                  Off
-----------------------------------------------------------------
escape_dos_devices not required by filesystem at 
backup/a/rdiff-backup-data/rdiff-backup.tmp.0
-----------------------------------------------------------------
Detected abilities for destination (read/write) file system:
  Ownership changing                           On
  Hard linking                                 On
  fsync() directories                          On
  Directory inc permissions                    On
  High-bit permissions                         On
  Symlink permissions                          Off
  Extended filenames                           On
  Windows reserved filenames                   Off
  Access control lists                         On
  Extended attributes                          On
  Case sensitivity                             On
  Escape DOS devices                           Off
  Mac OS X style resource forks                Off
  Mac OS X Finder information                  Off
-----------------------------------------------------------------
Backup: must_escape_dos_devices = 0
Starting increment operation src-a to backup/a

# rdiff-backup -v5 -r now backup/a/ restore/a/
Using rdiff-backup version 1.1.15
escape_dos_devices not required by filesystem at 
/home/leo/tmp/rdiff-backup/backup/a/rdiff-backup-daa
-----------------------------------------------------------------
Detected abilities for rdiff-backup repository (read only) file system:
  Access control lists                         On
  Extended attributes                          On
  Case sensitivity                             On
  Escape DOS devices                           Off
  Mac OS X style resource forks                Off
  Mac OS X Finder information                  Off
-----------------------------------------------------------------
escape_dos_devices not required by filesystem at restore/a/rdiff-backup.tmp.0
-----------------------------------------------------------------
Detected abilities for restore target (read/write) file system:
  Ownership changing                           On
  Hard linking                                 On
  fsync() directories                          On
  Directory inc permissions                    On
  High-bit permissions                         On
  Symlink permissions                          Off
  Extended filenames                           On
  Windows reserved filenames                   Off
  Access control lists                         On
  Extended attributes                          On
  Case sensitivity                             On
  Escape DOS devices                           Off
  Mac OS X style resource forks                Off
  Mac OS X Finder information                  Off
-----------------------------------------------------------------
Restore: must_escape_dos_devices = 0
Starting restore of backup/a to restore/a as it was as of Thu Mar  6 16:44:01 
2008.
Processing changed file .
Processing changed file f1
Restore finished

# rdiff-backup -v5 -r now backup/b/ restore/b/
Using rdiff-backup version 1.1.15
escape_dos_devices not required by filesystem at 
/home/leo/tmp/rdiff-backup/backup/b/rdiff-backup-daa
-----------------------------------------------------------------
Detected abilities for rdiff-backup repository (read only) file system:
  Access control lists                         On
  Extended attributes                          On
  Case sensitivity                             On
  Escape DOS devices                           Off
  Mac OS X style resource forks                Off
  Mac OS X Finder information                  Off
-----------------------------------------------------------------
escape_dos_devices not required by filesystem at restore/b/rdiff-backup.tmp.0
-----------------------------------------------------------------
Detected abilities for restore target (read/write) file system:
  Ownership changing                           On
  Hard linking                                 On
  fsync() directories                          On
  Directory inc permissions                    On
  High-bit permissions                         On
  Symlink permissions                          Off
  Extended filenames                           On
  Windows reserved filenames                   Off
  Access control lists                         On
  Extended attributes                          On
  Case sensitivity                             On
  Escape DOS devices                           Off
  Mac OS X style resource forks                Off
  Mac OS X Finder information                  Off
-----------------------------------------------------------------
Restore: must_escape_dos_devices = 0
Starting restore of backup/b to restore/b as it was as of Thu Mar  6 16:44:23 
2008.
Processing changed file .
Processing changed file f1
Restore finished

# ls -l --full-time restore/*/f1
-rw------- 1 nobody users 5 2008-03-06 16:35:09.000000000 +0100 restore/a/f1
-rw-r--r-- 1 leo    users 5 2008-03-06 16:36:36.000000000 +0100 restore/b/f1

# echo test2 > src-a/f1

# rdiff-backup -v5 src-a backup/a
Using rdiff-backup version 1.1.15
escape_dos_devices not required by filesystem at src-a
-----------------------------------------------------------------
Detected abilities for source (read only) file system:
  Access control lists                         On
  Extended attributes                          On
  Case sensitivity                             On
  Escape DOS devices                           Off
  Mac OS X style resource forks                Off
  Mac OS X Finder information                  Off
-----------------------------------------------------------------
escape_dos_devices not required by filesystem at 
backup/a/rdiff-backup-data/rdiff-backup.tmp.0
-----------------------------------------------------------------
Detected abilities for destination (read/write) file system:
  Ownership changing                           On
  Hard linking                                 On
  fsync() directories                          On
  Directory inc permissions                    On
  High-bit permissions                         On
  Symlink permissions                          Off
  Extended filenames                           On
  Windows reserved filenames                   Off
  Access control lists                         On
  Extended attributes                          On
  Case sensitivity                             On
  Escape DOS devices                           Off
  Mac OS X style resource forks                Off
  Mac OS X Finder information                  Off
-----------------------------------------------------------------
Backup: must_escape_dos_devices = 0
Starting increment operation src-a to backup/a
Processing changed file .
Incrementing mirror file backup/a
Processing changed file f1
Incrementing mirror file backup/a/f1

# ls -l --full-time backup/*/f1
-rw------- 1 nobody users 6 2008-03-06 16:51:55.000000000 +0100 backup/a/f1
-rw-r--r-- 1 leo    users 5 2008-03-06 16:36:36.000000000 +0100 backup/b/f1

# cat backup/*/f1
test2
test

reply via email to

[Prev in Thread] Current Thread [Next in Thread]