28

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?

3 Answers 3

42

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

2
  • The overhead is important if you're creating a small-ish volume, such as an encrypted container for sensitive documents, onto which you're not going to install software or perform operations as root. Jun 18, 2017 at 1:01
  • @DanDascalescu: in this case, the use of -m 0 is fine, and ext4 overhead would only be 1.5%
    – MestreLion
    Aug 15, 2017 at 7:47
4

I suspect this is down to overhead : file systems need somewhere to keep the information about files. It may be that ext4, being a newer file system, has defaults that reserve more space for file metadata than ext3, which was developed in a time when storage devices were smaller and liable to hold fewer files.

You're right that LVM has no effect on this ; it's just another way of providing block devices.

I don't think you necessarily need to "fix" this - and I would expect you to do better with ext4 using it's default options, than ext3, on such a large drive. If you want to tweak the options when you create the filesystem, you can always review the manual for mkfs.ext4. Such choices are probably best made in the light of the expected load for the volume.

2
  • Yes, I suspect that as well. although 27G is a little extreme to me. I am interested in more information on this rather than our suspicions. :)
    – Samuel
    May 4, 2012 at 15:56
  • @Samuel: 27GB is far from extreme when you're talking about a 2 TB volume
    – MestreLion
    Aug 15, 2017 at 7:48
-2

Use df -H instead. The difference you see is because of the difference in real GBs/TBs (factor of 1024) and sales men's GBs/TBs (factor of 1000).

1
  • 3
    This is not the real issue. The issue is ext4 overhead, or more precisely, reserved space. See the other answers for more info.
    – Léo Lam
    Apr 17, 2015 at 20:56

You must log in to answer this question.

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