Over the last couple of weeks I have been plagued by my Raspberry Pi telling me it has run out of space. I have reformatted the SD card (32GB) and reloaded Hassbian several times, and things run fine for a couple of says before it stops working again and shows the same warning.
I started using a new SD card yesterday and all was working well until I amended by sensors.yaml file. I am trying to add two SMA Sunny Boys (but that’s another story). The run out of space error has recurred. I am unable to open the sensors.yaml, or at least when I do it is completely empty, as are all the other home assistant files. I can see that the /dev/root directory is completely full but I don’t know what to do with it. I have another RPi running Hassbian and this is showing 14% use of this directory.
Thanks for any advice. Is there a problem with the Raspberry Pi hardware?
This is the error I am getting:
homeassistant@hassbian:~/.homeassistant $ nano sensors.yaml
Unable to create directory /home/homeassistant/.nano: No space left on device
It is required for saving/loading search history or cursor positions.
I have used etcher too with good results. I just know the makers of the Pi say to use the SD Formatter before installing an image in an SD Card. It has worked for me and helped others here.
Thanks for the rapid response, very helpful. I have been using SD Memory Card Formatter and doing an Overwrite format, then using Balanetcher to put on the hassbian image.
I have run through this process again, and ended up with a fresh install with the following:
So, the pre-existing problem of the full card not being used occurred again.
I tried cinquemic’s solution:
pi@hassbian:~ $ sudo resize2fs /dev/mmcblk0p2
resize2fs 1.43.4 (31-Jan-2017)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 2
The filesystem on /dev/mmcblk0p2 is now 7779456 (4k) blocks long.
Now the full card is being used.
Superb solution cinquemic, bang on!
As well as running out of space over the last 2 weeks my RPi has been mysteriously getting stuck at the username, refusing to recognise my private key and dropping out when I used my password. Hopefully this has been caused by the 2GB limit as well.
Also a bit odd but my other RPi which is running another Home Assistant instance, and for which I use the same SD Card Formatter and BalanaEtcher is showing it’s full 16GB size.
Thanks again!
If you have installed Raspbian using NOOBS, the filesystem will have been expanded automatically. There may be a rare occasion where this is not the case, e.g. if you have copied a smaller SD card onto a larger one. In this case, you should use this option to expand your installation to fill the whole SD card, giving you more space to use for files. You will need to reboot the Raspberry Pi to make this available. Note that there is no confirmation: selecting the option begins the partition expansion immediately.
The strange thing is that I write Hassbian image a lot of times and this is never happened.
Only with the latest image I have to expand the file system.