hashdeep icon indicating copy to clipboard operation
hashdeep copied to clipboard

add option to not cross filesystem boundaries

Open roycewilliams opened this issue 12 years ago • 2 comments

Disk partitions can be mounted in such a way that they appear within a single directory tree. It would be very useful for hashdeep to be optionally configurable to only run against files within the target filesystem. This functionality would mimic the Linux find "-xdev" option.

For example, consider this Unix-like mount setup:

/dev/ad4s1e on /var
/dev/ad6s1f on /var/data2
/dev/ad6s1g on /var/data3

If hashdeep has already been run against /var/data2, and we now want to checksum the files in /var that are not within /var/data2 or /var/data3, there is no mechanism within hashdeep today to do this.

EDIT: Possibly related feature request (#180) was closed without comment, so I'm not sure if my request is still applicable or not.

roycewilliams avatar Oct 14 '13 21:10 roycewilliams

Aside from using find -xdev to generate the file list, if you're using Linux, there's a very simple work-around that can achieve this: the --bind option to mount lets you virtually mount one directory at another location on your filesystem. By default any nested mounts are not mounted at the destination.

mount --bind /data /data-one-fs

Then just scan /data-one-fs.

I couldn't see an option to do this with lofs loopback mounts on SunOS unfortunately so it would be nice to see this added as a cross-platform feature in hashdeep.

dw-ec avatar Nov 10 '18 12:11 dw-ec

I second this. Because of the ext4 kernel bug yesterday I was going to use hashdeep to generate a weekly hash list of all my files on all my devices. But this quickly becomes impractical with the dozen or so virtual filesystems that gnu/linux mounts today. Yes. I can string it together with gnu find. but the parallelism from hashdeep is nice, and would be hard to get right in a bash script. if only there was a --one-file-system option to hashdeep!

BillyCroan avatar Dec 11 '23 00:12 BillyCroan