9

This is an output from dumpe2fs:

root: ~/# dumpe2fs -h /dev/sdb3 | grep -i 'fragment|block size'
dumpe2fs 1.39 (29-May-2006)
Block size:               4096
Fragment size:            4096
Fragments per group:      32768

Is this related to disk fragmentation?

Caleb
  • 70,105

1 Answers1

11

No. ext3fs doesn't support block fragmentation so a one byte file will use a whole 4096 block.

On the opposite, for example UFS supports multiple fragments in a block so small files won't fill a file system as fast as they will do on ext3fs.

This is unrelated to file system fragmentation which is about file data blocks not being contiguous and sequential.

jlliagre
  • 61,204
  • 2
    Thanks for the answer. The mkfs manual is very cryptic-only a one liner for the "-f fragment-size" option. If block fragmentation is not supported in ext2/3/4, why does the -f option appear in the mke2fs manual? Nothing serious, just curious. – JBraganza Jul 09 '11 at 00:50
  • 3
    Just in case someone want to implement it. See the BUGS section in the very same manual page: mke2fs accepts the -f option but currently ignores it because the second extended file system does not support fragments yet. – jlliagre Jul 09 '11 at 01:27
  • It is one of those things that was put in as a planned feature, but never implemented. – psusi Jul 09 '11 at 01:28
  • @psusi: actually, it's one of those things that was put to make ext2fs more like UFS and FFS. Probably noone ever expected it to be implemented in the future. – ninjalj Jul 10 '11 at 20:38
  • At least the manual page writer expected it to be implemented. – jlliagre Jul 10 '11 at 21:51
  • @ninjalj, they put it in because they expected ext2fs to be similar to UFS and have the feature. If they knew it would never be implemented, it wouldn't have been put in. – psusi Jul 11 '11 at 03:59
  • Not unrelated to disk fragmentation though. Per Oracle Solaris' doc (https://docs.oracle.com/cd/E19253-01/817-5093/fsfilesysappx-10/index.html) : "The ability to allocate fragments of blocks to files, rather than just whole blocks, saves space by reducing fragmentation of disk space that results from unused holes in blocks." – ChennyStar Jan 08 '24 at 05:46
  • @ChennyStar Solaris documentation talks about storage efficiency when referring to disk fragmentation. This is not the usual meaning of fragmentation which is not about storage efficiency (space) but sequential file access performance (seeks). Nowadays, this is less of an issue because more and more file systems are on SSDs where seeks are "free". – jlliagre Jan 08 '24 at 08:38
  • 1
    @jlliagre : I know, and I agree. It just goes to show that the term fragmentation can have different meanings in different contexts. In any case, I also put the link to Oracle's doc, because it's a concise description of what a fragment is in FFS/UFS – ChennyStar Jan 08 '24 at 09:14
  • @ChennyStar Thanks, answer updated. – jlliagre Jan 08 '24 at 09:41