0

I lost hard drive space on Ubuntu 22.04 and I don't know why.

I had more than 170GB of space two days ago. I did not install anything. Today I find that I'm losing space and it's down to 0% or 1.5% sometimes.

Filesystem      Size  Used Avail Use% Mounted on
tmpfs           1.6G  2.0M  1.6G   1% /run
/dev/sda2       641G  607G  1.6G 100% /
tmpfs           7.8G   87M  7.7G   2% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
/dev/sda1       487M   33M  454M   7% /boot/efi
tmpfs           1.6G  252K  1.6G   1% /run/user/1000

Also I deleted some files and folders and I recovered more then 20GB but after restarting the PC I found just 2GB. If I open anything like Google Chrome I have 0% space.

Nmath
  • 12,333
rrr171
  • 1
  • 2
    It'd be good to see what's taking up all the space - chances are it's logs. Run sudo du -h --max-depth=1 /var/log | sort -hr and identify what directory is taking up the most space. From there, we'll start hunting deeper and deeper with this but lets start here. – Thomas Ward Nov 25 '22 at 18:30
  • Related: https://askubuntu.com/q/1167364 – Raffa Nov 25 '22 at 18:31
  • Here out put ... 295G /var/log 4.0G /var/log/journal 2.0M /var/log/installer 440K /var/log/apt 120K /var/log/unattended-upgrades 72K /var/log/dist-upgrade 44K /var/log/cups 8.0K /var/log/hp 4.0K /var/log/speech-dispatcher 4.0K /var/log/samba 4.0K /var/log/private 4.0K /var/log/openvpn 4.0K /var/log/lightdm 4.0K /var/log/gdm3 – rrr171 Nov 25 '22 at 18:34
  • Edit your post and add the info and output there, don't put it in comments – Thomas Ward Nov 25 '22 at 18:38
  • here also 291G /var/log/syslog if I delete syslog it is ok or make some things wrong in system ?! – rrr171 Nov 25 '22 at 18:38
  • @rrr171 I would do this: tail -n 500 /var/log/syslog | sudo tee -a /var/log/syslog.snip then run echo "" | sudo tee /var/log/syslog and it'l clean up your syslog. The reason I want the snippet is because if your system is generating that many log messages on a regular basis, then something's likely busted on your computer. – Thomas Ward Nov 25 '22 at 18:40
  • 2
    Once you get these commands, take the contents of /var/log/syslog.snip that we created and copy/paste the contents into your question as an edit. – Thomas Ward Nov 25 '22 at 18:40
  • Great ... Thank you .. I restore 260GB – rrr171 Nov 25 '22 at 18:42
  • 1
    @rrr171 I strongly advise you to share the log snippet I asked for - this is because we want to help you solve why your system is filling logs insanely - it's likely some errors or such we can help you solve. – Thomas Ward Nov 25 '22 at 23:27
  • Something similar to $ sudo journalctl --vacuum-time=10d - might also be in place. – Hannu Nov 26 '22 at 10:12
  • @Thomas Ward ... Yes ... I think there is some things wrong .. I'm using bitbake to compile and build Dreambox images .. and every time I restart ubuntu and try to build image I get the /var/log/syslog very large space ... How can I stop it ?!! – rrr171 Nov 28 '22 at 08:16
  • @rrr171 start by determining the errors being dropped into your syslog. You can't stop the syslog from being written to and my guess is you've got your system dumping tons of data into your syslog. Start by grabbing a snippet of the logs and including what those are here in an edit to your question like I asked for two days ago. – Thomas Ward Nov 28 '22 at 12:44
  • Sorry for late and thank you ... I think better to move to 22.10 ?!! – rrr171 Nov 28 '22 at 17:08

0 Answers0