LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Why is du high for an empty directory? (https://www.linuxquestions.org/questions/linux-software-2/why-is-du-high-for-an-empty-directory-4175428002/)

Fishbowler 09-19-2012 10:11 AM

Why is du high for an empty directory?
 
I've been moving a lot of files around today, and come across a peculiar situation where an empty folder has a high reported disk usage.

du -b gives:

Code:

4096    ./FolderOne
4096    ./FolderTwo
36864  ./FolderThree
229376  ./FolderFour


ls -R gives:

Code:

.:
. .. FolderOne FolderTwo FolderThree FolderFour

./FolderOne:
. ..

./FolderTwo:
. ..

./FolderThree:
. ..

./FolderFour:
. ..

ls -aR gives the same, but more verbosely. The sizes are proportional to the amount of files that were in them previously. This is on an ext3 drive.

Any ideas what's going on?

amani 09-19-2012 10:29 AM

Did you change mount options?

diratime?

fsck and report

jefro 09-19-2012 05:16 PM

Wonder what ls */ says?

Tinkster 09-19-2012 06:06 PM

And there's always the obvious question: did you remove a file that process
was still writing to?

lsof | grep FolderFour


Cheers,
Tink

Fishbowler 09-20-2012 01:29 AM

Thanks to all for the suggestions.

Mount options are unchanged. I can post my fstab if it helps?

Ran a boot time fsck but the problem still exists. Is there a log file I should be looking at? Google reckons /var/log/messages, but that file doesn't exist on my system. I have /var/log/fsck/checkfs and /var/log/fsck/checkroot, but they haven't been modified since October '11. I'm running Mint 12.

ls */ gives:
Code:

FolderOne/:

FolderTwo/:

FolderThree/:

FolderFour/:

lsof | grep FolderFour gives nothing.

Any more ideas?

Fishbowler 09-20-2012 05:36 AM

Here's the line for the drive from /etc/fstab:
Code:

/dev/disk/by-uuid/f0fc5b1c-0d97-47f2-995d-0d4bc3c23531      /media/DATA3  ext3    auto,user,exec,rw 0 2

rknichols 09-20-2012 09:28 AM

What is the size of the directory itself (ls -ld FolderFour)? If that directory once contained a large number of file names, the directory file itself will be large, and a directory file never shrinks.

Fishbowler 09-20-2012 09:59 AM

ls -ld shows the same size as above - 229376.
Looks like a feature of ext filesystems.

Thanks for your help!

rknichols 09-20-2012 12:19 PM

As pointed out in the referenced thread, the only way to reduce that size is to delete the directory and re-create.


All times are GMT -5. The time now is 03:52 PM.