You are not logged in.

#1 2012-02-15 16:59:15

joelb
Member
Registered: 2010-09-16
Posts: 21
Website

Out of disk space, /usr takes 11GB...

When I first installed Arch I figured 25GB would be large enough for the filesystem because I'm keeping large files on another partition so I can share them with Windows. Unfortunately I've been battling the system for a while now to keep my storage down. Yesterday my disk filled up all the way, once again, but the problem this time is that even when I delete files the available space stays at 0... Not good. I tried moving the biggest files in my home directory to another disk, in fact I moved a few GB, but for some reason I don't understand there is still no space available. Here are the directories taking up the most space:

  1. /usr - 12 GB

  2. /home - 3.5 GB

  3. /var - 2.3 GB

  4. /opt - 1.9 GB

  5. Everything else - <= 107 MB

Two things - As you may have noticed that comes out to about 20 GB, I'm not sure if that extra space is needed by the filesystem or if it indicates a problem. Also, why on earth would /usr need that much space? How can I get it to use less space, other than reinstalling?

Thanks,
Joel


Github          Twitter          joelburget.com

Offline

#2 2012-02-15 17:09:11

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: Out of disk space, /usr takes 11GB...

We had this exact same problem, like, two days ago. Please stfw before starting new threads.

Offline

#3 2012-02-15 17:10:31

joelb
Member
Registered: 2010-09-16
Posts: 21
Website

Re: Out of disk space, /usr takes 11GB...

@/dev/zero I did search for it but didn't find anything, can you point me to the correct thread?


Github          Twitter          joelburget.com

Offline

#4 2012-02-15 17:10:50

Pres
Member
Registered: 2011-09-12
Posts: 423

Re: Out of disk space, /usr takes 11GB...

Something like this was posted very recently. My guess is you just have too much software installed.

You can try something like:

du -a /usr | sort -n -r | head -n 20

This will show you whats taking up the most space in /usr. You can also use something like filelight if you have a GUI working.

Offline

#5 2012-02-15 17:18:38

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: Out of disk space, /usr takes 11GB...

joelb wrote:

@/dev/zero I did search for it but didn't find anything, can you point me to the correct thread?

This is the one I was thinking of:
https://bbs.archlinux.org/viewtopic.php?id=135664

There was another similar one about a week before that.

And a google search on "how resize linux partition" brings up heaps of stuff.

Offline

#6 2012-02-15 18:45:34

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Out of disk space, /usr takes 11GB...

https://wiki.archlinux.org/index.php/Co … y_Programs
Check what do you have in your /usr.

Offline

#7 2012-02-15 19:19:29

joelb
Member
Registered: 2010-09-16
Posts: 21
Website

Re: Out of disk space, /usr takes 11GB...

I just removed 66 packages, but running df shows that there are 25530452 blocks, 24814492 used, and 0 available. I don't understand, do I need to reboot to get those blocks back or something?


Github          Twitter          joelburget.com

Offline

#8 2012-02-15 19:24:23

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Out of disk space, /usr takes 11GB...

Please post the full output of 'df -h' and 'df -hi'.
If these were small packages, the space savings will be small. How did you remove them?

Offline

#9 2012-02-15 19:24:38

joelb
Member
Registered: 2010-09-16
Posts: 21
Website

Re: Out of disk space, /usr takes 11GB...

@/dev/zero I don't want to resize my partition because I think 25GB should be enough, I just have to figure out how to work within that space. That and Windows doesn't want to give up any more sad

@karol I'll definitely try that out, but unfortunately I need to clear up some space before I can use those programs.


Github          Twitter          joelburget.com

Offline

#10 2012-02-15 19:27:41

joelb
Member
Registered: 2010-09-16
Posts: 21
Website

Re: Out of disk space, /usr takes 11GB...

@karol
df -h gives Size: 25G, Used: 24G, Avail: 0, Use%: 100%
df -hi gives Inodes: 1.6M, IUsed: 683K, IFree: 883K, IUse%: 44%

(I didn't just copy the output because I'm typing this on my other computer because my browsers won't open because they need to write a file or something)


Github          Twitter          joelburget.com

Offline

#11 2012-02-15 19:31:32

joelb
Member
Registered: 2010-09-16
Posts: 21
Website

Re: Out of disk space, /usr takes 11GB...

Oh and I used

sudo pacman -R <packages>

Github          Twitter          joelburget.com

Offline

#12 2012-02-15 19:40:07

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Out of disk space, /usr takes 11GB...

joelb wrote:

Oh and I used

sudo pacman -R <packages>

You may try running 'pacman -Sc' to clean your CacheDir, which is located in /var by default:

[karol@black ~]$ grep ^CacheDir /etc/pacman.conf
CacheDir    = /var/cache/pacman/pkg/

If these were packages from the official repos, you just uninstalled them, but the *.pkg.tar.xz installation tarballs are still there.

Offline

#13 2012-02-15 19:51:56

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Out of disk space, /usr takes 11GB...

joelb wrote:

why on earth would /usr need that much space?

Try

du -h --max-depth=1 /usr

Offline

#14 2012-02-15 21:28:54

joelb
Member
Registered: 2010-09-16
Posts: 21
Website

Re: Out of disk space, /usr takes 11GB...

@karol Thanks for the tip, I managed to reduce usage to 98% by removing a bunch of packages and their cached tarballs.

@tomk I get

55M	/usr/src
2.6G	/usr/local
3.1G	/usr/share
39M	/usr/sbin
145M	/usr/lib32
8.0K	/usr/man1
12K	/usr/man
651M	/usr/bin
135M	/usr/include
3.1G	/usr/lib
9.7G	/usr

My interpretation of that output is that lib, share, and local seem to be too large, so I ran du on them

% sudo du -a --max-depth=1 /usr/lib | sort -n -r | head -n 20                          joel@arch
3243808	/usr/lib
823968	/usr/lib/ghc-7.0.3
450008	/usr/lib/ruby
254240	/usr/lib/python2.7
198644	/usr/lib/racket
131236	/usr/lib/coq
126508	/usr/lib/ocaml
103384	/usr/lib/gcc
102588	/usr/lib/chromium
100944	/usr/lib/python3.2
51432	/usr/lib/python2.5
50204	/usr/lib/virtualbox
43880	/usr/lib/perl5
36440	/usr/lib/firefox
33720	/usr/lib/libnvidia-glcore.so.290.10
27040	/usr/lib/libnvidia-compiler.so.290.10
26412	/usr/lib/libQtWebKit.so.4.9.0
23304	/usr/lib/libwebkitgtk-1.0.so.0.11.2
23300	/usr/lib/libwebkitgtk-3.0.so.0.11.2
18352	/usr/lib/mozilla
 /usr
% sudo du -a --max-depth=1 /usr/share | sort -n -r | head -n 20                        joel@arch
3184996	/usr/share
942860	/usr/share/texmf-dist
382832	/usr/share/cuda-sdk
284372	/usr/share/locale
238376	/usr/share/doc
199048	/usr/share/eclipse
125320	/usr/share/fonts
99280	/usr/share/racket
91912	/usr/share/icons
88968	/usr/share/texmf-var
82512	/usr/share/gtk-doc
77344	/usr/share/man
53780	/usr/share/foomatic
39780	/usr/share/perl5
27868	/usr/share/ghostscript
25848	/usr/share/gnome
25728	/usr/share/vim
25096	/usr/share/color
23288	/usr/share/gir-1.0
18732	/usr/share/cups
 /usr
% sudo du -a --max-depth=1 /usr/local | sort -n -r | head -n 20                        joel@arch
2668008	/usr/local
2281652	/usr/local/lib
342308	/usr/local/share
23344	/usr/local/bin
19924	/usr/local/nacl-sdk
476	/usr/local/include
176	/usr/local/libexec
96	/usr/local/man
12	/usr/local/var
4	/usr/local/src
4	/usr/local/sbin
4	/usr/local/games
4	/usr/local/etc

As far as I can tell all the output looks reasonable, but most of that stuff seems like packages I would expect everyone to have. Do packages just take up more space than I would expect?

One last thing, the relevant output from df now looks like this:

Filesystem     1K-blocks      Used Available Use% Mounted on
rootfs          25530452  23596508    653916  98% /

Now 25530452 - 23596508 = 1933944, but available is 653916, so why is more than 1GB not available?

By the way, if anybody else has the same problems, this page - Pacman tips - is helpful for finding packages to remove.


Github          Twitter          joelburget.com

Offline

#15 2012-02-15 22:11:13

Oxyd
Member
From: Czech Republic
Registered: 2008-01-17
Posts: 167

Re: Out of disk space, /usr takes 11GB...

If a file is being used (there's a handle to it held by some process) and it's deleted, it's only removed from the directory listing but stays on the disk until all handles to it are closed -- then the space on disk is really freed. Since it's not listed in any directory anymore, it won't be counted by du, but since the space is occupied, it'll be counted by df. This may cause weird discrepancies -- I once ran out of space on my rather large /home partition (200 GB) but I couldn't find any culprit -- turned out, some process kept writing tons of error messages into a log until it filled the whole partition -- and for some other reason, that log file was unlinked.

So, for a random shot in the dark -- try rebooting your computer and see if the usage goes down.

Offline

#16 2012-02-15 22:11:49

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Out of disk space, /usr takes 11GB...

Why are you using /usr/local ? What's in there?

Arch packages don't touch that dir, so I guess you've been installing un-packaged stuff?

Offline

#17 2012-02-16 01:01:59

joelb
Member
Registered: 2010-09-16
Posts: 21
Website

Re: Out of disk space, /usr takes 11GB...

@Oxyd good suggestion, unfortunately it looks almost exactly the same after reboot:

% df                                                                     joel@arch
Filesystem     1K-blocks      Used Available Use% Mounted on
rootfs          25530452  23575116    675308  98% /

@tomk looks like mostly a few different versions of ghc that I installed manually and emacs 24. Wow, deleting one of those ghc versions freed up 3%! Thanks for pointing that out!


Github          Twitter          joelburget.com

Offline

#18 2012-02-16 03:29:12

daedhel
Member
From: Québec, Canada
Registered: 2009-01-17
Posts: 40
Website

Re: Out of disk space, /usr takes 11GB...

you might be interested in the ncdu app:

http://www.archlinux.org/packages/?sort … =&limit=50

Offline

#19 2012-02-16 17:34:19

der_joachim
Member
From: the Netherlands
Registered: 2008-12-17
Posts: 143
Website

Re: Out of disk space, /usr takes 11GB...

Hmmm... Not sure if really useful, but you can try a

pacman -Qqtd

to check whether there are any orphaned packages. You can safely delete these with the following command:

pacman -Rsn packagename

You can combine the two commands, but running them separately is somewhat safer:

pacman -Rsn `pacman -Qqtd`

Please note the backticks. As mentioned before, the wiki and man page can help you further.


Geek, runner, motorcyclist and professional know-it-all

Offline

#20 2012-02-17 01:39:05

joelb
Member
Registered: 2010-09-16
Posts: 21
Website

Re: Out of disk space, /usr takes 11GB...

@daedhel ncdu is sweet. I'm using it now.

@der_joachim I just got rid off all my orphans too smile


Github          Twitter          joelburget.com

Offline

Board footer

Powered by FluxBB