Open matthiaskrgr opened 8 years ago
Btw, I got -22 and realized that we were missing dedupe at the unaligned tail of files during block dedupe. It's a different error but you might want to check out latest master just in case.
Hi,
I got those "Invalid cross-device link"-errors when I ran Duperemove recursively on the / directory of my OpenSUSE-installation, since OpenSUSE mounts many subvolumes of the same filesystem, separately at various mountpoints (such as /var/log, /opt, etc). This results in Duperemove being suggested to dedupe files from different mountpoints, which it refuses to do.
I solved it by mounting the whole partition separately at an extra mountpoint, mount -o subvolid=5 /dev/sda7 /mnt , and then ran Duperemove on /mnt .
I don't know if you also were running Duperemove across several mount points, though.
Claes
Hmm, dedupe between subvolumes (on the same FS) should work fine. I understand the different mountpoints (I've got all SUSE here too) at least on my boxes they're still on the same fs. I'm loading a fresh Tumbleweed VM so I'll give a dedupe of '/' a try and see if I get the same thing. Maybe I missed something there (or maybe somehow btrfs is giving us a hard time).
Just in case, would you mind terribly providing the output of 'mount | grep btrfs' and at least one of those 'Invalid cross-device link" errors from your duperemove -rd /
? (you can obscure the actual filename if you like, I just want to see what mountpoint it matches up with).
Found two files that reproduce:
strace -f duperemove -b4k -d --io-threads=1 --cpu-threads=1 /etc/postfix/virtual.db /.snapshots/1/snapshot/usr/lib/grub2/x86_64-efi/grub.efi
gave me the following:
[pid 1173] ioctl(3, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, {src_offset=57344, src_length=4096, dest_count=1, info=[{dest_fd=4, dest_offset=4096}]} => {info=[{bytes_deduped=0, status=-18}]}) = 0
which would be the source of our "Invalid cross-device link" message.
Oh I should add that these are of course different mount points. A quick test with two identical files between /opt and /tmp reproduces the same message even though these are all on the same btrfs fs.
So @Claes1981 is right that the mountpoint is the problem here.
It's this line in the kernel from vfs_dedupe_file_range():
} else if (file->f_path.mnt != dst_file->f_path.mnt) {
info->status = -EXDEV;
vfs_clone_file_range() does the same check above, so this might be something we just have to deal with.
Hi,
I have another problem since a couple of days: My computer always freezes after one or a few minutes after booting my OpenSUSE installation (I can reboot by pressing Alt-sysrq-b though). However, I managed to get a photo from "mount | grep btrfs" before freeze:
Unfortunately I do not get enough time now to run duperemove before it freezes, but I remember that I was googling "Invalid cross-device link" a few months ago when I was getting those errors. I found people describing that they were trying to copy and reflink across mountpoints, which was not possible. I remember that I also indeed got those errors from duperemove for files, whose paths included different mount points.
I had a couple of [0x39bf450] Dedupe for file "filename" had status (-18) "Invalid cross-device link". messages. I did not notice anything special about the files, only that one file was owned by a normal user and one file was owned by root. Since I ran the dedupe as root, I don't think there should be any such problems. The warning is a bit weird anyway since this system only consists of a single disk.