openhab / openhabian

openHABian - empowering the smart home, for Raspberry Pi and Debian systems
https://community.openhab.org/t/13379
ISC License
821 stars 252 forks source link

bind mouted entries under /srv are mounted ro instead of rw #1355

Closed WolfgangSn closed 3 years ago

WolfgangSn commented 3 years ago

[##]Issue information: Mounted directories unter /srv ( ) are mounted read only; not read-write after a reboot: mount |grep /srv /dev/sda7 on /srv/openhab-userdata type ext4 (ro,relatime,errors=remount-ro) /dev/sda7 on /srv/openhab-addons type ext4 (ro,relatime,errors=remount-ro) /dev/sda7 on /srv/openhab-conf type ext4 (ro,relatime,errors=remount-ro) /dev/sda7 on /srv/openhab-sys type ext4 (ro,relatime,errors=remount-ro)

They are initially mounted rw but remounted ro ( see attached logging from systemctl with debug information ).

Also running openhabian-config menu 13 immediately mounts them rw. After a reboot they are ro again.

Changing the mount template from Before=smbd.service After=zram-config.service to Before=smbd.service After=network.target

fixes this and the directories are mounted rw ( see attached logging from systemctl with debug information ).

Debug information:

see attached files srv-remounted-ro-journalctl.txt shows that the directories are mounted rw first and in later stages of systemd they are remounted ro. srv-mounted-rw-journalctl.txt shows that the directories are mounted rw.

System information:

version of openhabian-config: [openHAB3]v1.6.2-1075(1041167)

OS: PRETTY_NAME="Debian GNU/Linux 10 (buster)" NAME="Debian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"

Kernel: Linux myopenhabian 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux

srv-remounted-ro-journalctl.txt srv-mounted-rw-journalctl.txt

mstormi commented 3 years ago

fixes this and the directories are mounted rw ( see attached logging from systemctl with debug information ).

systemd startup order is coincidential so if this worked you're lucky. Adding network.target is fine but removing zram-config.service is not. Try to add both as After= and let me know if that works

WolfgangSn commented 3 years ago

Based on your suggestion I tested After=network.target zram-config.service and I can confirm that the directories are mounted rw after a reboot.

mstormi commented 3 years ago

thanks. Have a couple of reboots at different times if you have a chance to make sure this isn't just coincidence

mstormi commented 3 years ago

I added network.target to future install pls test nonetheless @ecdye fyi

cee-dee commented 3 years ago

After my first reboot, I still could not write to openhab2-conf, after the second reboot it worked. I'll report on how stable this solution is.

Anyway, I noticed that on my system openhab2-logs directory is now empty.

WolfgangSn commented 3 years ago

I added network.target to future install pls test nonetheless I did 20 reboots and the folders always were mounted rw.

mstormi commented 3 years ago

Ok so with #1367 merged I'll consider this to be fixed. Reopen if you encounter again