Hi, I've got problems with a symlink to another device in a directory used with '--link-dest'. I've got something like augustin@i90fs4:/tmp/rsync% ls -alR .: total 16 drwxr-xr-x 4 augustin augustin 4096 Mar 15 12:07 ./ drwxrwxrwt 4 root root 4096 Mar 15 10:56 ../ drwxr-xr-x 3 augustin augustin 4096 Mar 11 15:05 source/ drwxr-xr-x 2 augustin augustin 4096 Mar 11 15:06 unusable_link-dest/ ./source: total 12 drwxr-xr-x 3 augustin augustin 4096 Mar 11 15:05 ./ drwxr-xr-x 4 augustin augustin 4096 Mar 15 12:07 ../ drwxr-xr-x 2 augustin augustin 4096 Mar 11 15:05 dir/ ./source/dir: total 12 drwxr-xr-x 2 augustin augustin 4096 Mar 11 15:05 ./ drwxr-xr-x 3 augustin augustin 4096 Mar 11 15:05 ../ -rw-r--r-- 1 augustin augustin 9 Mar 11 12:17 foo ./unusable_link-dest: total 8 drwxr-xr-x 2 augustin augustin 4096 Mar 11 15:06 ./ drwxr-xr-x 4 augustin augustin 4096 Mar 15 12:07 ../ lrwxrwxrwx 1 augustin augustin 19 Mar 11 15:06 dir -> /home2/augustin/dir/ and augustin@i90fs4:/tmp/rsync% ls -alR /home2/augustin/dir /home2/augustin/dir: total 20 drwxr-xr-x 2 augustin augustin 4096 Mar 11 12:07 ./ drwxr-xr-x 229 augustin liinstud 12288 Mar 15 12:06 ../ -rw-r--r-- 1 augustin augustin 9 Mar 11 12:17 foo and when I try: e/ dest building file list ... done created directory dest ./ dir/ link /tmp/rsync/unusable_link-dest/dir/foo => dir/foo : Invalid cross-device link wrote 106 bytes read 20 bytes 252.00 bytes/sec total size is 9 speedup is 0.07 I get: augustin@i90fs4:/tmp/rsync% ls -alR dest dest: total 12 drwxr-xr-x 3 augustin augustin 4096 Mar 11 15:05 ./ drwxr-xr-x 5 augustin augustin 4096 Mar 15 12:10 ../ drwxr-xr-x 2 augustin augustin 4096 Mar 11 15:05 dir/ dest/dir: total 8 drwxr-xr-x 2 augustin augustin 4096 Mar 11 15:05 ./ drwxr-xr-x 3 augustin augustin 4096 Mar 11 15:05 ../ I've tested this with rsync-HEAD-20040311-1010GMT.tar.gz (no special configure options) using Solaris 2.7 and Debian Woody on a UltraSparc I box. Everything is fine using Debian on i386. Perhaps something with 32/64 bit? Linux-Kernel is 64bit the libraries used are 32bit: augustin@i90fs4:/tmp/rsync% ldd /usr/local/rsync-20040311/bin/rsync libpopt.so.0 => /lib/libpopt.so.0 (0x7002c000) libresolv.so.2 => /lib/libresolv.so.2 (0x70044000) libc.so.6 => /lib/libc.so.6 (0x70064000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x70000000) /tmp is on a SCSI hard disk. Any hints, any ideas what might go wrong? Btw. I had a look at the code in generator.c. Wouldn't it be a good idea to report a critical error and not only a message in verbose mode if do_link fails? bye, Werner Augustin
Werner Augustin <augustin@ira.uka.de> writes:> and when I try: > > e/ dest > building file list ... done > created directory dest > ./ > dir/ > link /tmp/rsync/unusable_link-dest/dir/foo => dir/foo : Invalid cross-device link > > wrote 106 bytes read 20 bytes 252.00 bytes/sec > total size is 9 speedup is 0.07Oops, something went wrong when I copied this, actually I tried: augustin@i90fs4:/tmp/rsync% /usr/local/rsync-20040311/bin/rsync -a -v --link-dest=/tmp/rsync/unusable_link-dest source/ dest building file list ... done created directory dest ./ dir/ link /tmp/rsync/unusable_link-dest/dir/foo => dir/foo : Invalid cross-device link wrote 106 bytes read 20 bytes 252.00 bytes/sec total size is 9 speedup is 0.07 bye, Werner Augustin
> If you want to use --link-dest, you will have to point to a place on the > same filesystem containing the stuff you're linking. > --link-dest=DIR create hardlinks to DIR for unchanged filesYes, I know. But what I was expecting was the behaviour I get on i386: rsync should recognise that it can't use/recycle the file because it is on a different filesystem and make a new copy. Source and destination should be as identical as possible, no matter how 'useful' the data in the directory specified with '--link-dest' is. Or at least I would expect an error message. As I mentioned before, I am worried that the error code of the link system call is only printed in verbose mode. I could imagine a dozen of horrible things that could happen while rsync is running and it would be important that the user gets a notice that something went wrong. Werner Augustin