2

I'm curious, what is the smallest size a file can really be on Linux? (Assuming Ext3 fs, so why not ext4 fs as well).

Sure you can write a file that only contains one byte, or maybe even less; but surely that'll allocates a minimum, and reasonable amount of data for convenience.

So what is the minimum allocation / block size that can be allocated on ext3, and or ext4?

1
  • 1
    1024 is the smallest according to the mke2fs manpage. 4096 is the default. – jordanm Mar 20 '15 at 0:24
3

The smallest possible allocation size for a file in ext3/ext4 is 0 (none at all) because of inline data: files with sizes smaller than 60 bytes can be stores completely inside the inode itself.

Of course, every file, whether it's a regular file, symlink, directory (which can contain data), or character device or block device or named pipe (none of which possess the concept of "contents"), still occupies an inode. You can read about the size of the inode itself.

1
  • While this answer is technically correct, it still misses the point. The inode itself uses space, and even worse: it seems that you can't have more than one inode per block. So ultimately a file still consumes one block, one way or the other, even if stored inside the inode. And the minimum block size of ext4 is 1024 bytes. – noamik Oct 27 '20 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.