On Sat, Sep 19, 1998 at 01:05:28AM -0500, Mark N. Hattarki wrote:

| I guess I don't know anything about the elf fs :( Can someone tell me why

elf?  do you mean ext2fs ?

| an empty directory would take up more space than an non-empty one :
| 
| [gandhiji@beeblebrox /lost+found]$ ls -al
| total 13
| drwxr-xr-x   2 root        12288 Sep  2 16:58 .
| drwxr-xr-x  18 root         1024 Sep 18 21:47 ..
| 
| When /usr is:
| drwxr-xr-x  20 root         1024 Sep  2 17:04 usr
| 
| Now, I thought that the long listing (`ls -l`) would give you the space
| nessasary for the directory structure, i.e. the size of the record of the
| dir info. I makes sence that /usr is 1k then, because that is the size of
| a block. But, how is a directory's size not even equal to a power of two
| (esp if it's an empty dir)? Is there something special about "lost+found"?
| I still have other dirs like this tho.

When you create a new directory, it's small - 1k under Linux with
ext2fs.  As you put in more files, this 1k fills up.  Once it's full,
the directory allocates more space for the additional entries, and
this keeps happening as you put in more files.

Once the files are deleted, however, the space is *not* de-allocated.
And that's what you're seeing here.

lost+found is a little bit special - it's been pre-extended already.
The reason is that if fsck has a lot of files to save, we don't want
to have to allocate more space for the directory entry - doing so
could mean that we're losing data (since we could grab some space
that's already being used by a file that fsck hasn't gotten to yet,
corrupting that file.)

-- 
Doug McLaren, [EMAIL PROTECTED]
---------------------------------------------------------------------------
Send administrative requests to [EMAIL PROTECTED]

Reply via email to