1

I have Ubuntu 20.04. And I encounter this problem very often now -low disk space in "filesystem root" sometimes it shows 635MB available, sometimes 400MB. It seems that every time I work on Ubuntu or even when I use Google Chrome, the available disk space gets reduced.My laptop has a dual booting system with linux and windows. Currently my sda9 occupies a space of 25GB. Please help!!

P.S. Someone had posted a similar question before but I couldn't get a satisfactory answer from that post, so please don't ignore this post.

Here is my output for df -h

Filesystem      Size  Used Avail Use% Mounted on
udev            3.8G     0  3.8G   0% /dev
tmpfs           784M  2.0M  782M   1% /run
/dev/sda9        25G   24G  124M 100% /
tmpfs           3.9G   17M  3.9G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/loop0       98M   98M     0 100% /snap/core/10185
/dev/loop3       61M   61M     0 100% /snap/core20/634
/dev/loop1       98M   98M     0 100% /snap/core/10444
/dev/loop2       56M   56M     0 100% /snap/core18/1932
/dev/loop4       62M   62M     0 100% /snap/core20/875
/dev/loop5       56M   56M     0 100% /snap/core18/1885
/dev/loop6      163M  163M     0 100% /snap/gnome-3-28-1804/145
/dev/loop8       65M   65M     0 100% /snap/gtk-common-themes/1514
/dev/loop11     218M  218M     0 100% /snap/gnome-3-34-1804/60
/dev/loop10      50M   50M     0 100% /snap/snap-store/467
/dev/loop13      52M   52M     0 100% /snap/snap-store/498
/dev/loop15     180M  180M     0 100% /snap/telegram-desktop/2185
/dev/loop7       65M   65M     0 100% /snap/gtk-common-themes/1513
/dev/loop14     179M  179M     0 100% /snap/telegram-desktop/2198
/dev/loop12     261M  261M     0 100% /snap/kde-frameworks-5-core18/32
/dev/loop9      256M  256M     0 100% /snap/gnome-3-34-1804/36
/dev/sda1       746M   73M  674M  10% /boot/efi
tmpfs           784M   32K  784M   1% /run/user/1000
Pilot6
  • 90,100
  • 91
  • 213
  • 324
  • 3
    Please add output of df -h to your question. – Pilot6 Dec 15 '20 at 17:55
  • Yes, I have added the output. – Nova Stark Dec 15 '20 at 18:04
  • 1
    So your partition is really full. Maybe remove old kernels by sudo apt autoremove. But you need to get more space. – Pilot6 Dec 15 '20 at 18:05
  • Okay I did that. Does this have anything to do with my google chrome? Because everytime I use it the same message pops up with reduced disk space in filesysytem root. – Nova Stark Dec 15 '20 at 18:08
  • @Pilot6, One more thing, my df -h output is still the same there's no difference even after using sudo apt autoremove command. – Nova Stark Dec 15 '20 at 18:12
  • this can help you detect what is consuming space the most. – Raffa Dec 15 '20 at 18:13
  • Thank you so much @Raffa that was really helpful, snapd was consuming a lot of of space so I removed it. – Nova Stark Dec 15 '20 at 18:32
  • @Raffa, now my df -h output looks like this : Filesystem Size Used Avail Use% Mounted on udev 3.8G 0 3.8G 0% /dev tmpfs 784M 2.0M 782M 1% /run /dev/sda9 25G 22G 2.6G 90% / tmpfs 3.9G 32M 3.8G 1% /dev/shm tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup /dev/sda1 746M 73M 674M 10% /boot/efi tmpfs 784M 32K 784M 1% /run/user/1000 – Nova Stark Dec 15 '20 at 18:35
  • OK. snapd is needed for snap store and the functionality of apps installed from snap might be affected negatively this way. Here is what I recommend in this case follow instructions here to remove snap store and install Ubuntu Software then reinstall apps from Ubuntu Software if needed. – Raffa Dec 15 '20 at 18:44
  • 1

3 Answers3

