Corrupt FileSystems every 2-3 month?

When you run it from the console you are running it as a specific user (either yourself or root depending on how you run it) which includes an entire configured environment including shell, permissions, environment variables, etc. When it runs as a service the process gets none of that. When you run it as a service properly (i.e. as a non-privileged user) you don’t even have a shell to rely upon.

Questions:

  • Which version of Ubuntu are you running? Since 15 the startup system moved from upstart to systemd. The two are very different in how they manage starting service when Linux boots.
  • I’ve not tried to install or use policyKit before, but I could see it potentially messing everything up if you just installed it without then configuring it to allow the openhab user access to the resources it needs to run openHAB. I recommend installing openHAB and get it working first and then trying policyKit, and then only install that once you understand how to configure it.
  • The fact that it didn’t work with apt-get makes me thing either you messed something up with systemd previously or policykit is messing things up.

Finally! I installed a new version of OS (Ubuntu 16.04), and followed the steps from the tutorial again. Made the NFS shars on the Synology, mountet them to /mnt/openhab and createt tom symbolic links (for Logs and Persistance)

Now all seams to be ok :slight_smile:

Dear Spaceman could you please post this script?

My file system got corrupted on day 1!

After copying the raspbian image and apt-upgrade and a reboot the file system was corrupted. But after formating the SD-Card I could copy the raspbian image again without fault. So this was clearly no case of wear-leveling in the SD-Card but a failure OS or Firmware keeping the file system in order.

Some SD-Card work for months, some fail almost immediatly, even from the same brand. So this must have to do with the low-level writing procedure in my opinion. But since I cannot fix it myself and the setup is always in danger of getting lost, I keep on with my workaround of using an usb stick (and placing come directories to /tmpfs as well).

Had similar issue, a couple of times. Usuall it happened when power off the raspberry the not so nice way (power outage etc.)

My solution finally was to put the whole raspian installation on my Synology NAS and even boot via the Raspi from nfs. Since then I had 0 issues. Of course a NAS could often run directly openhab as well, which might also be a good option. In my case it was not, because the NAS is located in the cellar and m zwave signal was very poor from this location. The Raspi was therefore much easier to place in a more central location…

There are plenty of articles on how to boot the RPi via nfs. E.g.
http://blogs.wcode.org/2013/09/howto-netboot-a-raspberry-pi/

You could put the controller on your Pi and then user ser2net to let your NAS access it across the network.

You could then make your Raspberry Pi completely Read Only while running.

Lots of options…

… or buy a usb ssd harddisk and boot without the use of any sd card:

Only Raspi 3 is able to boot without any sd card, for example from usb. For Raspi1 & 2 best option is a small readonly boot partition on a sd card.

And I just added the recommendation to move the swapfile, too.

I wish my Raspi 3 would go more than 3 weeks! It now killed my USB thumb drive and I can´t help but suspect something wrong with the Pi itself. Other than that it is totally unusable for homeautomation and data logging (weather and whatnot) in my case :frowning:

My USB flash drive is also corrupt and totally unreadable.

Once I get a new USB stick, at what point in the install process do I copy my backup conf and user data folders to the stick?

I tried without a USB stick (copying to the SD card but everything broke so I’m starting again.

Thanks!

I also experienced corruption of the pi3 sd filesystem: I’ve been running openhab on the raspberry pi 3 for one year and a half and corruption happend two or three times. At first I blamed the SD cards but I noticed that corruption was very likely related to improper shutdown due to power outages.

As I wish to keep a very low power solution relying on the Pi itself, I decided to use a power bank as an UPS (selecting a powerbank that simultaneously supply the Pi and recharges its own lithium batteries).
Moreover I implemented a daily sd image rsync backup towards my synology NAS.

The UPS+backup system is in place since one month and no corruption occured so far, but even if it happens I can restore the previous day image in a few minutes.

I’ve bought a powerbank and I’ll give it a go.

Did you put any software on your Pi to manage it? A chap here has written some code which computes battery-time remaining. | can see it being useful to trigger a script to let you know when and if the battery back-up is being utilised.

4 Likes

I’ve bough a 15000mAh powerbank (RAVpower) and the Pi is only connected to the network through ethernet. The powerbank lasts at least 24 hours.
I’ve never experienced power outages that long.
Therefore I’ve not set up any battery monitoring script.
Best
LionHe

1 Like

@Benjy:
If others can state how long their RPi systems have lasted, that’d be useful.

My system is running for a year now. I had a corrupt SD after 8 months.

Indeed, I had that too. And then suddenly it stopped. I have suspicion it was because in the beginning I was often working on OpenHab, adding things etc. Whether that is the reason and whether it is the reason in your case I do not know.

I run a Raspi3 with a Sandisk Ultra 32GB card now for about 1 year without problems with my Openhabian installation.

How to find out if the powerbank provides this function!?

Put in an energy meter?

So there is not a kind of spec like “simultaneously charging and supplying”
Anyway, I will look around if I can find a proper power bank.
Or I just buy a real UPS from APC for all my server stuff :slight_smile: