Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have 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 in 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 to fix this?

share|improve this question

2 Answers 2

up vote 11 down vote accepted

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

share|improve this answer

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.

share|improve this answer
    
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. :) –  Samo Jelovšek May 4 '12 at 15:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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