phillchill
Posts: 2
Joined: Sun Mar 16, 2014 11:31 am

Can't find the files that fill up my Rasbian SD Card

Sun Mar 16, 2014 11:42 am

Code: Select all

df -h
gives me the following

Code: Select all

Filesystem      Size  Used Avail Use% Mounted on
rootfs           15G   14G  457M  97% /
/dev/root        15G   14G  457M  97% /
devtmpfs        211M     0  211M   0% /dev
tmpfs            44M  204K   44M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            88M     0   88M   0% /run/shm
/dev/mmcblk0p1   56M   19M   38M  34% /boot
tmpfs            88M     0   88M   0% /tmp
____________________

while this command, which is supposed to output every directory and its size

Code: Select all

sudo du -hsx * | sort -rh
in root directory gives me this

Code: Select all

du: cannot access `proc/2331/task/2331/fd/4': No such file or directory
du: cannot access `proc/2331/task/2331/fdinfo/4': No such file or directory
du: cannot access `proc/2331/fd/4': No such file or directory
du: cannot access `proc/2331/fdinfo/4': No such file or directory
1.4G    usr
239M    var
53M     lib
37M     opt
19M     boot
7.3M    home
6.7M    sbin
5.9M    bin
4.4M    etc
216K    run
20K     media
16K     root
16K     lost+found
4.0K    srv
4.0K    selinux
4.0K    mnt
0       tmp
0       sys
0       proc
0       dev
To me this doesn't add up, where are the 14GB in use?

It's a Raspberry Pi Model B with pure Raspbian and only one little python-tool installed (pyLoad), nothing else really.

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

Re: Can't find the files that fill up my Rasbian SD Card

Sun Mar 16, 2014 12:26 pm

Possibly the files are in /tmp in the rootfs (/dev/root), and a tmpfs has been mounted over the top so you can't see them.

You could try sudo umount /tmp then du -h /tmp to see what is there. You will need to mount /tmp again afterwards.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 11859
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Can't find the files that fill up my Rasbian SD Card

Sun Mar 16, 2014 1:47 pm

if you really want to know how your cards space is used, I would start by using gparted to find out (for partitions, not for individual files).

plugwash
Forum Moderator
Forum Moderator
Posts: 3418
Joined: Wed Dec 28, 2011 11:45 pm

Re: Can't find the files that fill up my Rasbian SD Card

Sun Mar 16, 2014 3:14 pm

There are some instructions for finding out if there are files hidden under a mount point at

http://www.raspberrypi.org/forum/viewto ... nd#p516994

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: Can't find the files that fill up my Rasbian SD Card

Sun Mar 16, 2014 4:20 pm

did you expand the file system under raspi-config?
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: Can't find the files that fill up my Rasbian SD Card

Sun Mar 16, 2014 4:39 pm

One of the more interesting things that can happen is a process can create and write a file, then immediately unlink it while keeping the file descriptor open. No file will show but the disk space used can be enormous. The disk space won't be freed until the program exits.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

plugwash
Forum Moderator
Forum Moderator
Posts: 3418
Joined: Wed Dec 28, 2011 11:45 pm

Re: Can't find the files that fill up my Rasbian SD Card

Sun Mar 16, 2014 6:47 pm

Richard-TX wrote:did you expand the file system under raspi-config?
His df output clearly shows that the partition has been enlarged.

sander2
Posts: 60
Joined: Wed Jul 04, 2012 2:22 pm

Re: Can't find the files that fill up my Rasbian SD Card

Sun Mar 16, 2014 10:54 pm

I use 'ncdu' to find what the big directories are:

Code: Select all

sudo apt-get install ncdu
sudo ncdu /
HTH

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Can't find the files that fill up my Rasbian SD Card

Sun Mar 16, 2014 11:05 pm

Log files can be something on a pain as I've found out myself - http://www.raspberrypi.org/phpBB3/viewt ... 7&p=239717

Richard S.

plugwash
Forum Moderator
Forum Moderator
Posts: 3418
Joined: Wed Dec 28, 2011 11:45 pm

Re: Can't find the files that fill up my Rasbian SD Card

Sun Mar 16, 2014 11:30 pm

Yeah, especially if something has them held open so you rm the massive log but it doesn't actually free up the disk space.

Anyway to the original poster the first thing I'd try is the method described in the link I gave in my previous post to see if there are files hidden under a mount point. If that doesn't turn anything up then I would do !sudo touch /forcefsck" and reboot to force a filesystem check.

phillchill
Posts: 2
Joined: Sun Mar 16, 2014 11:31 am

Re: Can't find the files that fill up my Rasbian SD Card

Tue Mar 18, 2014 7:00 pm

plugwash wrote:There are some instructions for finding out if there are files hidden under a mount point at

http://www.raspberrypi.org/forum/viewto ... nd#p516994
This did it! :)

