Sample Header Ad - 728x90

Delete huge directory that causes all commands to hang

6 votes
4 answers
1393 views
How do I delete this large directory? stat session/ File: ‘session/’ Size: 321540096 Blocks: 628040 IO Block: 4096 directory Device: 903h/2307d Inode: 11149319 Links: 2 Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2022-09-29 14:34:40.910894275 +0200 Modify: 2022-09-29 14:35:09.598400050 +0200 Change: 2022-09-29 14:35:09.598400050 +0200 Birth: - **Note that the size of directory (not the content, but the directory entry itself) is over 300MB.** Number of inodes is over 11 million. **The directory has no subdirectories, only large number of files.** None of the usual commands work. I have tried these: - rsync -a --delete empty_dir/ session/ - rm -rf session - find . -type f --delete If I run ls -f1 inside, it hangs. If I run mv -- * ../.tmp_to_delete inside, it hangs. If I run du inside, it hangs. At the moment the rsync --delete is running since two days, reading at the rate of up to 7MB/s, and I see no change in the stat output for the directory. I assume the large size of the directory is the problem.
Asked by Bojan Hrnkas (200 rep)
Sep 29, 2022, 12:56 PM
Last activity: Jun 18, 2024, 02:11 AM