[SOLVED] How to free disk space in Root partition?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
Pangolin
Level 3
Level 3
Posts: 133
Joined: Sat Sep 12, 2015 4:16 pm

[SOLVED] How to free disk space in Root partition?

Post by Pangolin »

Hi guys.
I'm running LM 18.1 Cinnamon and my system has 2 partitions: 20gb root and 100gb home.
Now my root is 95% used and I keep receiving alerts about that.
I noticed that in /var/log there is a 9gb bunch of stuff: nearly half the size of the whole partition...
Is there a safe way to free some space whitin the /var/log folder?
I really don't want to break my system because I need it for work.
Thank you.
Last edited by Pangolin on Fri Nov 30, 2018 9:41 am, edited 1 time in total.
I'm here thanks to Windows 10
User avatar
kc1di
Level 16
Level 16
Posts: 6407
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: How to free disk space in Root partition?

Post by kc1di »

Hi,
This article may be of help: https://www.omgubuntu.co.uk/2016/08/5-w ... -on-ubuntu
on top of that I use ubuntu-cleaner found here: https://www.omgubuntu.co.uk/2016/12/fre ... anitor-app
It will also clean old kernels I usually leave just the last two on my machines.
Good Luck.
Easy tips : https://easylinuxtipsproject.blogspot.com/ Pjotr's Great Linux projects page.
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
georap
Level 1
Level 1
Posts: 9
Joined: Wed Aug 14, 2013 3:57 pm

Re: How to free disk space in Root partition?

Post by georap »

Hi Pangolin,

I just came across the same discussion in another topic category of the forum. gm10's response might help you.

viewtopic.php?f=6&t=282425#p1558469

Cheers!
Pangolin
Level 3
Level 3
Posts: 133
Joined: Sat Sep 12, 2015 4:16 pm

Re: How to free disk space in Root partition?

Post by Pangolin »

Thanks for your advice guys.
I think I've spotted the problem: inside my /var/log directory there is a monster 8.4 gb file named "syslog.1" :shock:
Why is it so big and how to keep it at a reasonable size?
Is it safe to delete it?
I'm here thanks to Windows 10
User avatar
kc1di
Level 16
Level 16
Posts: 6407
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: How to free disk space in Root partition?

Post by kc1di »

you can clear that log with the following commands,

Code: Select all

sudo su

Code: Select all

> /var/log/syslog.1
if it is continually filling up though there is something in the boot process that is being logged that either because of an error or somehow logging for that item got turned on. You may want to research what is being logged.

I know some folks were having problems with Pulse audio awhile back creating hughe log files. not sure that is your problem though.
Easy tips : https://easylinuxtipsproject.blogspot.com/ Pjotr's Great Linux projects page.
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
Pangolin
Level 3
Level 3
Posts: 133
Joined: Sat Sep 12, 2015 4:16 pm

Re: How to free disk space in Root partition?

Post by Pangolin »

kc1di wrote:
Fri Nov 30, 2018 9:27 am
you can clear that log with the following commands,
That did the trick!
Applied your instructions: syslog file emptied, 8.4 gbs freed on my root partition and everything is working fine :D
Thank you so much kc1di
I'm here thanks to Windows 10
ajgreeny
Level 5
Level 5
Posts: 704
Joined: Mon Nov 19, 2007 3:27 pm

Re: [SOLVED] How to free disk space in Root partition?

Post by ajgreeny »

So you have now removed that huge syslog.1 file but you did not say whether or not you looked in it to see if it held any clues as to why it was so huge.

My syslog files never seem to be larger than around 500Kb so an 8Gb file is very strange and I believe something must be wrong in your system. Keep a close eye on it in future and open it before deleting it next time to see what it contains; that may give a clue about why it is growing so big and allow you to put that right.
Pangolin
Level 3
Level 3
Posts: 133
Joined: Sat Sep 12, 2015 4:16 pm

Re: [SOLVED] How to free disk space in Root partition?

Post by Pangolin »

ajgreeny wrote:
Fri Nov 30, 2018 11:10 am
So you have now removed that huge syslog.1 file but you did not say whether or not you looked in it to see if it held any clues as to why it was so huge.
:roll: uhmmm... yes, that's what I have done rushing in almost carelessly :oops:
It would have been better if I had a look at the log file before flushing the content.
I will be monitoring it in the following days and see if something strange gets recorded.
Thank you ajgreeny.
I'm here thanks to Windows 10
gm10
Level 20
Level 20
Posts: 10999
Joined: Thu Jun 21, 2018 5:11 pm

Re: [SOLVED] How to free disk space in Root partition?

Post by gm10 »

Pangolin wrote:
Fri Nov 30, 2018 11:50 am
ajgreeny wrote:
Fri Nov 30, 2018 11:10 am
So you have now removed that huge syslog.1 file but you did not say whether or not you looked in it to see if it held any clues as to why it was so huge.
:roll: uhmmm... yes, that's what I have done rushing in almost carelessly :oops:
It would have been better if I had a look at the log file before flushing the content.
It's ok, syslog.1 is yesterday's archived log. If syslog itself isn't exploding then your issue went away. If it didn't, then you can just check today's log. You also still have the log from 2 days ago (which is compressed so it won't appear that large even when it actually might be) - to read that one: zless /var/log/syslog.2.gz.
ajgreeny
Level 5
Level 5
Posts: 704
Joined: Mon Nov 19, 2007 3:27 pm

Re: [SOLVED] How to free disk space in Root partition?

Post by ajgreeny »

If the syslog file grows to several Gb again I think you will find it difficult to open in any text editor, even less in command line but you should be able to look at the final lines with

Code: Select all

tail -n 50 /var/log/syslog
You can change the number of lines to view by changing the figure in the command.
Post Reply

Return to “Installation & Boot”