10

The system gives me the following error:

The volume "Filesystem Root" has only 713.9 MB disk space remaining. You can free up disk space by removing unused programs or files, or moving files to another disk or partition.

My question is, which files and from where should I move? How to not get the error any more?

I purged an old kernel [3.13.0.45] some time back and now have two kernels [3.17 & 3.8]. I had to purge 3.13 because incidentally, the free space in the error as shown above had become 0 bytes and the shutting down process too could not happen properly.

Results of df -Th

Filesystem     Type      Size  Used Avail Use% Mounted on
/dev/sda6      ext4       19G   17G  601M  97% /
none           tmpfs     4.0K     0  4.0K   0% /sys/fs/cgroup
udev           devtmpfs  1.9G  4.0K  1.9G   1% /dev
tmpfs          tmpfs     386M  1.2M  385M   1% /run 
none           tmpfs     5.0M     0  5.0M   0% /run/lock
none           tmpfs     1.9G  188K  1.9G   1% /run/shm
none           tmpfs     100M   76K  100M   1% /run/user
/dev/sda5      ext4      453M  193M  233M  46% /boot
/dev/sda7      ext4       92G  788M   87G   1% /home

Here is the disk Analysis:

--- /------------------------
12.7GiB /usr                     
2.7GiB  /lib
1.2GiB  /var
877.9MiB  /home
190.4MiB  /boot
12.4MiB  /etc
11.9MiB  /sbin
9.6MiB  /bin
1.3MiB  /run
324.0KiB  /root
20.0KiB  /tmp
16.0KiB  /lost+found
12.0KiB  /media
4.0KiB  /dev
4.0KiB  /lib64
4.0KiB  /srv
4.0KiB  /opt
4.0KiB  /mnt
4.0KiB  /cdrom
0.0  B  /proc
0.0  B  /sys
0.0  B  initrd.img.old
0.0  B  vmlinuz.old

In usr/:

10.1GiB /src
1.4GiB  /lib
1.0GiB  /share
100.6MiB  /bin
14.4MiB  /sbin
9.6MiB  /include
520.0KiB  /games
112.0KiB  /local

In src/:

9.9GiB  /linux-3.17.6
94.1MiB  /linux-headers-3.13.0-45
90.4MiB  /linux-headers-3.8.0-29
13.8MiB  /linux-headers-3.13.0-45-generic
12.1MiB  /linux-headers-3.8.0-29-generic

Please help.

  • 1
    You have 601MB of free space on /, and 233MB of free space on /boot, where the kernel images are. It's completely normal for you to have more than kernel version, so you can select an older version at boot. What is your question? – jmiserez Feb 15 '15 at 09:15
  • 2
    The system gives me an error: The volume "Filesystem Root" has only 713.9 MB disk space remaining. You can free up disk space by removing unused programs or files, or moving files to another disk or partition. My question is, which files and from where should I move? How to free the root filesystem even more? – complextea Feb 15 '15 at 09:25
  • " My question is, which files and from where should I move? How to free the root filesystem even more?" you should know what you put where that is not part of the operating system. 17G is a lot... more than 3 times what I -ever- have had in my / for at least 10 years. Are you running MySQL on this machine? – Rinzwind Feb 15 '15 at 09:41
  • I've updated my answer. Now it includes basically everything you can possibly do to free space. And I agree with @Rinzwind, something is probably eating up disk space without your knowledge. – jmiserez Feb 15 '15 at 10:09
  • @Rinzwind No, I do not have MySQL on my machine. But, I've updated my question with a detailed analysis of the disk space. Please have a look. ~10G has been used by the current kernel itself. The one that I most recently downloaded and recompiled. – complextea Feb 15 '15 at 10:52
  • I do not like ./src. du -ks src shows me 795632 src. What is that 3.17 there? I have 3.16 as highest and am on 14.10. – Rinzwind Feb 15 '15 at 11:14
  • I downloaded the latest kernel source code [3.17] and made the system go through the recompilation process. Initially it was 3.8 & 12.04, then I upgraded to 14.04 when the kernel was automatically upgraded to 3.13 I guess. But for some reasons I needed 3.17, So, I did 3.17 and purged 3.13 later. – complextea Feb 15 '15 at 11:36
  • 1
    Well that is your problem right there. How could you not notice? Get rid of /usr/src and use the precompiled kernel provided by the repository. Compiling the kernel is not something normal users should need to do. If you really insist on compiling your own kernel (and have the necessary expertise to fix things) you should do that in your home directory. See here for more: http://askubuntu.com/questions/115955/compile-linux-source-in-home – jmiserez Feb 15 '15 at 12:42
  • Okay, thanks, I'll try doing that. Didn't know we could compile in the home directory and then I will have to only install as root, right? – complextea Feb 16 '15 at 06:45
  • Yes, but you don't actually need to compile the kernel yourself. You can get (unsupported) .deb files for Ubuntu here, see here and here for more info and instructions. Also read this. Note that if you really want a version >= 3.17, the 3.17.0 release is outdated, you should use a newer version (at least 3.17.8). – jmiserez Feb 16 '15 at 07:14