2

Since you are running Chrome, I infer you are running a Desktop version of Ubuntu and have an unpriv'd user you web browse, run applications, and sudo from for administrative purposes.

What I don't see is a separate user partition mounted on /home to keep user data from running the OS out of disk space. 24G is not all that much for a desktop environment. If the OS has to share it with users, you will eventually run your OS out of disk space - something you want to avoid. But to the immediate problem...

Let's be sure we know where the problem is. Please post the results of sudo du -sh /home. If this is a significant chunk of your 25G, then ...

Use sudo find /home -size +2G to locate big files in your user space. Keep reducing the size parameter and eliminating any files you can live without. If you are like most of us, you likely have a few downloaded ISOs lying around. If you are saving significant video or picture files - 25G will not go very far - you'll need another hard drive.

In the event that the /home space is NOT the culprit, you can scan the whole system from the top using sudo du -sk /* 2>/dev/null | sort -nk1. Find the top space eater and scan it's subfolders eliminating what you can as you go.

Good Luck, Nova

Frobozz
  • 689
  • Having a separate partition for /home in no way increases the amount of disk space available. If overall disk space is limited, having separate partitions only adds artificial limitations on available space for each partition. In practice, having separate partitions actually results in less available space. OP seems to already struggle with this over-partitioning problem since Ubuntu is on the 9th partition... If 25GB of space is not enough, OP should expand this partition if possible. If not possible, the disk should be formatted with a larger partition for Ubuntu. – Nmath Dec 15 '20 at 20:06
  • I agree with the conclusion that 25GB is really not enough space for a typical Ubuntu desktop user. But instead of fracturing the drive into more rigid partitions, we should find out why OP already has at least 9 partitions on this disk and see if any of these artificial limitations imposed by partitioning are really necessary. Windows will have 4 partitions on its own. Ubuntu only needs one. What is the purpose of the remaining 4 partitions? – Nmath Dec 15 '20 at 20:11
  • Yeah, I notice the sda9. If I wasn't clear, I think an additional physical disk for /home is what I'd want. But let's stay focused on the question asked - where is the space on the existing partition being consumed. – Frobozz Dec 15 '20 at 20:12
  • @Frobozz This is what I got from sudo du -sh /home : 8.5G /home – Nova Stark Dec 16 '20 at 06:13
  • Yeah, that is a third of your space right there under /home. But your OS still seems a little fat also. Use the du and find commands above and track down some files you can purge. – Frobozz Dec 20 '20 at 17:49
0

You could try to analyze what takes so much space on your partition that is relatively small to begin with. One tool for that is Duc. You may find some media files you can remove by your file manager, for instance.

There may be some software installed that you do not need, but you should uninstall them properly using some package management tools, if needed. Ubuntu desktop depends on some software, that you should not uninstall, if you wish to continue using the default Ubuntu distribution, but you could uninstall some packages listed as "Recommends:" by apt-cache depends ubuntu-desktop. For example sudo apt autoremove rhythmbox. Do not touch the packages marked with "Depends:" of ubuntu-desktop. There may also be some packages that you installed by yourself afterwards that you do not need anymore.

Maybe you could consider getting a bigger partition for Ubuntu or separate partition for data?

Or you could consider switching from the default Ubuntu to a light-weight Linux distribution; there are many ubuntu based ones available.

jarno
  • 5,600
0

I have a solution which is 100% worked for me... Under var/log, two log files named kernel.log and syslog.log are steadily growing in size, and /cow (dirty copy-on-write) is full, preventing the installation from running due to a lack of disk space. df -kh [/cow --- increased and full] so 1st systemctl stop syslog.socket cd /var/log rm -rf *

Then you'll be able to successfully set up os.

  • Don't delete log files in this way. It may disturb running application. If you for some reason want to trim your log directory you may use, e.g., find /var/log/ -name '*.gz' -delete, you may also empty log files with > /var/log/logfile.log or truncate -s 0 logfile.log. –  Jun 23 '21 at 20:44