mattwelter
Posts: 1
Joined: Fri Jun 18, 2021 6:38 am

Pi 4 – /dev/root 100% full can't do anything

Fri Jun 18, 2021 7:10 am

This is my first time posting on this forum.

/dev/root is 100% full
64gb SD card
Raspberry Pi 4 running Debian


I have a few guesses but not sure how to go about fixing it.

Other than running 4 Twitter bots using Python (takes up super super little space), I run 5-10 Selenium Chromedriver instances a day on the pi for automating a "few" online processes. That's the only things I use the pi for. So, I was assuming it had to do with Chromedriver's cache, or log, or something. But I cleared the Chromedriver cache and /dev/root went from 100% to 99%, so I'm not sure what's taking up all this space.

Image

Honestly not too sure what else to provide. This has never been a problem. Maybe I just never checked storage as much as I actually should have.

User avatar
topguy
Posts: 7189
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Pi 4 – /dev/root 100% full can't do anything

Fri Jun 18, 2021 9:18 am

if you add "-h" to your "df" ( and "du" ) commands it will print more readable size values ( GB and MB ).

How was your SD card created/imaged ?

I guess...

Code: Select all

sudo fdisk -l /dev/mmcblk0
should list the partitions on the SD card..

cleverca22
Posts: 4008
Joined: Sat Aug 18, 2012 2:33 pm

Re: Pi 4 – /dev/root 100% full can't do anything

Fri Jun 18, 2021 10:35 am

topguy wrote:
Fri Jun 18, 2021 9:18 am
if you add "-h" to your "df" ( and "du" ) commands it will print more readable size values ( GB and MB ).
the "df -m" in the screenshot just forces it to always be in mb, it looks like a 56gig rootfs, within the expected rounding errors due to 1000 vs 1024

my advise would be to run "ncdu /" and then browse around to see where all of the used space has gone to

User avatar
jahboater
Posts: 7203
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: Pi 4 – /dev/root 100% full can't do anything

Fri Jun 18, 2021 10:52 am

cleverca22 wrote:
Fri Jun 18, 2021 10:35 am
my advise would be to run "ncdu /" and then browse around to see where all of the used space has gone to
You learn something new all the time! Thanks

I have been using

du <dir> | sort -rn | .....

for several decades, but this ncurses version is much better.

swampdog
Posts: 734
Joined: Fri Dec 04, 2015 11:22 am

Re: Pi 4 – /dev/root 100% full can't do anything

Fri Jun 18, 2021 11:03 am

Assuming you can't install any more packages..

Code: Select all

