From: Stephen Tweedie (sct@dcs.ed.ac.uk)
Date: 04/07/93


From: sct@dcs.ed.ac.uk (Stephen Tweedie)
Subject: Re: [Q] Ext2fs: why does it eat 1MB when being empty ?
Date: 7 Apr 1993 21:26:04 GMT


> Subject says all ;
> I've updated my system to the second extended file system and
> created a 32 MB partition for use as / . When i mount the new filesys
> and do df, df tells me:
> /mnt: blocks: 32768 used: about 8600
> after that i unmounted and ran e2fsck, which reported a wrong block count.
> after mounting again, df still reported 1024 blocks in use, about 30000 blocks free.

> Any suggestions ?

All unix filesystems reserve space for their inode table, which is a
table describing every file and directory in the filesystem. Unlike
DOS, which holds file information in the directories themselves, Unix
only holds the filename in a directory; all of the other file
information is kept in the file's inode.

So, in DOS, the space to hold file info is allocated dynamically
inside directories; under Unix, it is allocated statically, and eats
into the available free space.

Furthermore, there are maps indicating where the free blocks and
inodes are on a Unix filesystem (somewhat similar to the FAT (file
allocation table) on a DOS filesystem); these also consume space.

So, df is just telling you that the filesystem itself has reserved
part of the free space on the disk. You can select the number of
inodes reserved when you create the filesystem by using the -i option
to mke2fs.

Cheers,
 Stephen Tweedie.