Hard linked files synced as individual files #48

Open
opened 2017-10-08 21:20:56 +02:00 by 6b6561 · 0 comments
6b6561 commented 2017-10-08 21:20:56 +02:00 (Migrated from github.com)

"-H" should be added to $rsync_options to have any hard linked files synced as hard links and not as indivividual files.

    -H, --hard-links            preserve hard links

As an example, the bzcat files in the source are all hard linked files with the same inode, while the destination has these as three separate files.

Source
root@hall2:/mnt/clone/bin# cd /bin root@hall2:/bin# ls -li bunzip2 bzcat bzip2 998 -rwxr-xr-x 3 root root 30404 Jan 29 2017 bunzip2 998 -rwxr-xr-x 3 root root 30404 Jan 29 2017 bzcat 998 -rwxr-xr-x 3 root root 30404 Jan 29 2017 bzip2 root@hall2:/bin#

Clone
root@hall2:/tmp# cd /mnt/clone/bin/ root@hall2:/mnt/clone/bin# ls -li bunzip2 bzcat bzip2 475 -rwxr-xr-x 1 root root 30404 Jan 29 2017 bunzip2 493 -rwxr-xr-x 1 root root 30404 Jan 29 2017 bzcat 508 -rwxr-xr-x 1 root root 30404 Jan 29 2017 bzip2 root@hall2:/mnt/clone/bin#

The good news is that adding -H to the rsync flags will correct the clone on the next run.

Clone after re-running rpi-clone with -H added to rsync flags
root@hall2:/mnt/clone/bin# ls -li bunzip2 bzcat bzip2 475 -rwxr-xr-x 3 root root 30404 Jan 29 2017 bunzip2 475 -rwxr-xr-x 3 root root 30404 Jan 29 2017 bzcat 475 -rwxr-xr-x 3 root root 30404 Jan 29 2017 bzip2 root@hall2:/mnt/clone/bin#

"-H" should be added to $rsync_options to have any hard linked files synced as hard links and not as indivividual files. -H, --hard-links preserve hard links As an example, the bzcat files in the source are all hard linked files with the same inode, while the destination has these as three separate files. **Source** `root@hall2:/mnt/clone/bin# cd /bin root@hall2:/bin# ls -li bunzip2 bzcat bzip2 998 -rwxr-xr-x 3 root root 30404 Jan 29 2017 bunzip2 998 -rwxr-xr-x 3 root root 30404 Jan 29 2017 bzcat 998 -rwxr-xr-x 3 root root 30404 Jan 29 2017 bzip2 root@hall2:/bin#` **Clone** `root@hall2:/tmp# cd /mnt/clone/bin/ root@hall2:/mnt/clone/bin# ls -li bunzip2 bzcat bzip2 475 -rwxr-xr-x 1 root root 30404 Jan 29 2017 bunzip2 493 -rwxr-xr-x 1 root root 30404 Jan 29 2017 bzcat 508 -rwxr-xr-x 1 root root 30404 Jan 29 2017 bzip2 root@hall2:/mnt/clone/bin#` The good news is that adding -H to the rsync flags will correct the clone on the next run. **Clone after re-running rpi-clone with -H added to rsync flags** `root@hall2:/mnt/clone/bin# ls -li bunzip2 bzcat bzip2 475 -rwxr-xr-x 3 root root 30404 Jan 29 2017 bunzip2 475 -rwxr-xr-x 3 root root 30404 Jan 29 2017 bzcat 475 -rwxr-xr-x 3 root root 30404 Jan 29 2017 bzip2 root@hall2:/mnt/clone/bin#`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Lerking/rpi-clone#48
No description provided.