Failed to write to 'state.settings'. ENOSPC: no space left on device.

I am trying to open terminal on cloud9 IDE , IDE shows “Failed to write to ‘state.settings’. ENOSPC: no space left on device.”
When I execute the command df -h I am getting the below output

Filesystem Size Used Avail Use% Mounted on
udev 212M 0 212M 0% /dev
tmpfs 49M 392K 49M 1% /run
/dev/mmcblk0p1 3.4G 3.3G 0 100% /
tmpfs 242M 0 242M 0% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 242M 0 242M 0% /sys/fs/cgroup
tmpfs 49M 0 49M 0% /run/user/1000

what should I do now?

Aji Mathew.

Delete some files you don’t need.
Make sure you are not logging anything to the emmc, if you must log divert it to SD card.

$find -size 2M | ls -sh

2M = 2 meg file size
1G= 1 gig file size

Hi @foxsquirrel
How do I know the files that are not necessary?

Thanks ,
Aji Mathew

First round would be to look at the file size and then identify what program they are associated with.

Be careful deleting stuff because you can break the OS and the board will not boot, not too scare you, just let you know.

Here is an example

fred@eng-dev2:~/Pictures$ find -size 2M | ls -sh
total 3.7M
532K  bitmap.png                1.3M  rose800x480.png.svg
4.0K  drawing.svg               1.4M  rose-flower-blossom-bloom-39517.jpeg
108K  makefile_netbeans.png      56K 'services=tab.png'
 20K  natilus-connect.png        64K  x-2.png
 60K  netbeans-host-setup.png    56K  x-3.png
100K  netbeans-select-host.png   52K  x.png
 16K  path-on-target.png

I know for fact those .png are screen shots, so something like that would be a good first round of files to delete.

1 Like

Thank for the reply @foxsquirrel , When I execute command I find the files that are created by me. No unnecessary files it seems. What shall I do then?
Also How should I make sure that the log files are not stored in eMMC?

debian@beaglebone:/home/nanatom/003spireceive$ find -size 2M | ls -sh
total 60K
12K a.out 12K exe 4.0K 4.0K
20K data.txt 4.0K spi.c 4.0K

Go into a top level directory and execute that command, you are only looking at files in your “user space home”

$cd /
$ls -alsh

You should see core OS files

Mount an SD card and use that for your log files, set the configuration of the software you are using to point at the SD card. That assumes the log file (s) are not hard coded into your program.

Also, what image are you using and what software package is generating the error?

You might be at point where you need to boot and run from SD card. I see you have some python and that takes up some room too. Might try burning a current image on SD install your software then just boot from and work out of the SD. That is usually the simplest way to go until your plan comes together. When its dialed in load in to emmc.

Hello @foxsquirrel

I am using LXQT buster image. Initially, It was working fine . But Now I am facing the issue that “no space left on device” from cloud9 IDE . Then I tried with SSH (kitty). Again I couldn’t compile any C file because of this memory issue. The image was flashed in the SD card and I am booting the BBB from SD itself. No eMMC image was used.

Later , I flashed my BBB with Console image . The console image was not even supported. I don’t know Why?

What size SD card are you using ?

When you copy an image to an SD card it creates a small partition only. It doesn’t fil the SD card.

On newer versions it automatically resizes when you boot ( need to reboot after).
On older images I think you need to run a script to resize the partition. From a quick Google does this exist?


Will need to run it as root or use sudo

Hello @benedict.hewson

32GB SD card I am using . I am not able see my BBB as local device in my PC and also I can’t open cloud9


Are you able to ssh into it or use the linux debug port with an USB adapter?


You have a few options.

  1. If you have a serial console cable I would try that, or perhaps ssh.

  2. you could re-flash the sd card and then expand the partetion before going any further. Obviously you would lose anything on the card.

  3. Assuming your computer is not running Linux, get hold of a live install (probably go with Ubuntu) and stick it on a USB stick. Boot that and then use the disk tools to increase the sd card partition. Might be doable using WSL, but I don’t use Windows so have no idea.

Yes, I can but now I am using IOT Distribution . After flashing I ran the grow partition script file .


I could see that the size of the device node was increased to 30GB (size of the uSD card).

/dev/mmcblk0p1 30G 2.5G 26G 9% /

The other thing I noticed that the available space of the /dev/mmcblk0p1 is gradually decreasing(Initially 2496722 was used space but now it becomes 2516752 as used ) as I do some C file execution so and so .

My doubt is why the space occupation is happening so fast as I expected .

Thanks ,
Aji Mathew.

It is probably just log files. I don’t know what the log limits are set to on the Beagle but it should not keep increasing, assuming you are not using the space with your software.

In a console as root you could run

du -sb /

It will give you a listing of the bytes used by each top directory. Make a note of it and run again in a few days to see what has changed.

Hello @benedict.hewson , Is there any way to limit the log files space
Thanks ,
Aji Mathew

There is logrotate.conf in /etc and probably some files in /etc/logrotate.d/

However as the OS is designed to run on a beaglebone with a small eMMC I would expect there to be limits already set up.


#see “man logrotate” for details
#rotate log files weekly
#keep 4 weeks worth of backlogs
rotate 4
#create new (empty) log files after rotating old ones
#use date as a suffix of the rotated file
#uncomment this if you want your log files compressed
#packages drop log rotation information into this directory
include /etc/logrotate.d
#system-specific logs may be also be configured here.

If you don’t use the logs just comment them out.

#rotate 4

I could be wrong on doing this, at this moment in time it seems okay.