Do not waste my hard disk!

I recently acquired an 2 TB hard disk drive, which I immediately formatted with ext4. Given that mkfs.ext4 defaults to 5% reserved blocks for too, that amounts to 100 GB of lost* space.

Wow. 100 GB. On a desktop machine. For root.

While mkfs belongs to e2fsprogs, I think this requires action on the distributions side. Let me explain.

If you are installing a server, 5% makes perfect sense: there are a lot of logfiles, updates, potential break-ins and other disasters-to-happen for which root-reserved space will be preciously required. 5% is a good choice here. If 5% is too much (or too little), it will not matter: any decent sysadmin knows mkfs.ext4 -m and tune2fs -m (if you don’t, Martin will teach you).

On the other hand, if you are installing Ubuntu on your laptop, you probably don’t know shit about mkfs, tune2fs, 5%, etc. You only know by removing Windows and installing Linux you’ve magically lost 100GB of space. Vanished.

So here is my request to Linux distributions: when installing a distribution in “desktop profile” (i. e. not Debian in “server” profile, RHEL, SLES, Ubuntu Server, etc), DO NOT RESERVE 5% to root. 100 or 200 MEGABYTES should be more than enough.

* Yes, I know it’s not really “lost” but just “unusable by normal users” but that technicality doesn’t matter to 99% of the people out there.

22 Thoughts on “Request to Linux distributions

  1. Maybe a better solution would be to have a default upper cap on the amount of space that gets allocated? So it saves 10% up to a maximum of, I don’t know, 500M?

  2. What I do is have separate partitions for:
    – boot
    – root
    – home
    – music
    and all* inside LVM, so I can resize (in practice increase) them whenever I need. Even the fact that all the whole disk/LVM* is encrypted does not give me any problems.

    So, my suggestion would be: use the root partition for the system and have it the needed size (50 GiB is enough in my case) and use separate partitions for home, boot etc.

    * except for boot, because (stable) grub does not know how to boot from an encrypted LVM yet.

  3. @Evan: that’s essentially what I proposed. Problem with percentages is with small partitions it may lead to too-little reserved space.

  4. @Matija: that works for servers where a trained sysadmin takes care or partitioning, but not for a desktop. The mere vision of 4 partitions makes most users dizzy.

  5. @pgquiles:

    Dunno, I’ve done this with my desktops and laptops all my life and especially separate partitions for boot and home were a real life-saver from time to time.

    Also the LUKS+LVM combination makes me feel at least a bit safer about my laptop :]

  6. 100MB?? Well, maybe suitable for Puppy-Linux, but you can’t even install KDE…

  7. Actually, this is a common misconception. The main point of reserved space isn’t (except for the root filesystem) to make sure there’s always something left for root, but to guard against excessive fragmentation. By making a small part of free space unallocatable, there’s always a contiguous region available when needed, so you won’t end up with a single file shattered in a million pieces…

    However, I agree that perhaps a single percent could be sufficient…

    If you usually fill your FS to the brim and leave it at that, you can always reduce the reserved percentage afterwards, but I don’t think this is a common use-case…

  8. I came here just to post about fragmentation and how filling up a disk past 95% anyway is bad, but TooTea beat me to it.

  9. > Given that mkfs.ext4 defaults to 5% reserved blocks for too, that amounts to 100 GB of lost* space.

    > If you are installing a server, 5% makes perfect sense: there are a lot of logfiles, updates, potential break-ins and other disasters-to-happen for which root-reserved space will be preciously required

    It is not for log files. It is for fs to function propertly, to avoid fragmentation. 5% is not so big percent, don’t be so greedy. You don’t want to use manual defrag every month (which also won’t work good if you have more than 95% busy space).

  10. Maybe you should file that as a bug at Ubuntu (or Debian, Fedora or whatever) and see what they think of it.

  11. I have to agree with this. File bugs in the respective distributions, and see what they think. Worse case is they’ll close it. Best case is they’ll make a fixed size (say 100MB or 500MB) for the file system to handle fragmentation and such.

    Honestly, IMHO, they probably set up the percentage when disk sizes were small, and just “forgot about it” instead of changing it when disk sizes became large enough (to the point where they only needed to reserve <1% of the disk size for fs activities). This may be what they need to take a look at it, and reconfigure things in light of newer drives.

    Have a great day:)
    Patrick.

  12. Matthew W. S. Bell on Sunday 23rd January 2011 at 01:55:02 said:

    Might sending a patch to e2fsprogs not be an idea. You could specify a an absolute maximum and minimum and have a linear progression between them.

  13. “The mere vision of 4 partitions makes most users dizzy.”

    Really? What do you base this on? I think the idea of keeping system files (to use some Windows-ish terminology) and your own data in separate partitions would seem quite.

    I think that most user’s would happily not care why there is a separate /boot partition as well.

  14. Desktop users should learn more about linux then. It’s not rocket science.

  15. The reserved blocks feature only makes sense for the root filesystem and sometimes /home. Its purpose is so that if the disk is filled, root can still log in and perform administrative duties necessary to fix the problem. There’s zero point having any reserved blocks on /var, /boot, /usr, /srv/* etc. If those got full, root would still be able to log in and clean them up.

    Note that fragmentation is a red herring. While it does prevent 100% of the filesystem being used, which would lead to fragmentation, that is not its intended purpose. It can help potentially, but depending upon the usage pattern and file sizes involved, you could still end up with fragmentation anyway.

    The 5% was originally a rough heuristic, and when we had much smaller HDDs, having 20-50MiB reserved was acceptable. 100GiB is entirely overkill. It even used to reserve 5% on floppy discs–what point is there in that! IMO it should use a cleverer equation to choose the amount, and the percentage should decrease on a sliding scale as capacity increases.

    Regards,
    Roger

  16. @Roger:

    My point, exactly. To add insult to injury, I’m using this 2 TB drive as an external disk for movies, music, backups, etc, which makes the root-reserved space even more pointless.

  17. I can’t find a related option at man 5 mke2fs.conf, but you can always use the -m option on mkfs.ext* command, to set the desired reserved space, knowing the (documented on the same -m option and in comments) fragmentation issue.

  18. For media such as large films, music, etc. I’d recommend XFS.
    Leave Ext4 for the system.

  19. Don’t worry, 99% of people are not going to use Linux anyway.

  20. Sorry, reserved blocks…

  21. Thanks for the article.

    I invite you and anyone reading this to join my forum:

    http://www.puppylinuxforum.org/

    I think youll find it a refreshing change of pace.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 

Post Navigation