1 Answers1

5

First, you should check what's using up all that space with the "Disk Usage Analyzer" tool that ships with Ubuntu.

From a terminal, run:

gksudo baobab /

That should give you an idea of what uses so much space. Then:

  • Check how much space /root uses. Usually it should be less than 1MB. If you have anything larger in there, move it to your /home.

  • Check how much space /tmp uses. If it is more than a few MB, reboot your system. /tmp is cleared on every reboot but can fill up over time.

  • Check other folders such as /opt, and check if you put any large files there or if there are any large files that do not belong to a package. Some installers will install stuff into /opt and never remove it. Be careful when doing this.

  • Run sudo apt-get clean. That should remove a lot of stuff in the package cache. On my system running apt-get clean got rid of about 1.5GB of old downloaded packages that are not needed.

  • Reduce the size of the reserved space on /dev/sdb6. Usually 5% are reserved for the root user in case you fill up the system and need to log in as root user in an emergency. The default of 5% means 1GB on your system, you can safely reduce that to 1% (200MB) using tune2fs:

    $ sudo tune2fs -m 1 /dev/sda6
    tune2fs 1.42.9 (4-Feb-2014)
    Setting reserved blocks percentage to 1%
    
  • Uninstall some packages using sudo apt-get remove. Small tip if you use LaTeX: One of the major space wasters is usually the texlive-full metapackage. It installs gigabytes worth of documentation and other stuff, although you usually don't need it all at once. Installing texlive instead will pull in just the minimum, and download the rest when it's needed.


If you are still running out of space, as an absolute last resort you can:

  • Resize the /dev/sda6 partition (make it bigger) and shrink the /dev/sda7 partition using a Live CD and GParted. This could take a while and it's very easy to destroy your data, so you absolutely need to make a full backup beforehand. See this question for more detail about resizing partitions.

I would recommend against this though, as 20GB should be plenty of space for most scenarios, and you there is a real chance of data loss when resizing partitions.

jmiserez
  • 4,964
  • Regarding the last one: that I would not do. 17Gb used is a lot for as root. Something is amiss: user probably put his personal files in / somewhere and not in /home/. – Rinzwind Feb 15 '15 at 09:42
  • @Rinzwind You are right, I added a small note regarding that. – jmiserez Feb 15 '15 at 10:04
  • How do I check the contents of /root? I can't view it through GUI and neither do I see anything after I do ls through terminal as root. – complextea Feb 15 '15 at 10:22
  • Also, my gksu baobab/ shows nothing. – complextea Feb 15 '15 at 10:22
  • 1
    @HobbitEesmereldatGoldworthy You are missing a space between baobab and /! If you need a terminal based tool (non-GUI), install ncdu and run sudo ncdu /. – jmiserez Feb 15 '15 at 10:30
  • Yes @jmiserez, I've updated my question with the analysis. PLease have a look. And I don't have LaTeX right now on my system. – complextea Feb 15 '15 at 10:48
  • The baobab tool just showed my /root contains 4 GB, mostly some old Matlab installer which was obviously handled as root for some reason. After I deleted it, the /root is only 190 MB. – Danijel Jun 22 '22 at 08:02