Score:0

Lost hard drive space

gr flag

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.

ru flag
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.
Raffa avatar
jp flag
Related: https://askubuntu.com/q/1167364
rrr171 avatar
gr flag
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 `
ru flag
Edit your post and add the info and output there, don't put it in comments
rrr171 avatar
gr flag
here also `291G /var/log/syslog` if I delete syslog it is ok or make some things wrong in system ?!
ru flag
@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.
ru flag
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.
rrr171 avatar
gr flag
Great ... Thank you .. I restore 260GB
ru flag
@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.
Hannu avatar
ca flag
Something similar to `$ sudo journalctl --vacuum-time=10d` - might also be in place.
rrr171 avatar
gr flag
@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 ?!!
ru flag
@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.
rrr171 avatar
gr flag
Sorry for late and thank you ... I think better to move to 22.10 ?!!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.