Page 1 of 2

My Mandriva home is full!

Posted: 01 Mar 2012, 14:31
by viking60
Ok so my Mandriva home is full again. What are the best superduper commands to sort find and fix junk? I have 380 Gigs of it so I suspect there is something wrong with a backup location or something.
Edit:
I guess finding anything over 1G in /home will get me started:

Code: Select all

 sudo find /home -name '*' -size +1G

Re: My Mandriva home is full!

Posted: 01 Mar 2012, 15:40
by R_Head
How did you get that much gunk there? Never had that issue.
My Home dir is getting full of the wife's photos that she takes.
About 20 GB worth!

Re: My Mandriva home is full!

Posted: 01 Mar 2012, 16:06
by rolf
I think you must have already fixed it but, for the sake of tweaking, another strategy is 'du', with amendments:

Code: Select all

$ du -b -d 2 /download/ | sort -nr | less

TFM is your friend!
  • The -b switch tells du to output size in bytes, which makes 'sort', later on, more useful.
  • -d or --max-depth=N controls how far 'du' recurses into the filesystem in reporting size, which is all the way by default. This can help shorten the list at first pass, to get something of an overview.
  • /download is the point in the filesystem where du starts working.
  • | is a pipe symbol, which takes the output of the command before this symbol and feeds it to the command after.
  • -n tells sort to do a numeric sort.
  • -r reverses the sort order, putting big numbers at the top, which is more interesting to us in this case.
  • less is a 'pager', giving results one screen at a time, so we don't have to scroll back through a giant list. It might work as well to leave off -r and | less, leaving us at the end of the list with the big boys.

Code: Select all

944253755630    /download/
777929867956    /download/video
208069803822    /download/video/columbo
98808854316     /download/video/perry_mason
97488661561     /download/kaffeine
59470869677     /download/video/jeeves+wooster
55321416479     /download/video/morse
51200928016     /download/video/lecarre
50451339250     /download/video/miss_marple
45667377598     /download/video/inspector_lewis
33313712382     /download/video/bean
29742463444     /download/video/riding_giants
28477101876     /download/video/louis_ck
22220410754     /download/video/fawlty
16668411225     /download/video/bourne
14659705469     /download/mageia
12893609767     /download/mandriva
12657137955     /download/video/poirot
10783342176     /download/cooker
9386024710      /download/video/com_of_com
8423369480      /download/video/sherlock_holmes
8329954605      /download/mandriva/2011
8087655685      /download/video/k_madigan
7846703184      /download/video/com_cen
7325461916      /download/video/bill_burr
4715575179      /download/humblebundle
4563655066      /download/mandriva/2010.2
lines 1-27

Armed with the general location of high disk usage, we can use a more pinpointed starting directory in the filesystem as the argument to du.
kdirstat.sourceforge.net/
Sep 1, 2006 – KDirStat is a graphical disk usage utility, very much like the Unix "du" ... While KDirStat is a KDE program, it runs fine on every X11 desktop,

It was in Mandriva, not too long ago but I don't see it now. Pretty cool gui du... :confused
Similar, still around:

Code: Select all

$ urpmq -i filelight

Name        : filelight
Version     : 4.6.5
Release     : 2.2
Group       : Graphical desktop/KDE
Size        : 523768                       Architecture: x86_64
Source RPM  : kdeutils4-4.6.5-2.2.src.rpm
URL         : http://utils.kde.org/projects/filelight/
Summary     : Graphical disk usage statistics
Description :
Filelight allows you to quickly understand exactly where your
diskspace is being used by graphically representing your file
system as a set of concentric segmented-rings. You can use it
to locate hotspots of disk usage and then manipulate those
areas using a file manager.

Image

Re: My Mandriva home is full!

Posted: 01 Mar 2012, 19:59
by viking60
rolf wrote:I think you must have already fixed it but, for the sake of tweaking, another strategy is 'du', with amendments:

Code: Select all

$ du -b -d 2 /download/ | sort -nr | less


I cannot get this to work with the -d switch?
Edit:
Great info there rolf this works perfectly fine:

Code: Select all

du -b /download/ | sort -nr | less

It will help a lot in finding the "sinners"
In the meantime I found out that I have a lot of Linux isos so I isolated them:

Code: Select all

sudo find /home -name '*.iso' -size +1G

Code: Select all

