Who can help me out, tried to fix it with google but I can’t figure it out.
I tried to install the backup-restore program Amanda, during the installation it asked me for a location to put the files on. Wanted to create a folder somewhere but accidentally pressed enter after /etc/.
So this folder is pretty loaded now, but the biggest problem is that I’m unable to execute sudo anymore.
When I try to execute it, it response:
sudo: /etc/sudoers is owned by uid 34, should be 0
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
I read that the command:
pkexec chown root:root /etc/sudoers /etc/sudoers.d -R
Should restore the permission, but it is asking me for the root password, they say that that user is disabled in OpenHABian, so I can’t run it…
Thanks for the quick reply, if I setup a new OpenHABian system, is it possible to export my current configuration of openhab, influxdb and grafana etc.?
As this backup scripts are especially for openHAB, they will only backup and restore openHAB specific data (i.e. config and persisted data - if stored in $USER_DATA, e.g. MapDB and rrd4j, but not InfluxDB or MsSQL)
Thanks for the quick replies, to execute command openhab-cli you still need to have the sudo right. So I figured that I first need to fix this so I can backup, I have a MacBook (that is linux based) but after trying and reading online, it seems to only mount the boot partition and not the root from a this kind of OS on a SD card.
After some attempts with virtualbox with ubuntu I decided that it will probably work a lot faster if I externally connect the SD card with my other Pi.
But I don’t have a usb card reader for a SD card, will buy that today and try again. Will let it know if it worked
Will try to export the configs for influxdb and grafana separately.
so I was able to make a backup!! Hooray!! It even backed up my /etc/openhab2/persistence/influxdb.persist file
After that I reinstalled Grafana because that wasn’t starting anymore, it still had all the configs I made so I could also make a backup of my dashboard there.
When I got all the files backup’ed and save, I re-imaged OpenHAB. The restore was also successfully after that, when that was done I only had to re-install InfluxDB and Grafana and did some small configs but the most files could be replaced with my older ones.
@Udo_Hartmann ah ok, that’s good to know. Maybe it’s better then to buy another SD card and make a exact copy/clone if your configuration is finished, if something goed wrong you just swap card and you’re good to go again