After having fucked up my openHAB installation I had to set up my openHABianPi from scratch and took the opportunity to write down the necessary steps. Mainly for myself, so that next time I wouldn’t have to search for all the different tutorials, always hoping not to forget any of the options I deem necessary…
And perhaps some of you can use this guide in a similar situation - or just as inspiration which options might be useful.
open openHABian Configuration Tool: sudo openhabian-config
Check for updates - run the following options
01 | Update
02 | Upgrade System
10 | Apply Improvements
11 | Packages
12 | Bash&Vim Settings
13 | System Tweaks
14 | Fix Permissions
15 | FireMotD
30 | System Settings
34 | Change Passwords
all: you should not use any of the default passwords - do not skip this step because you think you will take care of that one later…
test if the password change did work - somehow the Config Tool doesn’t work for me in regard to password changes. If you have the same trouble the following comands should do the trick for you:
Linux system: passwd
openHAB Console: sudo passwd openhab
Samba: sudo smbpasswd openhabian
Amanda backup: sudo passwd backup
31 | Change Hostname - choose an individual hostname
remember to use the new hostname when you reconnect via ssh
32 | Set System Locale
set if you want to change the system language, for example to display weekdays on your sitemaps in your local language
40 | openHAB related
42 Remote Console
enter the password for ‘openHAB Console’ you selected during the step ‘Change Passwords’
test from a different computer ( stands for the hostname selected in step ‘Change Hostname’): ssh -p 8101 openhab@<hostname>
Close openHAB config with ‘ESC’
reboot: sudo reboot
SSD / Grafana / InfluxDB
Disclaimer: I’m not using Grafane & InfluxDB anymore since they seem to overwork my Raspi 3B setup (RAM use always at more than 90%, reliability of rule execution way lower than what I’m used to). Might use these tools again in the future if I switch to a more powerfull server
If you wish to use Grafana & InfluxDB to persist and display stuff, you might also wish to switch your openHAB system to an external USB drive both both to protect your SD card from wear by to many write cycles and a growing database…
Since USB sticks have the same limitations as SD cards you should choose an USB HDD or SSD. If you consider buying a new HDD / SSD for that purpose I recommend to research a bit in regard to how much power the Raspy can deliver vs what your device needs, if your Raspy is able to boot from USB, if the Raspy is able to boot from your specific HDD / SSD, …
In my case the Raspy is not able to boot from my SSD, so I boot from SD card and have everything else on my SSD.
Move root to an SSD
connect USB drive to your openHABianPi
open openHABian Configuration Tool: sudo openhabian-config
30 | System Settings - 37 | Move root to USB
reboot
Install Grafana & InfluxDB
open openHABian Configuration Tool: sudo openhabian-config
In the current form it’s more of a work log, I think for the wiki it would need a little bit more polish
On the other hand I would appreciate it if someone would take this post as groundwork for a wiki entry
Thx for your trust - but I have never actually used Amanda to restore after a crash, so I can’t really help you with that.
A quick search in this forum for „Amanda restore“ points you to some posts that might be helpful, for example this one https://community.openhab.org/t/solved-restore-amanda-backup/
Then read it again. Twice if needed. Don’t hurry but take your time to understand what’s written.
Yes OH and Amanda expect users to invest a fair minimum of their own time and thinking.
You are welcome to get back here with concrete questions, but not with an overall ‘lazy’ one like this.
And please follow the rules in here: How to ask a good question / Help Us Help You - Tutorials & Examples - openHAB Community
Karkus
I was directed to use a USB to protect my SD card by BK Hobby but when I tried to execute “Move root to USB” (37)to said that I needed to cancel -uninstall i think- zram.
The video was 2018 and not sure if I should “Uninstall ZRAM” (39) second selection or use it.
It appears you were directed by somebody else’s video to do something different than the official documentation. Since Markus wrote that documentation I think you have your answer.
I will follow the documentation instead of Utube since it is likely the Utube is not up to date.
Based on the DOCs, I want to use the Amanda Network Backup automatic mode. The backup storage will be my USB stick
This will be set up to backup everything except the SD card. My understanding is to back up the SD card by removing it from the Pi and copy it directly to another BU SD card. I have only 1 SD card slot on my computer so I plan to copy it to a local disk and then copy to the BU SD chip. Is this correct?
Then in the Amanda auto back-up configuration, I need to know the disk drive that my USB is connected to. I followed the suggested link: https://linoxide.com/linux-how-to/how-to-mount-drive-in-linux, and this was the response to the command: mount -t ext4
/dev/mmcblk0p2 on / type ext4 (rw,noatime)
/dev/mmcblk0p2 on /opt/zram/log.bind type ext4 (rw,noatime)
/dev/zram1 on /opt/zram/zram1 type ext4 (rw,noatime)
/dev/mmcblk0p2 on /opt/zram/persistence.bind type ext4 (rw,noatime)
/dev/zram2 on /opt/zram/zram2 type ext4 (rw,noatime)
/dev/mmcblk0p2 on /srv/openhab2-userdata type ext4 (rw,noatime)
/dev/mmcblk0p2 on /srv/openhab2-conf type ext4 (rw,noatime)
/dev/mmcblk0p2 on /srv/openhab2-addons type ext4 (rw,noatime)
/dev/mmcblk0p2 on /srv/openhab2-sys type ext4 (rw,noatime)
Is the drive in this response? If not, how do I find it?
I understand that I also need to “prepare your storage by creating a directory somewhere and by then mounting the USB device or disk you’ve previously exported (= shared, i.e. made available for mounting) on that directory.”
I have not exported to the the attached disk. My usb is installed. When I execute fdiski -l I got this:
fdisk: cannot open /dev/ram0: Permission denied
fdisk: cannot open /dev/ram1: Permission denied
fdisk: cannot open /dev/ram2: Permission denied
fdisk: cannot open /dev/ram3: Permission denied
fdisk: cannot open /dev/ram4: Permission denied
fdisk: cannot open /dev/ram5: Permission denied
fdisk: cannot open /dev/ram6: Permission denied
fdisk: cannot open /dev/ram7: Permission denied
fdisk: cannot open /dev/ram8: Permission denied
fdisk: cannot open /dev/ram9: Permission denied
fdisk: cannot open /dev/ram10: Permission denied
fdisk: cannot open /dev/ram11: Permission denied
fdisk: cannot open /dev/ram12: Permission denied
fdisk: cannot open /dev/ram13: Permission denied
fdisk: cannot open /dev/ram14: Permission denied
fdisk: cannot open /dev/ram15: Permission denied
fdisk: cannot open /dev/mmcblk0: Permission denied
fdisk: cannot open /dev/sda: Permission denied
fdisk: cannot open /dev/zram0: Permission denied
fdisk: cannot open /dev/zram1: Permission denied
fdisk: cannot open /dev/zram2: Permission denied
The third column tells you where the file system is mounted and the penultimate column has the file system type. So you have only ext4 file systems one of which is mounted at / which is the SD card. You’ve a bunch of stuff mounted at /opt/zram and stuff mounted at /srv/openhab2-* which think are all related to zram.
So in short, no, I don’t think the drive is in the response. It doesn’t always automatically mount a new drive when you plug it in, especially when running a lite headless type OS like openHABian does.
You need to run that command as root.
sudo fdisk -l
You will notice that is how that tutorial you linked to runs it too.
This is the SD card I think
This is the external hard drive. So run fdisk as root and it will tell you what type of file system the drive is formatted with. Than you should have the information needed to edit the fstab so it mounts automatically.
Finally I got the window that said that Amanda setup completed and successful. Bakcups will be at 01:00. I understand that this first backup is Level 0 and subsequent ones are Level 1.
Are those errors significant?
Should remove the SD card from the Pi and copy it to my computer and then etch another SD card back-up?
If I removed the backup USB stick from the Pi and inserted it into my computer, should I see evidence of the backup in the form of files?
Thanks for your help.
Jim
Update: I removed the stick from Pi, inserted iit in my laptop, and the label was USB20FD and it was empty.
The errors look like networking errors and may be transient. Try again later is all I can offer. The chown/chmod errors may be related to that. I don’t know. Someone more familiar with Amanda would have to anser on that.
It said it completed successfully so I’d wait for a full backup to see if it actually works. If not, look into it more. If not than the problem is almost certainly just with Amanda so starting over is probably not necessary.
The backup files gotta go somewhere. I can’t say what you will see though. I don’t use Amanda.