Directory size grows when creating/deleting thousands of files
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Confirmed
|
Medium
|
Unassigned |
Bug Description
Run the attached bash script. ( it might cause wear and tear on your hard drive ).
What I expect should happen :
Folder size of test should be 4.0K like before I ran the test.
What actually happened :
Folder size is not 2.1M ( 2138112 bytes ).
There does not seem to be any way to recover the 2 megabytes lost and the only way to get the folder size back to 4.0K is to delete it and recreate it.
lsb_release -rd :
Description: Ubuntu 14.04.1 LTS
Release: 14.04
apt-cache policy linux-generic :
linux-generic:
Installed: 3.13.0.35.42
Candidate: 3.13.0.57.64
Version table:
3.13.0.57.64 0
500 http://
500 http://
*** 3.13.0.35.42 0
100 /var/lib/
3.13.0.24.28 0
500 http://
This also affects other versions of Ubuntu, including but not limited to Ubuntu 10.04 and Ubuntu 12.04
affects: | linux-meta (Ubuntu) → linux (Ubuntu) |
Changed in linux (Ubuntu): | |
status: | New → Confirmed |
importance: | Undecided → Medium |
tags: | added: kernel-bug-exists-upstream kernel-da-key |
If you delete a file, and space does not get freed, it's usually either because the file is still kept open, or there are other hardlinks to it.
Can you run:
lsof | grep deleted