Your message dated Sat, 4 Aug 2012 11:58:50 +0200
with message-id <[email protected]>
and subject line Re: Bug#683811: --link-dest is broken in some cases
has caused the Debian Bug report #683811,
regarding --link-dest is broken in some cases
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
683811: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683811
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: rsync
Version: 3.0.9-3
Severity: important
Hello,
I've accidentally noticed that my home directory backups (done using
rsync and --link-dest set to last backup directory) are taking up
much more space than expected. Investigation revealed that the
unchanged files are actually not hard-linked, as I would expect.
Here's a small demo:
jurij@paddy:~/tmp$ mkdir src
jurij@paddy:~/tmp$ touch src/foo
jurij@paddy:~/tmp$ rsync -r /home/jurij/tmp/src/ link
jurij@paddy:~/tmp$ ls -al link
total 8
drwxr-xr-x 2 jurij jurij 4096 Aug 4 10:13 .
drwxr-xr-x 4 jurij jurij 4096 Aug 4 10:13 ..
-rw-r--r-- 1 jurij jurij 0 Aug 4 10:13 foo
jurij@paddy:~/tmp$ rsync -r --link-dest /home/jurij/tmp/link
/home/jurij/tmp/src/ dst
jurij@paddy:~/tmp$ ls -al dst
total 8
drwxr-xr-x 2 jurij jurij 4096 Aug 4 10:13 .
drwxr-xr-x 5 jurij jurij 4096 Aug 4 10:13 ..
-rw-r--r-- 1 jurij jurij 0 Aug 4 10:13 foo
jurij@paddy:~/tmp$ stat dst/foo
File: `dst/foo'
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 807h/2055d Inode: 1572876 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ jurij) Gid: ( 1000/ jurij)
Access: 2012-08-04 10:13:46.007097660 +0100
Modify: 2012-08-04 10:13:46.007097660 +0100
Change: 2012-08-04 10:13:46.007097660 +0100
Birth: -
jurij@paddy:~/tmp$
As you can see, the file dst/foo has link count of 1, and I would
expect it to be 2, as it should be just hardlinked to link/foo. In
case it matters, /home is its own partition, with ext4 filesystem.
Corresponding line from mount output (all options are default, as set
during install):
/dev/sda7 on /home type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered)
I'm pretty sure that it used to work before, I've been doing the
backups the same way for a couple of years, and older backups do have
files hard-linked, as expected. If this bug is confirmed, I would
expect its severity to be bumped to RC.
Best regards,
--
Jurij Smakov [email protected]
Key: http://www.wooyd.org/pgpkey/ KeyID: C99E03CC
--- End Message ---
--- Begin Message ---
On Sat 04 Aug 2012, Jurij Smakov wrote:
>
> Here's a small demo:
>
> jurij@paddy:~/tmp$ mkdir src
> jurij@paddy:~/tmp$ touch src/foo
> jurij@paddy:~/tmp$ rsync -r /home/jurij/tmp/src/ link
Why no -a or at least -t option in addition to -r? Now the attributes
won't be preserved.
> jurij@paddy:~/tmp$ ls -al link
> total 8
> drwxr-xr-x 2 jurij jurij 4096 Aug 4 10:13 .
> drwxr-xr-x 4 jurij jurij 4096 Aug 4 10:13 ..
> -rw-r--r-- 1 jurij jurij 0 Aug 4 10:13 foo
> jurij@paddy:~/tmp$ rsync -r --link-dest /home/jurij/tmp/link
> /home/jurij/tmp/src/ dst
Again, no -a?
> jurij@paddy:~/tmp$ ls -al dst
> total 8
> drwxr-xr-x 2 jurij jurij 4096 Aug 4 10:13 .
> drwxr-xr-x 5 jurij jurij 4096 Aug 4 10:13 ..
> -rw-r--r-- 1 jurij jurij 0 Aug 4 10:13 foo
> jurij@paddy:~/tmp$ stat dst/foo
> File: `dst/foo'
> Size: 0 Blocks: 0 IO Block: 4096 regular empty file
> Device: 807h/2055d Inode: 1572876 Links: 1
> Access: (0644/-rw-r--r--) Uid: ( 1000/ jurij) Gid: ( 1000/ jurij)
> Access: 2012-08-04 10:13:46.007097660 +0100
> Modify: 2012-08-04 10:13:46.007097660 +0100
Now do a stat of the link-dest file, you'll see that the modification
time is subtlely different, preventing the link being made as the
metadata is different.
$ cd /tmp
$ mkdir src
$ touch src/foo
$ rsync -ra /tmp/src/ link
$ ls -l link
total 0
-rw-r--r-- 1 paul paul 0 Aug 4 11:53 foo
$ rsync -ra --link-dest /tmp/link /tmp/src/ dst
$ ls -lsa dst
total 0
0 drwxr-xr-x 2 paul paul 60 Aug 4 11:53 .
0 drwxrwxrwt 26 root root 2360 Aug 4 11:53 ..
0 -rw-r--r-- 2 paul paul 0 Aug 4 11:53 foo
Here it did hard-link, because I used the proper options.
> If this bug is confirmed, I would
> expect its severity to be bumped to RC.
Millions of people use rsync, do you really think that such an important
facility would be broken without that becoming known very quickly?
Closing this bug report now.
Paul
--- End Message ---