bmsi
Posts: 3
Joined: Sun May 01, 2016 6:45 am

root file system full

Sun May 01, 2016 7:18 am

the root file system is full, fuser and lsof are no help in locating
any large files. /var/swap has not been accessed for days and many reboots in between
but the file can not be deleted.

But dmesg says
7.158945] Adding 102396k swap on /var/swap. Priority:-1 extents:3 across:1773568k SSFS
so it looks like it is in use

Thanks
Bill

Goraxium
Posts: 122
Joined: Tue Jan 26, 2016 1:42 pm

Re: root file system full

Sun May 01, 2016 11:32 am

If you haven't expanded the file system, do that first. People tend to forget about having to do that (or simply skipped over it in all of the guides).

Another possibility is a power loss that has caused a weird write to occur, completely filling the card (I've had it happen before). If that's the case, reimage the card and it should be fine.

bmsi
Posts: 3
Joined: Sun May 01, 2016 6:45 am

Re: root file system full

Sun May 01, 2016 12:50 pm

Expanded he filesystem before, thanks for the suggestion. I can of course image another card but I was hoping to deliver the rpi3 to my granddaughter today .
Due to the syslog message I think the file is an actual swap file. Would that account for the timestamp of the file not being uptodate ?
This appears to be the largest file on the system
. I did a "ls -lR /' piped into a awk acript that saved the biggest fileand this was the winner.
Thanks for all suggestions

Goraxium
Posts: 122
Joined: Tue Jan 26, 2016 1:42 pm

Re: root file system full

Mon May 02, 2016 12:24 am

Anything that involves saving data that isn't done on an already mounted ram disk, is going to run into issues if you've got no space left. If you have another Linux computer, you could try moving some non critical files onto that, boot the Pi, and then try to change the swap size (assuming whatever caused the problem won't simply fill the rest of the space), and then copy the files back.

How much work have you put into it? Reimaging an sd card, setting the Pi up (after expanding the file system), rebooting, and finally updating, doesn't take a massive amount of time (unless you're writing the image to the SD card through a USB 1.1 port/hub). If you've got another card, you can load everything onto that, then copy everything across from the old card from the Pi itself.

MonsterMadnessMusic
Posts: 38
Joined: Mon Apr 25, 2016 6:28 am

Re: root file system full

Mon May 02, 2016 8:18 am

Hi,

you could try locating large files by

Code: Select all

 
cd /
find -size +100M 2> /dev/null
which should give you all files which are bigger than 100 MB on the filesystem. The 2> /dev/null throws the error messages which will occur ("permission denied") into the garbage/black hole.

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

Re: root file system full

Mon May 02, 2016 8:22 am

If you've been running regular apt-get upgrade you may have a load of old package files sitting in the apt cache.

"sudo apt-get clean" will get rid of those.

MonsterMadnessMusic
Posts: 38
Joined: Mon Apr 25, 2016 6:28 am

Re: root file system full

Mon May 02, 2016 8:32 am

Yes, that is true. You could also try

Code: Select all

 sudo apt-get autoclean 
and

Code: Select all

 
cd /
du -h | sort -h 
to find large directories as well as large files.

bmsi
Posts: 3
Joined: Sun May 01, 2016 6:45 am

Re: root file system full

Tue May 03, 2016 7:41 pm

Re-imaged the card, actually took the opportunity to move to a larger card.

This time I used NOOBS. Last time I did it by hand.

No big deal. I had setup the rpi3 to be a server:acaphe2, php5, ftp.

Still don't know why the file system went from 1% to 100%. I have saved the card
maybe I'll figure it out some day.

Thanks for the suggestions !

Btw, the /var/swap seems real enough. I have seen it on several rpi3s now. Isn't a 104MB swap file
a little skimpy on a 2GB system ?

I consider this problem closed.

MonsterMadnessMusic
Posts: 38
Joined: Mon Apr 25, 2016 6:28 am

Re: root file system full

Tue May 03, 2016 8:12 pm

Maybe. But why use a 2 GB card at all? 8 GB are not really more expensive these days.

You could also test if your system runs stable with a smaller swapfile or even after

Code: Select all

 sudo swapoff -a 
(no swapping unless there is no system memory left).

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

Re: root file system full

Wed May 04, 2016 5:27 am

bmsi wrote:Btw, the /var/swap seems real enough. I have seen it on several rpi3s now. Isn't a 104MB swap file
a little skimpy on a 2GB system ?
Ideally you wouldn't want any swap space at all. If it is configured, it is only as an emergency buffer.

Swapping is slow. On the order of many thousands of times slower than normal RAM. You really don't want to be in a situation where that is happening.

1GB of memory should be enough for any app you run on a Pi. If you appear to need more you are either using the wrong platform, have too many things running (in which case get more Pis and share the load :) ), or have badly written code.

Return to “Troubleshooting”