$ sudo du -ks /* | sort -n -k1
..biggest number (ie: sizes) toward the bottom. That identifies the folders to pay most attention to first then drill down manually. eg:

Code: Select all

foo@pi20:~ $ sudo du -ks /* | sort -n -k1
du: cannot access '/proc/1852/task/1852/fd/4': No such file or directory
du: cannot access '/proc/1852/task/1852/fdinfo/4': No such file or directory
du: cannot access '/proc/1852/fd/3': No such file or directory
du: cannot access '/proc/1852/fdinfo/3': No such file or directory
du: cannot access '/run/user/1000/gvfs': Permission denied
0	/bin
0	/dev
0	/lib
0	/proc
0	/sbin
0	/sys
4	/nohup.out
4	/srv
12	/opt
16	/lost+found
28	/mnt
56	/root
64	/tmp
6488	/etc
8860	/run
30056	/boot
500428	/var
1020580	/wrk
3524356	/home
5767548	/usr
10023164	/media

foo@pi20:~ $ sudo du -ks /wrk/* | sort -n -k1
0	/wrk/rcl.sh.lck
4	/wrk/c.cc
4	/wrk/dns.pub
4	/wrk/finit.log
4	/wrk/finit.sh
4	/wrk/fipaddr.log
4	/wrk/fipaddr.sh
4	/wrk/rcl.log
4	/wrk/rcl.sh
4	/wrk/rinit.log
4	/wrk/rinit.sh
4	/wrk/sdu.pub
4	/wrk/wibble
4	/wrk/wotzit
4	/wrk/z
4	/wrk/z.c
12	/wrk/c
12	/wrk/lo.tar
12	/wrk/XPT2046.tar
24	/wrk/z-sm.000
24	/wrk/z-sm.001
24	/wrk/z-sm.002
24	/wrk/z-sm.003
24	/wrk/z-sm.004
132	/wrk/sd.tar
5732	/wrk/barrier.tar
41648	/wrk/nomachine_7.4.1_1_armhf.deb
47520	/wrk/wrk.tar
925328	/wrk/TT

foo@pi20:~ $ sudo du -ks /wrk/TT/* | sort -n -k1
60696	/wrk/TT/Urho3D-1.7.1-Source.tar.gz
152444	/wrk/TT/Urho3D-1.7.1
712184	/wrk/TT/obj
..looks like I left /wrk/TT/obj/ lying about so that's a candidate for removal.

cleverca22
Posts: 4008
Joined: Sat Aug 18, 2012 2:33 pm

Re: Pi 4 – /dev/root 100% full can't do anything

Fri Jun 18, 2021 11:06 am

swampdog wrote:
Fri Jun 18, 2021 11:03 am
Assuming you can't install any more packages..

Code: Select all

$ sudo du -ks /* | sort -n -k1
..biggest number (ie: sizes) toward the bottom. That identifies the folders to pay most attention to first then drill down manually. eg:

Code: Select all

foo@pi20:~ $ sudo du -ks /* | sort -n -k1
du: cannot access '/proc/1852/task/1852/fd/4': No such file or directory
du: cannot access '/proc/1852/task/1852/fdinfo/4': No such file or directory
du: cannot access '/proc/1852/fd/3': No such file or directory
du: cannot access '/proc/1852/fdinfo/3': No such file or directory
du: cannot access '/run/user/1000/gvfs': Permission denied
0	/bin
0	/dev
0	/lib
0	/proc
0	/sbin
0	/sys
4	/nohup.out
4	/srv
12	/opt
16	/lost+found
28	/mnt
56	/root
64	/tmp
6488	/etc
8860	/run
30056	/boot
500428	/var
1020580	/wrk
3524356	/home
5767548	/usr
10023164	/media

foo@pi20:~ $ sudo du -ks /wrk/* | sort -n -k1
0	/wrk/rcl.sh.lck
4	/wrk/c.cc
4	/wrk/dns.pub
4	/wrk/finit.log
4	/wrk/finit.sh
4	/wrk/fipaddr.log
4	/wrk/fipaddr.sh
4	/wrk/rcl.log
4	/wrk/rcl.sh
4	/wrk/rinit.log
4	/wrk/rinit.sh
4	/wrk/sdu.pub
4	/wrk/wibble
4	/wrk/wotzit
4	/wrk/z
4	/wrk/z.c
12	/wrk/c
12	/wrk/lo.tar
12	/wrk/XPT2046.tar
24	/wrk/z-sm.000
24	/wrk/z-sm.001
24	/wrk/z-sm.002
24	/wrk/z-sm.003
24	/wrk/z-sm.004
132	/wrk/sd.tar
5732	/wrk/barrier.tar
41648	/wrk/nomachine_7.4.1_1_armhf.deb
47520	/wrk/wrk.tar
925328	/wrk/TT

foo@pi20:~ $ sudo du -ks /wrk/TT/* | sort -n -k1
60696	/wrk/TT/Urho3D-1.7.1-Source.tar.gz
152444	/wrk/TT/Urho3D-1.7.1
712184	/wrk/TT/obj
..looks like I left /wrk/TT/obj/ lying about so that's a candidate for removal.
you want to add a -x to that du command
that will stop it from trying to traverse /proc and /dev
you can also use du -h | sort -h, to make it human readable, and still sort right

but from the screenshot, the OP has 600mb free now, so plenty of room to install ncdu, which is far more usable

User avatar
jahboater
Posts: 7203
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: Pi 4 – /dev/root 100% full can't do anything

Fri Jun 18, 2021 12:27 pm

cleverca22 wrote:
Fri Jun 18, 2021 11:06 am
but from the screenshot, the OP has 600mb free now, so plenty of room to install ncdu, which is far more usable
No need to install ncdu on Pi OS.
It is included by default, even on the Lite version.

With ncdu, drill down is just pressing <return> when the cursor is over a directory.

cleverca22
Posts: 4008
Joined: Sat Aug 18, 2012 2:33 pm

Re: Pi 4 – /dev/root 100% full can't do anything

Fri Jun 18, 2021 12:29 pm

jahboater wrote:
Fri Jun 18, 2021 12:27 pm
With ncdu, drill down is just pressing <return> when the cursor is over a directory.
left/right arrows also work, so you can drill down very quickly with just the arrow keys, and back out if you go down a wrong path

Return to “Troubleshooting”