Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a find -xdev equivalent #31

Closed
sseering opened this issue Oct 2, 2020 · 3 comments · Fixed by #673
Closed

Add a find -xdev equivalent #31

sseering opened this issue Oct 2, 2020 · 3 comments · Fixed by #673
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@sseering
Copy link

sseering commented Oct 2, 2020

Add a find -xdev equivalent. Add a function to only search on one filesystem.

@qarmin
Copy link
Owner

qarmin commented Oct 2, 2020

I'm not sure if I understand this correctly what this argument do.

By default find search also places at which points symbolic links, and -xdev prevents from doing this?

If yes, then this issue can be closed because Czkawka just ignore symbolic links, because they will allow to break tree hierarchy of file system, and will force to remove some directory optimizations and it will require additional step with removing duplicated same files with identical path.

@qarmin qarmin added the enhancement New feature or request label Oct 2, 2020
@sseering
Copy link
Author

sseering commented Oct 2, 2020

-xdev will make find never leave the filesystem it started on. czkawka should do that too.

Example:

  • / is on /dev/sda1
  • /usr/share/databases is on /dev/sda2

then a search starting in /usr would look at all files recursively in /usr/ but at no files in /usr/share/databases.

Why its useful

In the current czkawka version when I want to search for duplicate files in / device then it would search /proc and /dev and /sys too. It doesn't make sense to search in these so /proc and /dev and /sys are in the excluded dirs by default.

But it also searches in /tmp which is wrong because its tmpfs so I add /tmp to the excluded dirs too and restart search.

But it also searches in /run which is wrong because its tmpfs so I add /run to the excluded dirs too and restart search.

But it also searches in /boot/efi which is wrong because its the EFI ROM so I add /boot/efi to the excluded dirs too and restart search.

But it also searches in /mnt/nfs which is wrong because its a network filesystem so I add /mnt/nfs to the excluded dirs too and restart search.

And so on .... .

Exclusion lists are like chasing an imperfect solution here. Limiting the search to one filesystem is really useful here to automatically exclude all of /proc and /dev and /sys and /run and ... and so on without needing to work on a list that will never be perfect.

@qarmin qarmin added the help wanted Extra attention is needed label Oct 2, 2020
@qarmin qarmin mentioned this issue Oct 7, 2020
10 tasks
@qarmin
Copy link
Owner

qarmin commented Feb 23, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants