homebridge/homebridge-raspbian-image

Moving Homebridge storage path: /var/lib/homebridge ( to use rpi image with fs overlay )

Closed this issue · 5 comments

Raspberry Pi Model

Raspberry Pi 4 B

Current Situation

hi ,
How to move homebridge storage to different mount point.

from "/var/lib/homebridge" to "/data/my-data/hb"

I want to lock the OS filesystem with FILESSYSTEM-OVERLAY option ,
But keep one r/w mount point on the usb/sdcard for homebridge plugin and accessories.

If homebridge storage is on OS partition , then my pairing and accessories will be cleared on reboot

I have made my master disk with "homebridge-raspbian-image" added a partition with 4gb writeable area.

after overlay files system is enable by raspi-config /data path will be will available for persistence storage ( writable ).

$ cat /etc/fstab
proc            /proc           proc    defaults          0       0
PARTUUID=1369d763-01  /boot/firmware  vfat    defaults          0       2
PARTUUID=1369d763-02  /               ext4    defaults,noatime  0       1
PARTUUID=1369d763-03  /data           ext4    defaults,noatime  0       3

My folder struct on /data will be similar

/data/
└── my-data
    ├── hb
    │   ├── accessories
    │   ├── auth.json
    │   ├── backups
    │   ├── config.json
    │   ├── homebridge.log
    │   ├── node_modules
    │   ├── package.json
    │   └── persist
    ├── myhubcfg.json
    ├── hb-plugins
    │   └── logical-homebridge-plugin
    └── scripts
        ├── bank
        ├── every_10minute
        ├── every_15minutes
        ├── every_30minutes
        ├── every_5minute
        ├── every_day
        ├── every_hour
        ├── every_minute
        ├── every_week
        ├── load_cron_jobs.sh
        └── logs

Logs

No response

Interesting idea

A couple of comments

1 - homebridge uses two directories, with the second being in /opt/homebridge so that needs to be taken into account as well

2 - to keep things simple it is possible to just put the overlay in the original location? I quickly read the docs on FILESYSTEM-OVERLAY and the impression it was feasible

3 - how would file system updates be handled?

hi,
BOOKWORM 64 bit image did not work with overerlay-fs enabled.

Going back to my last made version with "Raspbian GNU/Linux Buster (10)"

updated all packages to resent version, but kept nodejs version to 18.xx

apt update/upgrade
nodejs to 18.20.1
homebridge to 1.7.0
zerotier to 1.12

My path on /data/ is read-write .

All working ok

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been closed as no further activity has occurred.