Backup can not save everything, because /tmp is to small on RasPi

HI.
I tried to make a backup of my openhab installation.
I get some errors, telling me, that there is not space left in /tmp/…
I can see, that my raspberry pi has a tmp folder with a limit of 200MB, which seems to small.
How can i extend the /tmp folder?
Thanks

Is your Pi used for OH only and how did you install OH?

What do you mean by “tried to make a backup of my OH installation” ? openhab-cli backup ? Amanda ? Manual copies ? of what ?? openhab-cli shouldn’t result in 200 MB
You don’t want to extend /tmp. If you’re already using 200 MB for /tmp (out of 1024 MB that a Pi has, /tmp is on an in-memory filesystem !!) you’re already putting openHAB at risk to work properly.
Move to a proper setup. Mount a USB device or network share and put your backup there.
Better yet, use openHABian and setup Amanda.

1 Like

At the moment, a backup also includes the tmp and cache folders and these folders do get fairly large, there’s a PR in the works to change the default behaviour not to do this.

It’s likely that /tmp is on some sort of temporary file system, in that case 200MB would indeed be quite large. Might be best to clean the openHAB cache first before doing a backup if all you’re after is to backup the configuration and not the exact state.

hi.
i cleared the cache and tmp folder.
after that i tried a backup via

$OPENHAB_RUNTIME/bin/backup

i still get the same errors

root@***:/etc/init.d $OPENHAB_RUNTIME/bin/backup

#########################################
       openHAB 2.x.x backup script       
#########################################
                                         
Using '/etc/openhab2' as conf folder...
Using '/var/lib/openhab2' as userdata folder...
Using '/usr/share/openhab2/runtime' as runtime folder...
Using '/var/lib/openhab2/backups' as backup folder...
Writing to '/var/lib/openhab2/backups/openhab2-backup-18_09_15-11_19_18.zip'...
Making Temporary Directory
Copying configuration to temporary folder...
cp: error writing '/tmp/openhab2/backup/userdata/tmp/kar/openhab-addons-2.3.0/org/apache/httpcomponents/httpcore-osgi/4.2.3/httpcore-osgi-4.2.3.jar': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/tmp/kar/openhab-addons-2.3.0/org/apache/httpcomponents/httpclient-osgi/4.2.3/httpclient-osgi-4.2.3.jar': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/tmp/kar/openhab-addons-2.3.0/org/apache/derby/derbyclient/10.12.1.1/derbyclient-10.12.1.1.jar': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/tmp/kar/openhab-addons-2.3.0/org/hsqldb/hsqldb/2.3.3/hsqldb-2.3.3.jar': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/tmp/kar/openhab-addons-2.3.0/org/mariadb/jdbc/mariadb-java-client/1.3.5/mariadb-java-client-1.3.5.jar': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/tmp/kar/openhab-addons-2.3.0/org/postgresql/postgresql/9.4.1212/postgresql-9.4.1212.jar': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/tmp/kar/openhab-addons-2.3.0/org/xerial/sqlite-jdbc/3.16.1/sqlite-jdbc-3.16.1.jar': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/tmp/kar/openhab-addons-2.3.0/com/jayway/jsonpath/json-path/2.1.0/json-path-2.1.0.jar': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/tmp/kar/openhab-addons-2.3.0/com/zsmartsystems/zigbee/com.zsmartsystems.zigbee/1.0.11/com.zsmartsystems.zigbee-1.0.11.jar': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/tmp/kar/openhab-addons-2.3.0/com/zsmartsystems/zigbee/com.zsmartsystems.zigbee.dongle.cc2531/1.0.11/com.zsmartsystems.zigbee.dongle.cc2531-1.0.11.jar': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/tmp/kar/openhab-addons-2.3.0/com/zsmartsystems/zigbee/com.zsmartsystems.zigbee.dongle.ember/1.0.11/com.zsmartsystems.zigbee.dongle.ember-1.0.11.jar': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/tmp/kar/openhab-addons-2.3.0/com/zsmartsystems/zigbee/com.zsmartsystems.zigbee.dongle.telegesis/1.0.11/com.zsmartsystems.zigbee.dongle.telegesis-1.0.11.jar': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/tmp/kar/openhab-addons-2.3.0/com/zsmartsystems/zigbee/com.zsmartsystems.zigbee.dongle.xbee/1.0.11/com.zsmartsystems.zigbee.dongle.xbee-1.0.11.jar': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/tmp/kar/openhab-addons-2.3.0/com/h2database/h2/1.4.191/h2-1.4.191.jar': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/tmp/kar/openhab-addons-2.3.0/net/minidev/accessors-smart/1.1/accessors-smart-1.1.jar': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/tmp/kar/openhab-addons-2.3.0/net/minidev/json-smart/2.2/json-smart-2.2.jar': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/tmp/kar/openhab-addons-2.3.0/mysql/mysql-connector-java/5.1.38/mysql-connector-java-5.1.38.jar': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/tmp/kar/openhab-addons-2.3.0/features.cfg': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/tmp/karaf.pid': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/tmp/port': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/uuid': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/xmpp.rocks/rosterver/0d1eef9c5e225b38fccf2efcef4fdf6a22238ce3.xml': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/xmpp.rocks/caps/bf1c618d8ed7fae9fbe53af00efa05fbd759870f.caps': No space left on device
cp: error writing '/tmp/openhab2/backup/userdata/xmpp.rocks/caps/d19c39d979887e5d436844d5448446ac8b729863.caps': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/html/index.html': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/html/readme.txt': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/icons/classic/readme.txt': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/items/readme.txt': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/persistence/readme.txt': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/rules/readme.txt': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/rules/exit': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/rules/rollo.rules': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/scripts/readme.txt': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/services/addons.cfg': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/services/readme.txt': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/services/runtime.cfg': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/services/http.cfg': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/services/tcp.cfg': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/sitemaps/readme.txt': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/sounds/doorbell.mp3': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/sounds/barking.mp3': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/things/readme.txt': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/transform/de.map': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/transform/readme.txt': No space left on device
cp: error writing '/tmp/openhab2/backup/conf/transform/en.map': No space left on device
Removing unnecessary files...
Backup Directory is inside userdata, not including in this backup!
Zipping folder...
Removing temporary files...
Success! Backup made in /var/lib/openhab2/backups/openhab2-backup-18_09_15-11_19_18.zip

