Delete millions of subdirectories

75 Views Asked by At

I have an NFS SSD non-snapshotted scratch filesystem which a student ran a very interesting script on. We ran into problems after we noticed inodes were getting full (97%, as shown by df -i).

Effectively, the script created 3 directories which are x levels deep, where I think x is perhaps 5 million.

#The structure is quite simple and looks like this: tmp/test_run_SE_False_0/tmp/test_run_SE_False_0/tmp/test_run_SE_False_0/

Some of the directories are softlinks, which I have tried to remove with

rm -rf (process seems to crash/become too slow and disappear?)
find -type l exec unlink etc 
find -type l exec rm etc 

I have followed all the hints on this following link, eg the rsync solution https://www.kinamo.be/en/support/faq/efficiently-remove-a-zillion-files-on-linux-servers

But no luck - apparently the directories are too deep.

Does anyone have any alternative solutions or ideas ? IT wants to just take down the share, destroy it and start again.

Thanks, Colin

0

There are 0 best solutions below