hevilp
Posts: 64
Joined: Sun Sep 09, 2012 6:13 pm

0% Space left -> not able to find the reason

Sun May 03, 2015 11:20 am

Hi,

my PI has 0% space left and i cant find the reason why:

Code: Select all

[email protected] ~ $ df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs           15G   15G     0 100% /
/dev/root        15G   15G     0 100% /
devtmpfs         55M     0   55M   0% /dev
tmpfs            12M  240K   12M   2% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            24M     0   24M   0% /run/shm
/dev/mmcblk0p1   56M   17M   40M  30% /boot
tmpfs            24M     0   24M   0% /tmp
and

Code: Select all

[email protected] ~ $ sudo ls -lahS $(find / -type f -size +10000k)
-rw------- 1 root root 100M Feb 16 14:03 /var/swap
-rw-r--r-- 1 root root  63M Mar  4  2014 /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/rt.jar
-rw-r--r-- 1 root root  60M Feb 16 13:28 /usr/share/icons/gnome/icon-theme.cache
-rw-r--r-- 1 root root  42M Feb  3 18:48 /opt/Wolfram/WolframEngine/10.0/SystemFiles/Libraries/Linux-ARM/libWolframEngine.so
-rw-r--r-- 1 root root  34M Apr 24 10:25 /var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_wheezy_main_binary-armhf_Packages
-rw-r--r-- 1 root root  31M Apr 14 13:45 /var/cache/apt/archives/sonic-pi_2.5.0-1_armhf.deb
-rw-r--r-- 1 root root  30M Mar 30 10:41 /var/cache/apt/archives/libraspberrypi-doc_1.20150214-2_armhf.deb
-rwxr-xr-x 1 root root  29M Dec 18  2013 /usr/lib/pypy-upstream/bin/pypy
-rw-r--r-- 1 root root  28M Mar 30 10:41 /var/cache/apt/archives/raspberrypi-bootloader_1.20150214-2_armhf.deb
-rw-r--r-- 1 root root  24M Apr 15 13:39 /usr/lib/arm-linux-gnueabihf/libwebkitgtk-3.0.so.0.22.7
-rw-r--r-- 1 root root  24M Feb 16 13:33 /usr/share/icons/nuoveXT2/icon-theme.cache
-rwxr-xr-x 1 root root  23M Feb  3 18:24 /opt/Wolfram/WolframEngine/10.0/SystemFiles/FrontEnd/Binaries/Linux-ARM/WolframFrontEnd
-rw-r--r-- 1 root root  21M Mar  4  2014 /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/src.zip
-rw-r--r-- 1 root root  20M Nov 29  2012 /usr/lib/arm-linux-gnueabihf/libQtWebKit.so.4.9.0
-rw-r--r-- 1 root root  18M Mar 13 05:36 /usr/lib/arm-linux-gnueabihf/libicudata.so.48.1.1
-rw-r--r-- 1 root root  18M Apr 28 16:16 /var/cache/apt/pkgcache.bin
-rw-r--r-- 1 root root  18M Apr 24 18:12 /var/cache/apt/srcpkgcache.bin
-rw-r--r-- 1 root root  18M Mar  4  2014 /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/lib/tools.jar
-rw-r--r-- 1 root root  18M Dec  4 00:09 /opt/Wolfram/WolframEngine/10.0/SystemFiles/Components/SemanticImport/resources/spellings/Indices-SemanticImport.idx
-rw-r--r-- 1 root root  18M Mar  4  2014 /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/lib/ct.sym
-rw-rw-rw- 1 root root  15M Oct  6  2014 /opt/Wolfram/WolframEngine/10.0/AddOns/Applications/EntityFramework/Resources/Linux-ARM/CityEntityNames.mx
-rw-r--r-- 1 root root  14M Jan 14 21:56 /usr/share/scratch/NuScratch140115.image
-rwxr-xr-x 1 root root  14M Feb  3 18:21 /opt/Wolfram/WolframEngine/10.0/SystemFiles/Converters/Binaries/Linux-ARM/ITK.exe
-rw-r--r-- 1 root root  12M Feb  1  2012 /opt/Wolfram/WolframEngine/10.0/SystemFiles/Converters/Java/netcdfAll-4.2.jar
-rw-r--r-- 1 root root  11M Mar  4  2014 /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/arm/server/libjvm.so
-rwxr-xr-x 1 root root 9.8M Jan 14  2013 /usr/lib/gcc/arm-linux-gnueabihf/4.6/cc1plus

