Disk cleanup

If you are new to Linux or new to Sabayon Linux and just not sure where to post, here ya go. Post without fear of being told to RTFM :-)

Moderator: Moderators

Disk cleanup

Postby e-hawk » Sat Jan 23, 2010 16:15

Hello!

Every time after upgrade I use equo cleanup, but recently I noticed, that free disk space suddenly reduced by approx. 600-700 Mb. I'd like to know the reason. My usual work could not use such amount of disk space and I didn't install any new packages, except usual upgrade. Any suggestions where to start?
e-hawk
Baby Hen
 
Posts: 15
Joined: Fri Dec 25, 2009 20:20

Re: Disk cleanup

Postby micia » Sat Jan 23, 2010 17:43

do you use only entropy (equo/sulfur) or you use portage too (emerge)?
micia
Sagely Hen
 
Posts: 2718
Joined: Wed Nov 26, 2008 16:41

Re: Disk cleanup

Postby e-hawk » Sat Jan 23, 2010 19:16

Just Sulphur.
e-hawk
Baby Hen
 
Posts: 15
Joined: Fri Dec 25, 2009 20:20

Re: Disk cleanup

Postby micia » Sat Jan 23, 2010 22:08

Try to execute this script:
Code: Select all
#!/bin/bash

if [ $UID -ne 0 ]; then
   echo "You have to be root in order to get better results" >&2
fi

DIRS=$(ls -m /)
DIRS=${DIRS//","/""}

for D in $DIRS; do
D=/$D
if [ -d "$D" -a "$D" != "/proc" ]; then
   USAGE=$(du -h "$D" 2>/dev/null)
   if [ $? -eq 0 ]; then
      printf "%s" "$USAGE" | grep -E '[[:space:]]'"$D"'$'
   else
      echo "Failed to get $D directory Disk Usage (probably permissions were denied)" >&2
   fi
fi
done


This is a little script I made to list the disk space occupied by each directory in /, you should execute it as root to be able to walk in any directory.

You should copy it to a text file and make it executable to run it.

You should get a result like:
Code: Select all
5,3M   /bin
13M   /boot
472K   /dev
16M   /etc
25G   /home
16K   /install-data
196M   /lib
8,0K   /media
40K   /mnt
254M   /opt
108M   /root
18M   /sbin
8,0K   /scripts
0   /sys
48K   /tmp
7,6G   /usr
1,2G   /var


The output could be useful to determine what is taking so much space...

if you run equo cleanup regularly I can only think about an installed application that installed many dependencies (like a KDE application in a Gnome system) or about logfiles growing too large.
In the second scenario you could install logrotate, that utility is awesome.
To cleanup your system you could also be interested in the:
Code: Select all
equo unusedpackages

command, it lists packages that are not dependency of any other package, but be careful, because this does not mean that they are useless.
micia
Sagely Hen
 
Posts: 2718
Joined: Wed Nov 26, 2008 16:41

Re: Disk cleanup

Postby e-hawk » Sun Jan 24, 2010 13:12

Thank you, your script worked like a charm. Logs are OK and I didn't install anything at all. Just upgrades. And I am KDE user :) I've checked almost everything right now. Now I'm checking /usr folder, and I am thinking about kernel upgrade. Could it be the reason? I see /usr/src folder (about 300 MB), is it OK? I've also noticed, that KDE cache folder is about 300 MB (home folder), but it seems inevitable.
e-hawk
Baby Hen
 
Posts: 15
Joined: Fri Dec 25, 2009 20:20

Re: Disk cleanup

Postby micia » Sun Jan 24, 2010 20:14

Try to run from a console:
Code: Select all
equo query installed linux-sabayon


it should list any kernel and kernel sources installed in your system, I think that the linux sources could take up that space, or maybe you have 2 versions of the kernel installed...

But how much space is wasted?
micia
Sagely Hen
 
Posts: 2718
Joined: Wed Nov 26, 2008 16:41

Re: Disk cleanup

Postby e-hawk » Mon Jan 25, 2010 8:47

The output is:
@@ Searching...
>> @@ Package: sys-kernel/linux-sabayon-2.6.31#2.6.31-sabayon branch: 5, [client]
>> Installed: version: 2.6.31 ~ tag: 2.6.31-sabayon ~ revision: 4
>> Slot: 2.6.31
>> Homepage: http://www.sabayon.org
>> Description: Official Sabayon Linux Standard
>> kernel image
>> License: GPL-2
>> Keyword: linux-sabayon
>> Found: 1 entries

So everything is OK, Iguess.
At least 600 MB was wasted. May be 700 MB.
e-hawk
Baby Hen
 
Posts: 15
Joined: Fri Dec 25, 2009 20:20


Return to Beginners|Newbies Area

Who is online

Users browsing this forum: No registered users and 3 guests