Ubuntu – New ext4 partition and used space

ext4filesystempartitioning

I have a fresh ext4 partition, which means I just formated it with mkfs.ext4 -m 0.1 /dev/mapper/abak-home, and there's already 27G space used. Setting reserved root space (-m) to 0 didn't have any effect.

I'm using LVM but I don't think that LVM should have any effect on this. Ubuntu version is 12.04 LTS.

# df -h
Filesystem             Size  Used Avail Use% Mounted on
...
/dev/mapper/abak-home  1.8T   27G  1.8T   2% /home

Then I tried formating partition with ext3 and the result is much better:

# df -h
Filesystem             Size  Used Avail Use% Mounted on
...
/dev/mapper/abak-home  1.8T  196M  1.8T   1% /home

Anyway, why the difference and how can I fix this?

Best Answer

There's nothing to fix, and this is perfectly normal.

ext4 creates a lot of overhead before any files are created. It does not mean it is "worse" than ext3. If you fill that partition with files, you will notice that ext3's (and NTFS's) overhead will grow proportionally with the files, as with ext4 it will basically remain constant forever.

By "pre-allocating" the overhead, it can manage it much better than a growing one. So ext4 is just doing now what ext3 would do later.

Besides, 27G may look a lot, but it's still a mere 1.5% overhead. Compare that to the old days of FAT, where slack space could eat anything from 5% to 30% of your partition space, and you'll notice how greatly things have evolved since then.

Also, I strongly recommend against using -m 0. Reserved space is there for a reason: it lowers the fragmentation chances and saves some space for fsck. It is reserved only from users, but root (and thus all your software installs) can fully use it. If you think 5% is excessive, leave at least 1% .

Remember: there's no fragmentation nightmares in ext. But this beauty comes at a price. It needs free space as room for proper management. Give it to him and things will run much smoother. Besides, who ever uses their HDD beyond 90% before buying a larger one? So what's the problem about a 5% reserved space? It may save you the next time you accidentally create a dozen-GB file that fills up the whole partition and end up crashing the OS due to lack of space for other processes.

For a more detailed, further technical reading, read here

Related Question