/home/thomas/Nedlasting/mageia-dvd-1-x86_64.iso
/home/thomas/Nedlasting/PCBSD9.0-RC1-x86-DVD.iso
/home/thomas/Nedlasting/livedvd-amd64-multilib-10.1.iso
/home/thomas/Nedlasting/mandriva-linux-pwp-2010.0-x86_64.iso
/home/thomas/Nedlasting/Mandriva.2011-beta3.x86_64/Mandriva.2011-beta3.x86_64.iso
/home/thomas/Nedlasting/Mandriva.2011.x86_64.1.iso
/home/thomas/Nedlasting/linuxmint-12-gnome-dvd-32bit.iso
/home/thomas/Nedlasting/mandriva-linux-free-2010.0-x86_64/mandriva-linux-free-2010.0-x86_64.iso
/home/thomas/Nedlasting/Fedora-15-Beta-i386-DVD.iso
/home/thomas/Nedlasting/mandriva-linux-pwp-2010.0-i586.iso
/home/thomas/Nedlasting/mandriva-linux-pwp-2010-spring-x86_64/mandriva-linux-pwp-2010-spring-x86_64.iso
/home/thomas/Nedlasting/mageia-dvd-1-Alpha2-x86_64.iso
/home/thomas/Nedlasting/Mandriva.2011-rc1.x86_64.iso
/home/thomas/Nedlasting/mandriva-linux-free-2010.2-i586.iso
/home/thomas/Nedlasting/openSUSE-11.3-DVD-i586.iso
/home/thomas/Nedlasting/CentOS-5.4-x86_64-bin-DVD/CentOS-5.4-x86_64-bin-DVD.iso
/home/thomas/Nedlasting/Mandriva.2011.RC2.i586.42.iso
/home/thomas/Nedlasting/openSUSE-11.2-DVD-x86_64.iso
/home/thomas/Nedlasting/chakra-dvd-i686-091116-alpha4.iso
/home/thomas/Nedlasting/Fedora-12-Beta-x86_64-DVD/Fedora-12-Beta-x86_64-DVD.iso
/home/thomas/Skrivebord/Nedlasting/mandriva-linux-free-2010.0-x86_64/mandriva-linux-free-2010.0-x86_64.iso

Re: My Mandriva home is full!

Posted: 01 Mar 2012, 23:22
by dedanna1029
Edited to correct code, and link to it.

There is also this:

Code: Select all

du -akx /home/youruser | sort -nr | head -n 25


I set head to 25 for the purposes of this thread - Viking, that code is right now.

It can be used, btw for whatever folder - /home/youruser, / (root), /var/log, whatever... All you need do is change the / in the link above to whatever folder you want to check out.

Was thinking I had it somewhere here at the forum. It will work now. I had forgotten the -n switch. As I said, I wasn't at my linux box when I initially posted it, so wasn't sure it was right.

Re: My Mandriva home is full!

Posted: 01 Mar 2012, 23:46
by viking60
Hmm there is a lot of stuff in my ~/tmp file.
How about removing all of it?

Re: My Mandriva home is full!

Posted: 01 Mar 2012, 23:52
by dedanna1029
That works. I've done that before.

Re: My Mandriva home is full!

Posted: 02 Mar 2012, 00:01
by dedanna1029
However, for safety's sake, you may want to run ls -R on your /tmp and see if there's anything in it you want.

Re: My Mandriva home is full!

Posted: 02 Mar 2012, 00:16
by viking60
Ok done that leaving some files that looked important like easyurpmi.urpmi-media
BTW your code above does not work so you might want to edit it.
OK so far I have freed up 16 % by removing some isos and deleting stuff in tmp - moving on....

Re: My Mandriva home is full!

Posted: 02 Mar 2012, 03:22
by dedanna1029
See above edits.

As a rule of thumb, btw, I don't keep .isos - by the time you get to do a second burn on one, it's already had a new one released, so you just have to go download the new one anyway.

The code above, btw, can also be found in this thread, although yeah, rolf's is nice.

Re: My Mandriva home is full!  Topic is solved

Posted: 02 Mar 2012, 16:20
by viking60
OK this is solved then thanks to your superduper tips.
I used
all of the tips above and I did install filelight, which is great.
I also played around with

Code: Select all

du -sh * 2>/dev/null

But as our guru pointed out it does not make much sense to sort that output.
Rolfs tip does much like the Arch ncdu:

Code: Select all

--- /home/thomas -------------------------------------------------------------------------------------------------------------------------------------------------------
  483,6MiB [##########] /.cache                                                                                                                                         
  374,3MiB [#######   ] /.xbmc
  236,9MiB [####      ] /.local
  170,8MiB [###       ] /.e16
  107,2MiB [##        ] /.mozilla
   88,9MiB [#         ] /videoklipp
   76,6MiB [#         ] /.netbeans
   67,8MiB [#         ] /.config
   47,4MiB [          ] /.opera
   39,0MiB [          ] /.kde4
   35,4MiB [          ] /bilder
   32,5MiB [          ] /Bilder
   28,9MiB [          ] /Downloads
   15,3MiB [          ] /skrivebordsbakgrunner
   13,1MiB [          ] /.themes
   13,0MiB [          ] /proffrør
    6,9MiB [          ] /.thumbnails
    6,5MiB [          ] /Dokumenter
    5,8MiB [          ]  shell-20111221-3.webm
    4,1MiB [          ] /.adobe
    3,9MiB [          ] /.tor
 Total disk usage:   1,8GiB  Apparent size:   1,7GiB  Items: 32050

And that is brilliant.

It turned out that my Virtualbox is clearly occuping the most space - and then I remembered that I had reserved a rather big HD in VirtualBox lately :Doh:
Nevertheless I managed to free up 30% of my home by removing useless stuff.

Code: Select all

:) df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5              48G   15G   31G  33% /
/dev/sda6             393G  275G  118G  70% /home
/dev/sda1             485G  344G  141G  71% /media/win
none                  3,0G   16K  3,0G   1% /tmp

So a thread like this should be mandatory every 6 months :-D

Re: My Mandriva home is full! [SOLVED]

Posted: 03 Mar 2013, 03:21
by dedanna1029
I had to come back here to grab the code I posted above, and noticed your df right above here. Viking, you had at the time, 118GBs left in /home. That may seem like a lot, but compared to the rest of your drive, I'd consider that still low. Is there anything else you can move to elsewhere? Anything? I myself don't call good until I have at least 50% free (really, 118GBs goes super fast).