EmonPI Drive Space

Can we address the disk space on the current image. once again the / partion has ran out of space.

image

I have 21G free on /var/opt/emoncms

What are you writing to the root partition? Not data hopefully as that will kill the SD Card.

Do you have something other than emonCMS installed?

[edit]

use

sudo du -a / | sort -n -r | head -n 20

to find the largest files.

I have got an open PR on the emonScripts repo that will fix the script install such that it allocates 10GB as the data partition on disks over 16GB.

This will not affect emonSD installs - the root partition is fixed in the image.

nothing else installed. they was a backup file in /opt/openenergymonitor/data

Ah, that has changed (for just this reason) but perhaps not been percolated through in the updates @TrystanLea?

edit the backup config file /opt/emoncms/modules/backup/config.cfg

Mine looks like this

# Emoncms Export and Import scripts config file

## DEFAULT CONFIG ##

# These settings are used for both the export and import scripts.
# To export from one location and import into another
# Used by both PHP and Bash and comments are not ignored

# Change all capitalised placeholders to relevant locations

# user
user="pi"

backup_script_location="/opt/emoncms/modules/backup"

# Directory location of Emoncms
emoncms_location="/var/www/emoncms"

# Destination location of exported backup .tar.gz - Must be writable
backup_location="/var/opt/emoncms/backup"

# location of phpfina phpfiwa and phptimeseries databases
database_path="/var/opt/emoncms"

# Location of emonhub.conf - leave blank if backup not required
emonhub_config_path="/etc/emonhub"

# Location of specimen emonhub config
emonhub_specimen_config="/opt/openenergymonitor/emonhub/conf"

# Location of compressed backup data to import .tar.gz
backup_source_path="/var/opt/emoncms/backup/uploads"

you may need to adjust permissions

pi@emonpi:/opt/emoncms/modules/backup $ ls -la /var/opt/emoncms/
total 21
drwxr-xr-x 7 root     root  1024 Jan 22 17:16 .
drwxr-xr-x 3 root     root  4096 Oct 17  2019 ..
drwxr-xr-x 3 pi       pi    1024 Mar 27 18:36 backup
drwx------ 2 root     root 12288 Oct 17  2019 lost+found
drwxr-xr-x 2 www-data root  1024 Apr 16 06:38 phpfina
drwxr-xr-x 2 www-data root  1024 Oct 17  2019 phpfiwa
drwxr-xr-x 2 www-data root  1024 Oct 17  2019 phptimeseries
pi@emonpi:/opt/emoncms/modules/backup $ ls -la /var/opt/emoncms/backup
total 9272
drwxr-xr-x 3 pi       pi      1024 Mar 27 18:36 .
drwxr-xr-x 7 root     root    1024 Jan 22 17:16 ..
-rw-r--r-- 1 pi       pi   9433622 Mar 27 18:35 emoncms-backup-2020-03-27.tar.gz
-rw-r--r-- 1 pi       pi     18131 Mar 27 18:35 emoncms.sql
drwxr-xr-x 2 www-data pi      1024 Jan 22 17:16 uploads

I think it relates to the old location and the bug.

I still dont understand why the / cannot be the whole size of the SD card. and yet /var/opt/emoncms can!

Quite a lot of work went into making the SD card life as long as possible.

The data partition is therefore a different format to maximise the life of the card, the emonSD image is designed for use with emonCMS - if you want a multiuse image, install emoncms with the emonScripts but leave out the partition part of the setup.

However, you run the risk of the card failing early.

As I said, there is a modification such that the data partition will be limited to10GB in future.