I have several directories in an ext4 filesystem that I can't delete. When I run rm -rf
on the directories ps aux | grep rm
shows a status of D for the process. I have tried allowing it to run for several days.
The same directories have the same issue with ls
. I have tried to mv
and to rsync
the directories to a different block device - these commands have the same issue. I can mv
directories within the same block device.
Possibly pertinent - the drive did fill up. I was able to delete enough other directories to get the total used space down to 85%.
What can I try?
One possible solution is to try using the 'find' command to locate and delete the files in the directories. This can be done by running the following command:
This will recursively search the directory and delete all files it finds. Once all the files have been deleted, you should be able to delete the directory itself.
If this does not work, you may need to try using a tool such as fsck to check the filesystem for errors. This can be done by running the following command:
Replace sdX with the device name of the filesystem you are trying to delete. This will check the filesystem for errors and attempt to repair any it finds. Once the filesystem has been checked and repaired, you should be able to delete the directories.