1

I use a system with a / partition and no /home partition (I'm working on changing that) and noted that my root was rather large.

I ran the commands :
cd /
and
sudo du -sh --exclude=home

the du command returned :
26G

This struck me as odd because I remember reading that 12GB is "comfy" for the size of a root partition, given that was in regard to Ubuntu 14.something.

Am I doing something wrong? Is this related to not having a separate /home partition? Or is this normal?

  • 2
    The question is confusing. The wording implies that you are asking about the size of the root (why root?) partition, but it looks like you are more concerned about how much of it is actually used... – fkraiem Nov 12 '19 at 22:52
  • @fkraiem Sorry for any confusion, the amount of space not used by /home is abnormal. – MichaelB Nov 12 '19 at 23:19
  • The du-command you used will take all mount points in count, you only excluded your home-directory. – mook765 Nov 12 '19 at 23:38
  • 1
    You haven't given much, but 26GB is 1GB larger than the recommended minimum (https://help.ubuntu.com/community/Installation/SystemRequirements) Space is required come release-upgrade time (ie. you need to download the next releases packages, then install), let alone software you add. Yes many people use less, but it's dependent on how you use the machine (I think 26gb is a bit small myself; 32gb better; most would say it's too big - but your usage will dictate). If you won't release-upgrade (but re-install instead) less space is required; the less software you add smaller space is needed. – guiverc Nov 13 '19 at 00:35
  • Few things, first I messed up my first comments, I meant to ask if it was abnormal, not state it, second @mook765, that was the intent, to find out how big root excluding /home, third @guiverc I could be wrong, but I'm not sure that spec don't also include other things like a swap partition or home folder/partition. – MichaelB Nov 13 '19 at 01:03
  • 1
    For just /root without a separate /home partition, I would find 26GBs too tiny. With a separate /home, a decent size. Maybe even 4 or up to 14GBs more. – crip659 Nov 13 '19 at 01:11
  • Don't know if this matters, but I configure all of my virtual Ubuntu servers with a 12GB disk and the root partition is set at 4GB. /var and /var/opt are separate partitions. I rarely have problems with servers with this configuration. – doneal24 Nov 13 '19 at 02:27

1 Answers1

1

When I only exclude /home I get:

$ sudo du -sh --exclude=home
du: cannot access './run/user/1000/gvfs': Permission denied
du: cannot access './proc/14676/task/14676/fd/4': No such file or directory
du: cannot access './proc/14676/task/14676/fdinfo/4': No such file or directory
du: cannot access './proc/14676/fd/3': No such file or directory
du: cannot access './proc/14676/fdinfo/3': No such file or directory
241G    .

A more accurate picture can be seen using:

$ sudo du -sh --exclude={home,media,mnt,proc,run,sys,tmp,tmpfs,var}
13G .

There you go 13 GB for "normal" versus 241 GB for "unusually large". Of course you need to use cd / before executing above commands.

In my case most of the excess baggage is in /mnt which contains two Windows installations and two Ubuntu installations (in addition the one mounted at /).

In /run or /media you can have your phone or USB sticks mounted. In /sys and /proc there are temporary virtual file systems created. In /var there are log files which can grow quite large but are empty on new installations. In /proc lies running processes which in the first instance generate error messages but are excluded in the second instance.

Even more space can be taken off the total because I have 15 kernels installed:

$ ll /boot/vmlinuz* | wc -l
15

The kernel files can be found here:

$ sudo du -sh usr/src lib/modules boot
2.0G    usr/src
4.1G    lib/modules
1.1G    boot

The directories total 7.3 GB but there are other non-kernel files there. In reality the total is 6.5 GB:

rm-kernels total.png

Using this script: How to selectively purge old kernels all at once


Summary

This struck me as odd because I remember reading that 12GB is "comfy"

Taking everything above into account 12 GB is "comfy":

$ sudo du -sh --exclude={home,media,mnt,proc,run,sys,tmp,tmpfs,var,boot,usr/src,lib/modules}
5.6G    .

That said when today 1 TB drives are the normal HDD size and 256 GB or 512 GB is the normal SSD size, comparing 13 GB or 26 GB for a Ubuntu installation seems insignificant.

Personally on a typical 500 GB system I would allocate 400 GB to Windows (includes gaming) and 100 GB to Ubuntu (includes two or three installations).

  • I am some what confused, how is it more accurate to exclude directories (aside from home, media and mnt)? Are those not still part ofroot? – MichaelB Nov 13 '19 at 19:25
  • System log files could grow to 20gb in an extreme scenerio. Other people might vacuum journalctl down to 100 MB each month. As I mentioned my /boot is 7.5 times larger than normal. – WinEunuuchs2Unix Nov 13 '19 at 20:47