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

16Gb SD Full - out of space

Sun May 17, 2015 2:02 pm

HI Everybody,

I run out of space on my RPI with an 16Gb SD
du -sh * give me around 3Gb used but df -k show me 12Gb Used .. where are my 9 gb remaining ??

Thanks ..

root@raspberrypi:/# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 13597616 12412824 471016 97% /
/dev/root 13597616 12412824 471016 97% /
devtmpfs 185736 0 185736 0% /dev
tmpfs 38004 256 37748 1% /run
tmpfs 5120 0 5120 0% /run/lock
tmpfs 76000 0 76000 0% /run/shm
/dev/mmcblk0p5 60479 19381 41098 33% /boot
//192.168.1.19/Public/Shared Videos 1941348672 725068096 1216280576 38% /media/DicoNoir/Video
none 190000 0 190000 0% /sys/fs/cgroup
/dev/mmcblk0p3 27633 434 24906 2% /media/SETTINGS_

------------------------------------------------


root@raspberrypi:/# du -sh *
5.2M bin
19M boot
0 dev
5.1M etc
7.0M home
110M lib
16K lost+found
96G media ****** IT S AN EXTERNAL Hard DRIVE So no matter with my SD *****
12K mnt
526M opt
du: cannot access `proc/2449/task/2449/fd/3': No such file or directory
du: cannot access `proc/2449/task/2449/fdinfo/3': No such file or directory
du: cannot access `proc/2449/fd/3': No such file or directory
du: cannot access `proc/2449/fdinfo/3': No such file or directory
0 proc
2.5M root
256K run
6.2M sbin
4.0K selinux
4.0K srv
0 sys
20K tmp
1.6G usr
243M var
-----------------------------------------

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: 16Gb SD Full - out of space

Sun May 17, 2015 8:58 pm

You need to expand the file structure. (First option).
Doug.
Building Management Systems Engineer.

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: 16Gb SD Full - out of space

Sun May 17, 2015 10:03 pm

BMS Doug wrote:You need to expand the file structure. (First option).
That's not possible since the OP is running NOOBS.

So he/she needs to clean up some of the crud and cruft.

sudo apt-get autoremove
sudo apt-get autoclean
is usually a good start.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

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

Re: 16Gb SD Full - out of space

Mon May 18, 2015 3:17 am

Hi

I m not a pro but no more a noob ;)

Already make easy cleanup..

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

Re: 16Gb SD Full - out of space

Mon May 18, 2015 3:38 am

And fyi I use noobs so root file system is already expand as you can see on my 1st post 13gb on 16gb sd for rootts partition ..

Can you answer my question : partition 13gb used 12gb but list all files 3gb used.. Where are my 9gb ??

Give me some command lines please.

Thanks

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

Re: 16Gb SD Full - out of space

Mon May 18, 2015 5:31 am

You've probably already done this, but first look to see if you can see where the usage is

Code: Select all

