Tutorial for HASSOS on PROXMOX, network share and Frigate
-----------------------Deprecated:---------------------------
I have sucessfuly mounted network share to HASSOS on PROXMOX.
I would like to share it with you, feel free to give like or comment
!!!Before starting, make BACKUP!!!
1.Story
2.Making the changes to HASSOS
3.Check NAS availability
4.Automate it with PROXMOX ISO boot
5.What if?
6.Please vote for FR!!!
1.Story
Why?
The HASSOS frigate addon is perfect but doesnt have / or i didn’t find the option to mount network share inside for all addons.
Problems on the way?
Hell yeah, when i mounted HASSOS from a linux mint cd image a found out its not regular ext file system, its squashfs.
And its read only never heard about it before.And started to poke.
So i am making this toturial so you can mount your network share for media to be used in HASSOS for the whole system included addons.
Trying different ways?
I was trying to make a seperate container for Frigate
https://community.home-assistant.io/t/network-share-on-frigate-hassos-with-nabucasa-ssl-and-proxmox-lxc-container/
But it did’nt went well,because i cant use iframe for the frigate integration through nabucasa
What experience you should have to proceed?
-Understand how to boot live cd on HASSOS system
-Understand shell commands and logic
-Ready to copy / paste
I am not using any coral, for that you need assistance from somebody else afterwards :>
I’m using integrated INTEL graphics
Frigate thread:
https://community.home-assistant.io/t/local-realtime-person-detection-for-rtsp-cameras/
2.Making the changes to HASSOS
Soooo where to begin.
First you need to download linux mint iso (or any other,i like this one,its user friendly)
https://www.linuxmint.com/download.php
or as a alternative you can try mounting on another VM like @srk23 suggested:
If you still want to do live boot cd:
Then you need to mount it,boot from it (don’t install anything)
Open terminal
cd /mnt
lsblk
or
fdisk -l
You sould see list of available disks/partitions
They should be sda1-sda8
So the HASSOS root files are in sda3 and sda5(they are identical, i just didn’t botherd and change on both)
The partitions are so called squashfs not regular ext or ntfs/fat
now we will extract files from the partition
sudo unsquashfs -i /dev/sda3
New file was created under mnt/squashfs-root
now
nano /mnt/squashfs-root/etc/fstab
Add neccesery lines
//<NASIP>/<NASSHARE> /mnt/data/supervisor/media cifs nofail,username=<SMBUSER>,password=<SMBPASS>,iocharset=utf8,x-systemd.after=network-online.target 0 0
save close
cd /mnt
convert folder to squashfs and copy it to device partition
sudo mksquashfs squashfs-root/ squash.rootfs.1
sudo dd if=./squash.rootfs.1 of=/dev/sda3
After finish
rm -r /mnt/squashfs-root
rm /mnt/squash.rootfs.1
And do the same for /dev/sda5
sudo unsquashfs -i /dev/sda5
New file was created under mnt/squashfs-root
now
nano /mnt/squashfs-root/etc/fstab
Add neccesery lines
//<NASIP>/<NASSHARE> /mnt/data/supervisor/media cifs nofail,username=<SMBUSER>,password=<SMBPASS>,iocharset=utf8,x-systemd.after=network-online.target 0 0
save close
cd /mnt
sudo mksquashfs squashfs-root/ squash.rootfs.1
sudo dd if=./squash.rootfs.1 of=/dev/sda5
After finish
sudo shutdown now
Remove CD from boot
Start HASSOS and you can login to HOST device and check if its mounted under
/mnt/data/supervisor/media
check
dmesg | grep cifs
or
dmesg | grep mount
or
ls -la /mnt/data/supervisor/media/*
You maybe need to add vers=1.0 for the fstab mount idk your specifics
3.Check NAS availability
Make a file in the network folder called “thisisnas”
and just edit it and put
on
That’s it
Next,
Add this to binary_sensors.yaml (thank you to @srk23 )
- platform: command_line
name: NAS Mount
command: "[ -f /media/thisisnas ] && echo 'on' || echo 'off'"
payload_on: "on"
payload_off: "off"
And you can make some notification when the NAS is offline.
From up to down.
When NAS comes from offline to online,
it is neccasary to restart the HASSOS as follows (otherwise the sensor is not going to online state idk why)
Supervisor → System → reboot host
Then you can install the Frigate NVR addon
Dont forget to seperate the frigate.db from nas
frigate.yml
database:
path: /config/frigate.db
4.Automate it with PROXMOX ISO boot
Read docs
md5 checksum is
d8f187a8a8804cf0f71951d4b48cc77e
5.What if?
If the network share is down, you will see this text on the host display:
host is down or BAD NETWORK NAME
And this in Supervisor LOGS:
21-04-27 14:17:01 ERROR (SyncWorker_1) [supervisor.docker] Can't start addon_a0d7b954_ssh: 500 Server Error for http+docker://localhost/v1.40/containers/e2f1a348e9e94f9f37f3e2860e3a202d5a5cdce348ee893849a8ac460a390e78/start: Internal Server Error ("error while creating mount source path '/mnt/data/supervisor/media': mkdir /mnt/data/supervisor/media: file exists")
And you cant start any addons that are mount to media network share.
Just restart fully and it should work
6.Please vote for FR!!!
Sources:
google.com
https://magazine.odroid.com/article/using-squashfs-as-a-read-only-root-file-system/