markfasheh / duperemove

Tools for deduping file systems
GNU General Public License v2.0
816 stars 81 forks source link

duperemove follows moved file through symlinks to other filesystem #230

Closed maweki closed 4 years ago

maweki commented 4 years ago

So i have the following directory structure

ls -alh /home/maweki/.local/share/
lrwxrwxrwx. 1 maweki maweki   31 27. Mai 13:08  gnome-boxes -> /home/maweki/.fast/gnome-boxes/

and the following mounts:

/dev/sde on /home type btrfs (rw,noatime,seclabel,space_cache,subvolid=5,subvol=/)
/dev/sdf on /home/maweki/.fast type ext4 (rw,relatime,seclabel)

I duperemove with the following command: /usr/sbin/duperemove -dhr --hashfile=/home/.duphash --io-threads=1 /home which worked before I created the symlink and moved the contents of the directory. After moving I get this:

[root@maweki-desktop ~]# /usr/sbin/duperemove -dhr --hashfile=/home/.duphash --io-threads=1 /home
Gathering file list...
Adding files from database for hashing.
"/home/maweki/.local/share/gnome-boxes/images/fedora-unkno": Can only dedupe files on btrfs or xfs (experimental)

Duperemove looks up the file from its hash directory and follows the symlink onto another filesystem. I am not sure whether duperemove should follow symlinks at all but in this case after following the symlink it should check whether it had crossed filesystems or not. duperemove shouldn't follow the symlink if it crosses the filesystem. I use version "0.11.1" where -x is said to be the default.

lorddoskias commented 4 years ago

I think this has been fixed by bdf5ff20ee3f (which is related to issue #202). This has been merged into master, perhahps you can test or simply backport it yourself to 0.11.1 and retry .

lorddoskias commented 4 years ago

Closing as this has been fixed in trunk, if you find any other issues open a new issue.