PyLoad loaded some files onto my sd under the path where my hdd was mounted. I cleaned it up now.

Thanks for everyone who contributed!

reylon
Posts: 4
Joined: Thu Oct 16, 2014 7:58 am

14GB ROOT FULL WITH OWNCLOUD

Wed May 27, 2015 8:43 pm

27-05-2015 22-43-20.jpg
27-05-2015 22-43-20.jpg (18.17 KiB) Viewed 3456 times
I had a similar problem using owncloud. I resized the root system when at the start was not used all the sd card, I had 8GB empty and after some days of backup upload I arrived to 14GB root file system without SD card space more. The owncloud data are on a mounted external HD, only the mysql database is in the sd card. I don't think can be possible that a data base of 35GB files can use 8GB..... No other programs are working on the PI that use noobs and is the 1GB ram last model. Some people have an idea?

marcocoisson
Posts: 3
Joined: Sat Mar 05, 2016 4:17 pm
Location: Torino, Italy, EU

Re: Can't find the files that fill up my Rasbian SD Card

Sat Mar 05, 2016 4:33 pm

Hi all,
I join this thread because I have a similar problem. According to df -h my /dev/root partition is 100% full. It has been extended to the full size of the SD card because it is properly reported as being of 59G (it's a 64 GB micro-SD card).
However, gparted says that the micro-SD card is almost empty.
So I decided to look at what ncdu -x / would say, and that's quite interesting:

Code: Select all

.  54.7GiB [##########] /media                                                  
    2.2GiB [          ] /usr
  635.1MiB [          ] /opt
  284.8MiB [          ] /lib
. 213.4MiB [          ] /var
   19.6MiB [          ] /boot.bak
.  18.7MiB [          ] /home
    7.9MiB [          ] /bin
    7.5MiB [          ] /sbin
.   5.1MiB [          ] /etc
   28.0KiB [          ] /tmp
!  16.0KiB [          ] /lost+found
e   4.0KiB [          ] /srv
!   4.0KiB [          ] /root
e   4.0KiB [          ] /mnt
>   0.0  B [          ] /sys
>   0.0  B [          ] /run
>   0.0  B [          ] /proc
>   0.0  B [          ] /dev
>   0.0  B [          ] /boot
Same if I do a cd / ; sudo du -hsx * | sort -rh | head -10, what I get is this:

Code: Select all

55G	media
2.2G	usr
636M	opt
285M	lib
214M	var
31M	root
24M	home
20M	boot.bak
20M	boot
7.9M	bin
Indeed, I have several USB hard disks attached to my Raspberry Pi (its main purpose is to be a file server). Apparently, the /media directory, where all the USB disks are automatically mounted at boot, counts as occupied space on the Pi's micro-SD card (note that I used the -x option when invoking ncdu, so filesystem boundaries shouldn't be crossed).
Am I missing something? Did I configure something wrong?
Thank you for your help!
Last edited by marcocoisson on Sun Mar 06, 2016 2:16 pm, edited 1 time in total.

User avatar
DougieLawson
Posts: 35381
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Can't find the files that fill up my Rasbian SD Card

Sat Mar 05, 2016 9:06 pm

try sudo apt-get autoremove; sudo apt-get autoclean; sudo apt-get clean
and try
cd /tmp
find . -name "*gz" | xargs sudo rm
cd /lib/modules

then remove any sub directories there that don't match your current running kernel (checked with uname -r).

that should clean out some junk.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

marcocoisson
Posts: 3
Joined: Sat Mar 05, 2016 4:17 pm
Location: Torino, Italy, EU

Re: Can't find the files that fill up my Rasbian SD Card

Sun Mar 06, 2016 10:09 am

Thank you very much for your help!
The /tmp directory was already empty, but I have been able to reclaim some space by deleting old kernel files. That didn't solve the problem, in fact, but it let me stumble in something that gave me a hint on what was happening: among the several USB disks connected to the Pi, one of them went offline for some reason (I guess the controller is fried, as it doesn't mount any more on any system). However, its entry in the /media directory remained, I don't know why. When a cronjob invoking rsync fired having that entry as the destination directory, the micro-SD quickly filled up. You never do enough sanity checks on automatic procedures, even on backups. ;)

Problem solved for me, I guess. I thank you very much again for your help!

User avatar
DougieLawson
Posts: 35381
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Can't find the files that fill up my Rasbian SD Card

Sun Mar 06, 2016 10:17 am

Try looking in /var/log for yet more gzipped junk.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

marcocoisson
Posts: 3
Joined: Sat Mar 05, 2016 4:17 pm
Location: Torino, Italy, EU

Re: Can't find the files that fill up my Rasbian SD Card

Sun Mar 06, 2016 2:16 pm

I will keep an eye on that as well, thank you!

Return to “Raspbian”