1

In Windows, when a file/folder is created, it is associated with an FRN (a unique number which is like an Index into the MFT). All the file metadata is stored in the MFT which occupies a reserved size of 12.5 % of the disk size.

How and where is the metadata stored on Unix filesystems like ext2, ext3 etc... ? An inode is a unique value for every single file/folder on Unix, but where does this information get stored ? In other words:

  1. What is the size occupied by an inode?

  2. Where is the metadata for a file/folder on Unix stored? Is there something similar to the MFT on Unix?

1 Answer 1

6

What Windows (or more precisely NTFS) calls MFT is what typical Unix filesystems call the inode table, and what Windows calls FRN is the inode number. It contains the metadata for a file (permissions, timestamps, etc.), but not the file name (that's part of the directory entries). It also contains the address of the first few blocks of the file, or the blocks containing the addresses of the blocks of the file.

Run tune2fs -l /dev/sdz99 (replace sdz99 by the proper path to the block device you're intersted in) to get some information about an ext2/ext3/ext4 filesystem, including the “Inode count” (number of inodes) and the “Inode size” (in bytes). For these filesystems, the number of inodes is chosen when the filesystem is created, it doesn't grow dynamically with the number of files. You can run df -i to see how many inodes are in use on a mounted filesystem.

There are filesystems that have different data structures. Although the concept of inode is universal on Unix, because the filesystem APIs associate a unique inode number to every file, implementations can differ. For example Btrfs doesn't reserve space for inodes, they're allocated as needed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .