On Thursday 07 February 2008 11:20, Greg Freemyer wrote:
All,
I'm running low on space on root, so I just ran cd /; du -shx *
I was expecting the -x to cause my mount points to be ignored. No such luck and I can see that since I explicitly am including /home etc. I'm going to get results for that.
Anyone know a simple way to say "how big are the subdirectories on my root partition?"
Any file system mounted on a directory in / is seen by this invocation as a starting point. If you used "/" instead of "*" (along with -x) then du would not traverse into the mounted file systems. This actually turns out to be a sticky problem. The best thing I could come up with is this (I turned off wrapping to send this, but YMMV): % cd / % du -shx $(ls / |egrep -v "$(df |egrep ^/dev |sed -e 's/.* //' |tr '\n' '|' |sed -r -e 's;/;;g' -e 's;^(.*)\|$;^(\1);')") 0 acquisitions 6.7M bin 0 bittorrent 20M boot 0 data2 0 data3 0 data4 0 data5 172K dev 69M etc 169M lib 0 media 0 mnt 2.9G opt 16K p4 933M proc 0 publications 51M root 15M sbin 471M srv 0 subdomain 0 sys 722M tmp 9.1G usr 1.5G var % ls -lF / lrwxrwxrwx 1 root root 26 Sep 24 2006 acquisitions -> /repo/library/acquisitions/ drwxr-xr-x 2 root root 4096 Sep 14 20:44 bin/ lrwxrwxrwx 1 root root 16 Oct 7 2005 bittorrent -> /repo/bittorrent/ drwxr-xr-x 3 root root 4096 Oct 23 16:57 boot/ drwxrwxrwt 14 root root 4096 Dec 6 22:27 dar/ drwxr-xr-x 2 root root 6 Oct 7 2005 data2/ drwxr-xr-x 2 root root 6 Oct 7 2005 data3/ drwxr-xr-x 2 root root 6 Oct 7 2005 data4/ drwxr-xr-x 2 root root 6 Oct 7 2005 data5/ drwxr-xr-x 12 root root 16400 Feb 7 08:35 dev/ drwxr-xr-x 124 root root 12288 Feb 7 08:35 etc/ drwxr-xr-x 12 root root 4096 Aug 25 2006 home/ drwxr-xr-x 11 root root 8192 Jan 19 2007 lib/ drwxr-xr-x 6 root root 107 Feb 7 08:35 media/ drwxrwxrwt 5 root root 42 Jun 6 2007 mnt/ drwxr-xr-x 16 root root 4096 Sep 13 15:46 opt/ drwxr-xr-x 2 p4 p4 93 Oct 30 2005 p4/ dr-xr-xr-x 345 root root 0 Feb 7 08:33 proc/ lrwxrwxrwx 1 root root 26 Sep 24 2006 publications -> /repo/library/publications/ drwxrwxrwt 29 root root 936 Nov 26 19:36 repo/ drwx------ 69 root root 8192 Feb 7 11:55 root/ drwxr-xr-x 21 root root 4096 Oct 20 2005 root91/ drwxr-xr-x 27 root root 4096 Oct 19 2005 root93/ drwxr-xr-x 3 root root 12288 Aug 5 2007 sbin/ drwxr-xr-x 6 root root 50 Feb 16 2007 srv/ drwxr-xr-x 2 root root 6 Sep 9 2005 subdomain/ drwxr-xr-x 10 root root 0 Feb 7 08:33 sys/ drwxrwxrwt 127 root root 45056 Feb 7 11:45 tmp/ drwxr-xr-x 16 root root 4096 Sep 25 00:46 usr/ drwxr-xr-x 16 root root 4096 Feb 17 2006 var/ % df Filesystem 1K-blocks Used Available Use% Mounted on LABEL=Root10 35895684 15651992 20243692 44% / tmpfs 1036540 0 1036540 0% /dev/shm /dev/sda1 293008588 91737328 201271260 32% /repo /dev/sdb1 20962560 11337580 9624980 55% /root93 /dev/sdd1 11962304 6421116 5541188 54% /root91 /dev/sdd2 11961344 7177244 4784100 61% /home /dev/sdd3 11961344 1202044 10759300 11% /dar Understanding this incantation is "left as an exercise for the reader..."
Thanks Greg
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org