For about a week I've been waiting for the following command to complete
find -type d -empty -print -delete >> empty-folder-deletion-log.txt
but it is still going and it seems like it has a lot of work left to do. I feel I could have already imaged the entire hard drive several times by now so I feel the command isn't optimal or there is a way to speed this up.
To be fair there are a huge number of files and folders. One hard drive has roughly 100 million inodes and another has roughly 175 million inodes.
What can I do to speed this up? I suspect that the issue is related to random IO, is there an equivalent command which could do it in order of the way the metadata is stored on the hard drive reducing seeking? What options do I have to speed this up without interrupting the command or is there a way to retry with a different program? Would remounting with noatime help? If so may I do this without interrupting the command?
I'm using the latest version of Debian stable which at the time of writing is Debian bullseye. This command is being ran on two hard drives a 8 TB hard drive and a 12 TB hard drive, both are 5400 RPM.
io waitin top? How do you know that imaging would have been faster? Are you seeing errors indmesg(the hard drive(s) could be failing)....df -ishould be practically instantaneous.