OH + RPi2 - Move everything away from SD Card

Could you advise some smartphone backup battery that has an ups behavior mine doesn’t assure power continuity when the main supply cut.

I used pretty simple USB power bank, which I even got for free as a present while visiting some exhibition. It has a logo of that company, so I have no idea who is original manufacturer. It has a micro-USB and USB ports.

Same for me ! So the advice would probably be to embark on a fair, go collect some gifts :slight_smile:

ok thanks for the advices

I tried to move /var/logs to USB as a first step, but somehow failed. Does anyone have working instruction how to do it correctly?

@Artyom_Syomushkin how is it going? I want to start openHAB / openHABian on a Raspberry Pi 3. The third Pi can be run w/o a SD-Card and the older models (except the first with full SD Card) just need the file “bootcode.bin” on the internal SD-Card [1]. I am running dnsmasq on a Pi 1 and NFS on my other Debian Server. I want to use my new Pi diskless with openHABian - I hope this combination will not interfere.

[1] https://www.raspberrypi.org/blog/pi-3-booting-part-ii-ethernet-all-the-awesome/

I might be wrong here, but i think the openhabianpi isn’t just an image, but also a (separate) set of scripts to manage the installation - including moving the root partition to an USB device:

@chris400 since I didn’t want to start from new installation, I simply followed couple of first instructions, disabled swap file and created tmpfs for logs. I adjusted logback.xml to keep only 10 days of records maximum_ so that it fits into RAM. The only one log - events is backup to my NAS every weekend.
Finally I see that SD card is not used so often anymore, so I guess it should survive relatively long.

1 Like

Would you please share the guide.
I would like to go the same route…

Hello thread!
I’m writing here to say that i had a weird sd failure even if the raspberry pi v3 was powered by a battery pack. I flashed the sd more than one year ago. During this period some unwanted shutdown did occur anyway due to “human error”. I restored a backup (that is performed daily automatically on a synology) and now everything seems to work.
In my case the pi was losing ethernet connectivity and it was causing also the access point to hang. This made me suspect of an hardware failure first, but by using a different raspberry i ended up concluding that it was sds fault.
Whats strange is that i restored a backup taken after the first symptoms of ethernet hang showed up. If file was corrupted, the backup would simply copy it to the new sd.

This is a message in bottle for other users who may experience some trouble in the future.
Lionhe

@Lionello_Marrelli Hi Lionello,
I am folowing this thread because i would like to backup my openHAB system (SSD drive with Power bank) via nfs to my Synology NAS. (i still have to create a bu power solution for my network switches…)
I noticed that nfs on Synology does not work like the default nfs specs. They made their own additions to this. Til now, i haven’t got this working…
Tried several solutions like raspiBackup but no success…
If you are using nfs with your backup solution, could you please share your solution?
I would greatly appreciate it.
Kind regards, Bert

@deltabert Hi Bert,
I am using raspiBackup on a Synology NAS mounted via NFS (by editing the \etc\fstab).

  1. I had to play with NFS settings on the Synology (but I followed suggestions on a forum on Synology). NFS is essential as it allows mapping permissions and hard-links, considerably reducing the storage size of incremental backups.
  2. in the last versions raspiBackup is more strict in checking for errors. If an error occur the entire backup fails. I added these errors to the ignore list.

You have to solve the NFS issue first.
On the raspberry side I modified my /etc/fstab as follows

192.168.27.11:/volume2/backup /mnt/ds216 nfs rw,acl,vers=3,proto=tcp,hard,nolock,nofail,x-systemd.automount,x-systemd.requires=network-online.target 0 0

(if I rember well, vers=3 was important)

On the synology side, I followed instructions of the following link (it is in italian but you can easily find the english one).
In my case I opened the synology to my local network with
192.168.27.0/24

NFS can be painful to setup, ma once in place it works pretty well.

If you use openHABian, the recommendation is to use Amanda. It’s a preconfigured backup solution to come bundled with openHABian. Install it from the openhabian-config menu.
If you didn’t use the openHABian image, openHABian is also available as a set of scripts you could also install on top of an existing Raspbian.

Hi @Lionello_Marrelli and @mstormi, Thank you for your reactions.
Lionello, i am going to give raspiBackup an other try. I sure would like to use nfs for the back-up because of its file oriented mechanism.
I did found that the user group permissions on Synology where giving me problems.
With regard to the Synology link you gave me, that is also in English and even Dutch available.
But with regard to the NFS Permissions, what did you configure by Sicurezza:? I used AUTH_SYS: but that did not help.

Markus, I am indeed using openhabian. And i noticed the Amanda backup solution in the openhabian-config script. I did try it, but it looks so complicated… As if it’s a relic from the time i was working with mainframes :wink: And again, i have to use nsf, so i’l be having the same problem.
I do use cifs with my RPi’s on my nas (for Visual Studio Code), but the README for Amanda has an example which uses nfs, so… Besides, the README explicitly tells that CIFS is no option because of issues with symlinks…

To some extent it is but openHABian will auto-configure it for you, so what’s the point ?

True, but it’s a rather silly idea full of overhead to use CIFS if both, client and server, are UNIX systems. That’s what NFS was built for. You can use NFS in parallel to CIFS.

I actually set AUTH_SYS. But there are many things that can go wrong.
I suggest you to open a new thread. It is better not to hijack this thread. I think it could be useful for other people and easier to find.

Concerning the choice of the backup, I actually found raspiBackup before the openhabian and
Amanda availability. It took me a while to set it up: it works now but there is always some risk that the developer stops maintaining it. If I had to start now, I would follow openhab2 community recommendations. Amanda looks old but it is still used for serious backups in private companies, while raspiBackup is nothing more than a well done bash script built around rsync by a skilled user. For a simple raspberry, amanda may look overkill but once all of the complexities are hidden by a good installer and a good documentation it is ok. Moreover what will happen a few years from now? Which backup solution will remain in place?
In any case, we can continue discussing in your new thread.
Best
Lionello

Yes please, this thread is about SD card and its corruption.
For your specific problem to mount NFS off your Synology it is not OH related so you better go google that or look into a Synology forum.
There’s already many threads on OH backup solutions in the forum. Go search first. I wouldn’t think there’s the need to open another one. RaspiBackup isn’t anything official or bundled with OH or openHABian so if you want support on that you would also need to go google elsewhere.
Amanda on the other hand is part of openHABian.

Quite some users using raspiBackup, so please open a thread @Lionello_Marrelli if you need help or check the web:
https://www.linux-tips-and-tricks.de/en/
Also the developer of raspiBackup is user in this forum :sunglasses:

1 Like