[SOLVED] /var/lib/openhab2 gone

was a typo.

I’ve just verified on third fresh instalation from image 1.5 from openhabian github.
when I run openhabian-config for first time after instalation and install zram, overlay is not there.

even process behind looks different, when I’ve run it after updating/upgrading installing recommended packages it actually compiled it on the fly. Which on first run was not the case.

This is the third case, when reboot function is needed. And sorry, this is not always because I want to do this, but because when someone wants to get help on OH forum first question from experts is “Did you try to reboot?” Second question is more weird “Can you show us your startup log? Oh, your Installation runs since XX days? So can you please reboot to see the startup logs to check if nothing strange happens there?”. So rebooting sometimes helps to diagnose problems, right?

Funny is that there is no option in openhabian-config to disable ZRAM. I’m reinstalling Openhabian now to switch this feature off.

Can you open an openhabian Github issue please and upload a log of this (set -x in scripts should do) to show those two instances of the zram install process?
If you can pls hotfix /opt/openhabian/functions/zram.bash
as in https://github.com/openhab/openhabian/pull/656 before calling it for the first time.

Merged. Please verify openhabian-config updates itself on first start to contain this fix.
I have a vague idea but need some input to verify.

1 Like

There is, the line below the ‘activate’ line (6A).

It depends. Which is part of the problem because non-Linux people don’t know/understand the background. But as a rule of thumb it does more damage than good.

I can confirm that another fresh instalation without anything else done in openhabian-config compiled overlay correctly and it is present.

Thanks for fix, it will help a lot of people with struggling.


suggestion:
make zram sync to disk on regular basis via cron. like once per 2-3hours should be just fine to maintain fresh OH folder in case of any powerfailure.

Well if only it was that simple … I even contributed a patch to do that but the original tool’s author insists on that it isn’t safe to sync. He probably has got time-critical use cases in mind that we don’t have in openHABian but who am I to contradict?

wouldnt be possible to just perform zram-config stop & start via cron?

that would be simple :smiley:

Sure. Do you volunteer to test that ?
See Add sync option by mstormi · Pull Request #17 · ecdye/zram-config · GitHub for a patch to the script to add a “sync” option.

I guess you understand why I didn’t want to implement this in the very first version of this feature.

i have quite a lot of spare rpis where i dont really mind to kill the instalation anytime… so why not
I can do whatever is needed to get it to work

2 posts were split to a new topic: Zram sync

I am having issues to clone my SD card via rpi-sync as the cloned card will boot but openhab crashes instantly. So I figuered to deactivate zram and try again.
Using the option in openhabian-config you mentioned I get

[09:48:57] openhabian@openhab:~$ sudo openhabian-config
[sudo] password for openhabian:
2019-08-22_09:49:05_CEST [openHABian] Checking for root privileges... OK
2019-08-22_09:49:05_CEST [openHABian] Loading configuration file '/etc/openhabian.conf'... OK
2019-08-22_09:49:05_CEST [openHABian] openHABian configuration tool version: [master]v1.5-504(a342f21)
2019-08-22_09:49:05_CEST [openHABian] Checking for changes in origin... OK
/opt/openhabian/functions/zram.bash: line 18: /usr/local/share/zram-config/uninstall.sh: Permission denied
2019-08-22_09:49:34_CEST [openHABian] Checking for default openHABian username:password combination... FAILED
2019-08-22_09:49:35_CEST [openHABian] We hope you got what you came for! See you again soon ```

My username:password are the default ones that come with openhabian.

I tried “sudo service zram-config stop” but “sudo fdisk -l” still shows zram

<snip>
Disk /dev/ram14: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram15: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mmcblk0: 7.4 GiB, 7969177600 bytes, 15564800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xebcab588

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1        8192   532480   524289  256M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      540672 15564799 15024128  7.2G 83 Linux


Disk /dev/sda: 14.7 GiB, 15802040320 bytes, 30863360 sectors
Disk model: SDDR-113
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x267623a1

Device     Boot  Start      End  Sectors  Size Id Type
/dev/sda1         8192   532480   524289  256M  c W95 FAT32 (LBA)
/dev/sda2       540672 30863359 30322688 14.5G 83 Linux


Disk /dev/zram1: 400 MiB, 419430400 bytes, 102400 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/zram2: 300 MiB, 314572800 bytes, 76800 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

How can I tell zram is actually deactivated?
Thank you!

it’s deactivated if your

df -h

does not show any overlays

I don’t know what that has to do with zram.
Either way if you really want to clone the card use Amanda or dd.

/dev/ram is not /dev/zram.
If you get “Permission denied” running as root something’s seriously wrong there.
Eventually you have processes running off a directory that is mounted as zram.
If you want to be on the safe side edit /etc/ztab and reboot.

as you can see in my above post of the log (please scroll down) it says

Disk /dev/zram1: 400 MiB, 419430400 bytes, 102400 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/zram2: 300 MiB, 314572800 bytes, 76800 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

If you get “Permission denied” running as root something’s seriously wrong there.

Well, this is a clean openhabian 1.5 install.

If you want to be on the safe side edit /etc/ztab and reboot.

How is it supposed to look like?

I cannot see. Please edit your post to make it readable.

please see edited post above above

Which does not mean you have no processes running off zram mounted disks. openhab2 itself for example, or any shell to cd into any such directory.

Oh come on. Just turn the lines into comments.

Oh come on. Just turn the lines into comments.

wow! Sorry for asking!

If you want to be on the safe side edit /etc/ztab and reboot.

there is no /etc/ztab

Then if you reboot there is no zram.