with the last command i find the files with over 10mb, which are not much...
how i can find the reason for it?

User avatar
AndyD
Posts: 2331
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: 0% Space left -> not able to find the reason

Sun May 03, 2015 11:48 am

It sounds like it isn't one big file, but a large number of smaller files. I have often used the following:-

Code: Select all

sudo du -ks /* | sort -n
to get a sorted list of disk space usage. You can then start drilling down into the directories that are taking up the most space.

Note: you will get some No such file or directory errors from /proc/ that you can ignore!

User avatar
rpdom
Posts: 15168
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: 0% Space left -> not able to find the reason

Sun May 03, 2015 11:53 am

Quite often this sort of problem is caused by writing a large file (or files) to an area where another filesystem is normally mounted, but wasn't mounted at the time. Then when the normal filesystem is mounted, it hides the contents.

/tmp is a common one and I see you have a separate file system for /tmp.

You could try unmounting /tmp and then seeing what is left in there, or you can use a trick to mount the real /tmp somewhere else.

Code: Select all

sudo mount --bind / /mnt
ls -lh /mnt/tmp
# delete the files under /mnt/tmp if you find any
sudo umount /mnt

cdo
Posts: 9
Joined: Tue Nov 19, 2013 5:13 pm

Re: 0% Space left -> not able to find the reason

Sun May 03, 2015 12:01 pm

Do you have ncdu installed (I'm not sure if Raspian comes with it pre-installed)? Then you can use

Code: Select all

ncdu /
to see which directories and files use up the space.

User avatar
AndyD
Posts: 2331
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: 0% Space left -> not able to find the reason

Sun May 03, 2015 12:10 pm

cdo wrote:Do you have ncdu installed (I'm not sure if Raspian comes with it pre-installed)? Then you can use

Code: Select all

ncdu /
to see which directories and files use up the space.
That's a new one to me! Thanks!

hevilp
Posts: 64
Joined: Sun Sep 09, 2012 6:13 pm

Re: 0% Space left -> not able to find the reason

Sun May 03, 2015 12:46 pm

AndyD wrote:
cdo wrote:Do you have ncdu installed (I'm not sure if Raspian comes with it pre-installed)? Then you can use

Code: Select all

ncdu /
to see which directories and files use up the space.
That's a new one to me! Thanks!

WOW nice, I found with this tool all I need

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5080
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: 0% Space left -> not able to find the reason

Sun May 03, 2015 9:05 pm

AndyD wrote:
cdo wrote:Do you have ncdu installed (I'm not sure if Raspian comes with it pre-installed)? Then you can use

Code: Select all

ncdu /
to see which directories and files use up the space.
That's a new one to me! Thanks!
+1
For many years I've usually used something like this alias:

Code: Select all

alias hsdu='du -k | sort -n -r | head'
Trev.
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my 2xP3A+, P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

jjsteing
Posts: 9
Joined: Sun May 17, 2015 1:38 pm
Contact: Website

Re: 0% Space left -> not able to find the reason

Mon May 18, 2015 11:58 am

FYI

I have the same problem here :

viewtopic.php?f=63&t=110752&p=760830#p760830

If one of us resolve it will be find :)

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: 0% Space left -> not able to find the reason

Mon May 18, 2015 1:05 pm

cdo wrote:Do you have ncdu installed (I'm not sure if Raspian comes with it pre-installed)? Then you can use

Code: Select all

ncdu /
to see which directories and files use up the space.
Its preinstalled; but, I was not aware of its presence. Thanks!
marcus
:ugeek:

jjsteing
Posts: 9
Joined: Sun May 17, 2015 1:38 pm
Contact: Website

Re: 0% Space left -> not able to find the reason

Wed May 20, 2015 8:28 pm

rpdom find out why my sd was full, it was a 'share folder problem' .. maybe you have the same problem.. hope you find arround a solution

Have a good day.

Return to “Advanced users”