My Ubuntu installation has a root of 16 Gb. But it keeps on complaining it runs out of space. I have looked at the installed software and found LibreOffice. I performed a remove and purge of LibreOffice. But a few days later (as in today) it complained again it runs out of space.
I checked the used space again, and found out LibreOffice is still installed.
Am I correct, LibreOffice got installed again? And what can I do to permanently remove LibreOffice?
ogra
2
I have moved your post to the help category (project discussion is not really for support questions)
Why are you looking at the /lib
folder ? This is very unlikely to be the one where your space gets actually eaten up, the contents in there are rather static and do not change at runtime, move a level up and check which folder of your /
takes up most space, then move into that one to get a more detailed view.
You see that LibreOffice takes relatively little space, and will not be the main issue why your root is running full.
If you remove a program, it will not automatically be installed again. My guess is that you removed a version installed as a snap, and that a version installed as an APT package (.deb) is still on the system. So remove it using the Ubuntu Store, or the “apt remove” command.
There are many, many possibilites about what might be eating storage space. Depends upon your usage.
Check first: One common system storage eater is a runaway log file or journal file. This is worth checking early, as the space problem is a mere symptom. Fixing the actual underlying problem is essential.
Here, you can see that logfiles should be only a few KB or MB. If yours are consuming GB, that indicates a system problem that needs to be fixed.
$ ls -lah /var/log/syslog*
-rw-r----- 1 syslog adm 135K Jun 1 08:15 /var/log/syslog
-rw-r----- 1 syslog adm 9.6M Jun 1 00:15 /var/log/syslog.1
-rw-r----- 1 syslog adm 1.4M May 25 06:28 /var/log/syslog.2.gz
-rw-r----- 1 syslog adm 608K May 18 17:39 /var/log/syslog.3.gz
-rw-r----- 1 syslog adm 1.1M May 12 07:49 /var/log/syslog.4.gz
If you do have a runaway log file, stop here. Read a segment of the log and fix the problem.
Check second: Even if there is no problem, your journal might have grown.
Here you can see one method of checking and controlling your journal file…
$ journalctl --disk-usage
Archived and active journals take up 2G in the file system.
$ sudo journalctl --vacuum-time=2d
[sudo] password for user:
Vacuuming done, freed 1.9G of archived journals from /var/log/journal/4d6630d374204c21b1c9214bbaedff4b.
$ journalctl --disk-usage
Archived and active journals take up 72M in the file system.
Check third: Common storage-eaters in your /home might include movies, browser downloads, and email attachments. Those can really add up over time quietly. Many users can get the fastest benefit by weeding these. The tool you are already using, Disk Usage Analyzer, is a great help.
Software packages rarely consume enough space to be noticeable. Removing them is easy enough, but it’s rarely an effective solution.
1 Like
Your 16GB is not particularly large for a full install of Ubuntu. Does that include /home?
I have seen users with snaps alone taking 20GB in /(root). I use Kubuntu which is not quite as large and it uses 12Gb with no snaps installed and all my data in separate partitions. And often after I install a few more apps, I get close to 20GB.
Post this:
lsblk -f
If your root partition contains also home did you check the firefox cache?
We don’t know your current disk partitioning. You may be able to simply enlarge the root partition (or root logical volume, if LVM is used), and I would agree that 16 gB is too small nowadays, especially if you use snaps and/or flatpaks. You should plan for an extra 6-8 GB when initially allocating space if you use them.
RobG
8
Ubuntu has some great built in tools to help you see what’s using up disk space one that comes to mind is Disk analyzer, once you run it, it will allow you to click on things like the Home folder and give you a read out on what’s using up space on your machine
There are obviously commands you can run that will do the same
Command: du
Find out which directories take up the most space
RUN: sudo du -h --max-depth=1 /
Will give you a more in-depth View
Hope this helps
My /home got it’s own partition.
Some output:
sudo du -h --max-depth=1 / > du.log
[BEGIN]
2.0T |
/home |
4.0K |
/sbin.usr-is-merged |
2.1T |
/media |
2.5M |
/root |
0 |
/sys |
0 |
/proc |
2.6M |
/run |
5.7G |
/var |
4.0K |
/bin.usr-is-merged |
132M |
/boot |
4.0K |
/cdrom |
16K |
/lost+found |
4.0K |
/opt |
5.9G |
/usr |
20M |
/etc |
0 |
/dev |
4.0K |
/lib.usr-is-merged |
4.0K |
/srv |
192K |
/tmp |
4.0K |
/mnt |
7.3G |
/snap |
4.1T |
/ |
[END] |
|
lsblk -f:
[BEGIN]
sdb
├─sdb1
│ ext4 1.0 9ce726fa-17d9-4710-8ad8-fee5eeee1c22 1.3G 86% /
├─sdb2
│ vfat FAT32 2DC1-3B56 1G 1% /boot/efi
├─sdb3
│ ext4 1.0 f2005f04-471a-4d16-9afa-83642e21c248 856.8M 0% /tmp
└─sdb4
ext4 1.0 13dd1214-99fe-4241-81fa-c9de4bb67b19 1.4T 55% /home
[END]
If my conclusion is correct, my Root partition has now 1.3G space available. So something went right yesterday.
RobG
10
Seems to be accurate from what I see
If I may ask how large is the drive you’re using in this machine? just wondering
What is the output of:
sudo du -sh /var
Thanks
6Gb seems like a lot…
sudo du -sh /var
[sudo] password for macamba:
5.8G /var
I created a root partition (/) off 16G. I thought to make it the same as my RAM memory.
The root file system aka /
holds the OS. If you have other file systems as other directories then fine but 16Gb sounds quite trim.
I have /tmp and /home on other partitions.
I will come back on the output off
cd /var; sudo du -sh *
ogra
17
16GB is definitely not enough for a usable system where you will have some software installed beyond the basic OS.
I’m curious what made you make that weird relation to your RAM ? The rootfs has definitely nothing to do with RAM at all, did any tutorial make such a suggestion (perhaps they typoed “swap” space for “rootfs”) ?
It is also not really clear what you want to achieve with putting /tmp on a separate partition, this seems like a rather pointless thing and just wastes space…
Given you have a rather comfortable 1.5TB disk there I’d consider rethinking your partitioning scheme and at least resize your root partition to something like 256GB so that you can actually install some applications and have some room for application data, caches and the like.
If you keep it like it is now you will constantly have to fix issues …
3 Likes
We have /tmp mounted noexec on our servers for security. One use case I know of. For home use it’s probably not needed to be on its own file system
The output of cd /var; sudo du -sh *
[sudo] password for macamba:
5.0M backups
209M cache
4.0K crash
4.7G lib
4.0K local
0 lock
475M log
4.0K mail
4.0K metrics
4.0K opt
0 run
8.1M snap
40K spool
92K tmp
I have had no problems anymore. So I hope I am in the clear. In the past, with the same configuration, I never had problems with running out of space.
Anyone know what command I need to use to get the space usage picture I used in my post?
I use this pydf
, Example Here:
pydf
Filesystem Size Used Avail Use% Mounted on
rpool/ROOT/ubuntu_vlh2n7 208G 11G 197G 5.3 [........] /
bpool/BOOT/ubuntu_vlh2n7 1706M 110M 1596M 6.4 [#.......] /boot
/dev/sdc1 1073M 6280k 1067M 0.6 [........] /boot/efi
rpool/USERDATA/home_1fz33l 207G 10G 197G 4.7 [........] /home
/dev/sde1 916G 714G 155G 78.0 [######..] /media/me/EDIL-Backup
rpool/USERDATA/root_1fz33l 197G 1664k 197G 0.0 [........] /root
/dev/keystore/rpool 3824k 28k 3512k 0.7 [........] /run/keystore/rpool
rpool/ROOT/ubuntu_vlh2n7/srv 197G 256k 197G 0.0 [........] /srv
efivarfs 148k 140k 3256B 94.5 [########] /sys/firmware/efi/efivars
tank 692G 508G 184G 73.5 [######..] /tank
rpool/ROOT/ubuntu_vlh2n7/usr/local 197G 512k 197G 0.0 [........] /usr/local
rpool/ROOT/ubuntu_vlh2n7/var/games 197G 256k 197G 0.0 [........] /var/games
rpool/ROOT/ubuntu_vlh2n7/var/lib 199G 1720M 197G 0.8 [........] /var/lib
rpool/ROOT/ubuntu_vlh2n7/var/lib/AccountsService 197G 256k 197G 0.0 [........] /var/lib/AccountsService
rpool/ROOT/ubuntu_vlh2n7/var/lib/NetworkManager 197G 384k 197G 0.0 [........] /var/lib/NetworkManager
rpool/ROOT/ubuntu_vlh2n7/var/lib/apt 198G 107M 197G 0.1 [........] /var/lib/apt
rpool/ROOT/ubuntu_vlh2n7/var/lib/dpkg 198G 126M 197G 0.1 [........] /var/lib/dpkg
rpool/ROOT/ubuntu_vlh2n7/var/log 198G 210M 197G 0.1 [........] /var/log
rpool/ROOT/ubuntu_vlh2n7/var/mail 197G 256k 197G 0.0 [........] /var/mail
rpool/ROOT/ubuntu_vlh2n7/var/snap 197G 256k 197G 0.0 [........] /var/snap
rpool/ROOT/ubuntu_vlh2n7/var/spool 197G 384k 197G 0.0 [........] /var/spool
rpool/ROOT/ubuntu_vlh2n7/var/www 197G 256k 197G 0.0 [........] /var/www
And I forgot ncdu
sudo ncdu /root
--- /root ----------------------------------------------------------------------------------------------------
1.1 MiB [###############] /.cache
27.0 KiB [ ] /.local
18.0 KiB [ ] /.config
10.0 KiB [ ] /.ssh
e 9.0 KiB [ ] /snap
5.0 KiB [ ] .bashrc
5.0 KiB [ ] .bash_history
5.0 KiB [ ] .profile
1 Like