Pi Gateway Error: ENOSPC, write [solved]

Started by Memnon, November 23, 2015, 06:09:05 AM

Memnon

Had this gateway up and running for 2 weeks now. But today i can not connect to web ui. It only shows "Waiting for socket connection"

I tried to restart the raspberry pi, without any luck.
In the console i get this error message when i try to restart the gateway.
Anyone had this error before?

pi@raspberrypi ~/moteino $ node gateway.js &
[1] 1832
pi@raspberrypi ~/moteino $
/home/pi/moteino/node_modules/nedb/lib/datastore.js:67
    if (err) { throw err; }
                     ^
Error: ENOSPC, write

Felix

I haven't seen this particular error before. Looks like neDB cannot write to a file. It is only supposed to write to 2 files.
Can you check the integrity of your gateway.db file or gateway-nonmatches.db?
In the worst case scenario I would try to remove that file or rename it if it's corrupted and restart to see if that fixes it.
There is an ongoing fix for neDB that is supposed to take care of the database purging issue reported in this post and submitted here.

Memnon

Quote from: Felix on November 23, 2015, 07:49:50 AM
I haven't seen this particular error before. Looks like neDB cannot write to a file. It is only supposed to write to 2 files.
Can you check the integrity of your gateway.db file or gateway-nonmatches.db?
In the worst case scenario I would try to remove that file or rename it if it's corrupted and restart to see if that fixes it.
There is an ongoing fix for neDB that is supposed to take care of the database purging issue reported in this post and submitted here.


Ok I found out what was the cause of this error.  /root  was full. I have a 32GB SD card running in the pi, but i see that it does not use all the avalible space on it. Is there a way to make it use all the avalible space on the sd card?


Felix

Yes, expand the file system with raspi-config

Memnon

Quote from: Felix on November 25, 2015, 08:40:18 AM
Yes, expand the file system with raspi-config

The raspi-config did not work.

What i did was:
sudo fdisk /dev/mmcblk0
p                                //view the existing table   Take not on start block of partition 2
d 2                             //deleted main partition
n p 2                         //Make a new partition, you need to enter the start of the old main partition and then the size (enter for complete SD card)
w                               //write the new partition table

sudo shutdown -r now                              //Now reboot

sudo resize2fs /dev/mmcblk0p2               //After the reboot you need to resize the filesystem on the partition


That did the job, now it uses the hole SD Card   :)