pi@raspi2 / $ sudo du -hxs /*
5.5M	/bin
21M	/boot
15M	/boot.tgz
0	/dev
4.1M	/etc
2.1M	/home
150M	/lib
16K	/lost+found
4.0K	/media
4.0K	/mmcblk0.sfdisk
4.0K	/mnt
40M	/opt
du: cannot access ‘/proc/13259/task/13259/fd/3’: No such file or directory
du: cannot access ‘/proc/13259/task/13259/fdinfo/3’: No such file or directory
du: cannot access ‘/proc/13259/fd/3’: No such file or directory
du: cannot access ‘/proc/13259/fdinfo/3’: No such file or directory
0	/proc
1.8M	/restoresymtable
109M	/root
208K	/run
5.4M	/sbin
4.0K	/srv
0	/sys
108K	/tmp
753M	/usr
283M	/var
(Ignore the "cannot access" messages)
That might show you where the space is being used.

If it doesn't show up, then it may be hidden under a mount point. You can find those files using a bind mount like this.

Code: Select all

pi@raspi2 / $ sudo mount -o bind / /media
pi@raspi2 / $ df -h / /media
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       7.2G  1.4G  5.4G  21% /
/dev/root       7.2G  1.4G  5.4G  21% /media
pi@raspi2 / $ sudo du -hxs /media/*
5.5M	/media/bin
4.0K	/media/boot
15M	/media/boot.tgz
8.0K	/media/dev
4.1M	/media/etc
2.1M	/media/home
(etc)
You can then check for files that were hidden under a mount point that are now visible in /media and delete them, then unmount /media and you will have your space back.

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

Re: 16Gb SD Full - out of space

Mon May 18, 2015 7:11 am

Like @rpdom I've usually used a du based alias to search for large file(s) etc.:

Code: Select all

alias hsdu='du -k | sort -n -r | head'
However, courtesy of @cdo, I'm now aware of its more powerful cousin, ncdu as discussed in this similar thread:
viewtopic.php?f=29&t=109276
You may find it useful too.
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

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

Re: 16Gb SD Full - out of space

Mon May 18, 2015 11:51 am

Dear all..

Thanks for reply.. but still not working..

I tried to remove my mount directory in my fstab file with a '#' and finaly remove the line..reboot ( 10 times) because I thought that is was why RPI find 97% used

Code: Select all

df -k
rootfs          13597616 12413468    470372  97% /
/dev/root       13597616 12413468    470372  97% /
devtmpfs          185736        0    185736   0% /dev
tmpfs              38004      256     37748   1% /run
tmpfs               5120        0      5120   0% /run/lock
tmpfs              76000        0     76000   0% /run/shm
/dev/mmcblk0p5     60479    19381     41098  33% /boot
none              190000        0    190000   0% /sys/fs/cgroup
/dev/mmcblk0p3     27633      434     24906   2% /media/SETTINGS_
Now my share is removed ( but I can still acces to /media/DicoNoir/Video/* :arrow: :| ??? I dont understand why...) but still 97% used

So now I have 2 problems : my sd is full, and I still can access to /media/Diconoir/Video/* even if this share is not mounted in my fstab file.. :cry: :cry:

My last solution will be reinstall all my RPI, but I wanted to know why I can still acces to a share file if this one is not mounted..

For me, reinstall is not the real solution, it will just resolve my problem without understanding it ( witch is not my mind)

Thanks

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

Re: 16Gb SD Full - out of space

Mon May 18, 2015 11:56 am

FTrevorGowen wrote:Like @rpdom I've usually used a du based alias to search for large file(s) etc.:

Code: Select all

alias hsdu='du -k | sort -n -r | head'
However, courtesy of @cdo, I'm now aware of its more powerful cousin, ncdu as discussed in this similar thread:
viewtopic.php?f=29&t=109276
You may find it useful too.
Trev.

Code: Select all

--- / --------------------------------------------------------------------------
    9.4GiB [##########] /media
    1.6GiB [#         ] /usr
  525.3MiB [          ] /opt
  243.2MiB [          ] /var
  109.9MiB [          ] /lib
   18.9MiB [          ] /boot
    7.0MiB [          ] /home
    6.1MiB [          ] /sbin
    5.2MiB [          ] /bin
    5.0MiB [          ] /etc
    2.4MiB [          ] /root
  256.0KiB [          ] /run
   44.0KiB [          ] /.config
   20.0KiB [          ] /tmp
e  16.0KiB [          ] /lost+found
   12.0KiB [          ] /mnt
e   4.0KiB [          ] /srv
e   4.0KiB [          ] /selinux
    0.0  B [          ] /sys
    0.0  B [          ] /proc
    0.0  B [          ] /dev
 Total disk usage:  11.8GiB  Apparent size:  20.8GiB  Items: 139094

Total disk usage 11.8 (9.4Gb from /media/* it s a share directory to my NAS...) is it why he find my sd @97% used ?? RPI doesnt make difference between real capacity and total files space ??

User avatar
RaTTuS
Posts: 10559
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: 16Gb SD Full - out of space

Mon May 18, 2015 11:58 am

sudo sh
mount
umount /media/DicoNoir/Video/
df -h
ls -l /media/DicoNoir/Video
if there is stuff there and it is not mounted then you have put stuff in the mount before it is mounted
rm -fr /media/DicoNoir/Video/ #empty the directory
#remout it
exit
what you need to do is understand how things work
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

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

Re: 16Gb SD Full - out of space

Mon May 18, 2015 12:04 pm

jjsteing wrote:Now my share is removed ( but I can still acces to /media/DicoNoir/Video/* :arrow: :| ??? I dont understand why...) but still 97% used

So now I have 2 problems : my sd is full, and I still can access to /media/Diconoir/Video/* even if this share is not mounted in my fstab file.. :cry: :cry:
No, you have one problem. You have put files in /media/Diconoir/Video/* when the share wasn't mounted.

Because of that the files didn't go on the share, they went in the / file system.

The files you see in /media/Diconoir/Video/ when the share is mounted aren't the same files as you see there when it is.

Try this:
Unmount the share.
Move the files somewhere else (somewhere safe for now)
Mount the share.
You should now have some files in the share and some files somewhere else and you can delete what you don't want, or move them to the share.

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

Re: 16Gb SD Full - out of space

Wed May 20, 2015 8:27 pm

Exaclty !! it s what I discovered when I removed the LAN cable from my NAS :(

So I delete all files from my sd and it s fine now :)

I used this share to put my torrents ( from deluged ) .. How can I verify if I access to /media/DicoNoir/Video/* to my share (NAS) or to the sd ?

thanks

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: 16Gb SD Full - out of space

Wed May 20, 2015 9:11 pm

How can I verify if I access to /media/DicoNoir/Video/* to my share (NAS) or to the sd ?

Code: Select all

grep -q /media/DicoNoir /proc/mounts && echo "Yup, it's mounted!"
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

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

Re: 16Gb SD Full - out of space

Wed May 20, 2015 9:22 pm

Joe Schmoe wrote:
How can I verify if I access to /media/DicoNoir/Video/* to my share (NAS) or to the sd ?

Code: Select all

grep -q /media/DicoNoir /proc/mounts && echo "Yup, it's mounted!"
Too complicated ;)

Code: Select all

mountpoint /media/DicoNoir
(May need sudo in some cases)

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: 16Gb SD Full - out of space

Wed May 20, 2015 9:30 pm

The funny thing is that I'm pretty sure I've seen versions of "mount" that will at least warn you if there are files in the directory you are trying to mount something to.

Can't quite place it now, though...
It seems like an obviously desirable functionality.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

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

Re: 16Gb SD Full - out of space

Thu May 21, 2015 6:32 am

Joe Schmoe wrote:The funny thing is that I'm pretty sure I've seen versions of "mount" that will at least warn you if there are files in the directory you are trying to mount something to.

Can't quite place it now, though...
It seems like an obviously desirable functionality.
It might be useful in some circumstances, but I think I'd want it as a feature that has to be enabled by an option, rather than something that pops up with a worrying warning message during start up. /dev is one filesystem that comes to mind.

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

Re: 16Gb SD Full - out of space

Fri May 22, 2015 8:21 am

OK Done ;)

For those who want, here is a script to check and do whatever needed ...
I put this script in crontab every 5 min..and it create a log.. this script can be better, but it does all what I need :)

Chears..

Code: Select all

#! /bin/sh
MyMountPoint='/media/DicoNoir/Video'

Test=`mountpoint $MyMountPoint | grep 'is a mountpoint' | tail -c16 & sleep 5`
if [ "$Test" != "is a mountpoint" ]
then
pkill deluged
echo "$(date) : $MyMountPoint Not mounted" >> /var/log/Verifdeluged.log
exit 1

else

Test=""
Test=`ps -A | grep "deluged"`
if [ "$Test" = "" ]
then
echo "$(date) : $MyMountPoint is mounted - Relaunch Deluge" >> /var/log/Verifde$
deluged
else
echo "$(date) : $MyMountPoint is mounted and Deluged alreay launch" >> /var/log$
fi

fi
exit 0

Return to “General discussion”