Exactly which tmp folder did you clear? I get the feeling your openhab tmp still isn’t empty. The directories you need to clear are /var/lib/openhab2/tmp and /var/lib/openhab2/cache.

i cleard both folder
/var/lib/openhab2/tmp and /var/lib/openhab2/cache
i think the problem is, that my /tmp folder has a maximum space of 200Mb

If you cd to /var/lib/openhab2/tmp
and type this du -sh * | sort -h
what’s the output?

I’m using a openhabian, here is a snapshot of my tmp

Screenshot%20at%202018-09-15%2007-45-08

1 Like

No. You either already have used much of those 200MB, so clear /tmp first.
Or you’ve put additional data into /var/lib/openhab2/ or any of the other dirs to get backed up that does not belong there but gets backed up, too. Delete that.
Either way, as I said: don’t backup to /tmp. Attach more disk space and backup there (use openhab-cli backup destination).

As @mstormi mentioned you may have addition data that’s exceeding the 200M.

I use openhab-cli to make backups and just checked the last 4 backups made, the largest is 103M zipped up. I normally don’t bother with clearing the tmp before a backup, can’t say if that’s a good idea or not but never had an issue.

As mentioned above, change the backup destination and see what happens.

The backup script uses /tmp as an intermediate destination while it is preparing files. This error would occur where ever you choose to install.

Although it still looks like theres a large number of files in the /var/lib/openhab2/tmp directory. What command did you use to clear it? Is /tmp/ already too full as @mstormi suggested ?

With https ://github.com/openhab/openhab-distro/pull/780/commits it should be possible to have backups with more than 200 MB.