So I’m realizing I need more storage space for Frigate, and I have HassOS running as a VM on my NAS. I can easily add another storage device to the VM settings, but how can I get it mounted so I can map the appropriate Frigate /media/frigate
dir to it?
Hm, that’s interesting. So looks like on startup, regular shell commands can be given. Cool. So tried setting up a shell command, and all I get is this error in the log (I turned on debug loging)
2022-12-12 12:42:25.479 DEBUG (MainThread) [homeassistant.components.shell_command] Stderr of command: `mount -t ext4 /dev/sdb1 /media/frigate`, return code: 255:
b'mount: mounting /dev/sdb1 on /media/frigate failed: Resource busy\n'
I validated, with a different VM, that that block storage is ext4 formatted, so I know it’s a good block device.
Any thoughts?
Seems to short in my eyes…
I’m not an expert on this, but basically i think I understand the logic somewhat.
This is my command:
mount_nas_music: mkdir -p /media/NAS/Music;mount -t cifs -o username=Myname,password=Mypassword,domain=WORKGROUP //192.168.178.133/Music/Musicaudio /media/NAS/Music
so in parts:
it first makes a directory on your HA instance, then starts mounting, where authentication is needed and the already existing directory on external drive is specified and the just made directory on HA is specified.
Al of those parts have to be present, i guess.
So
-
prepare
1a. make directory -
mount
2a. authenticate
2b. select original location
2c. select destination
But, that’s only my understanding, not based on any written docs…
Well, you are mounting to an already existing directory, so that part actually has not to be needed…
And don’t forget, to make it survive a restart, you need to make and automation calling the command after a HA restart.
@BebeMischa All of the parts are there, it’s giving me a mount error, as if /dev/sdb1
is already mounted somewhere, somehow, even though it doesn’t show up as mounted.
For terminal, I’m using the Web UI for Terminal & SSH
Add-On
Neither of these commands gives me mount | grep sdb
and mount | grep frigate
.
When I run mount -t ext4 /dev/sdb1 /media/frigate
manually in that shell, it gives me Permission denied
. Even though the user is root.
I suspect this is because the shell I’m in is in the HA Core Docker, and there’s some configuration/permission that hasn’t been done to HassOS in order to pass-through/grant permissions to a secondary local block device.
And that’s exactly, where my knowledge ends… I hope, some more experienced guy enters the chat now
Since you’re running under a VM, how have you made /dev/sdb1
visible to HassOS? I’m using VirtualBox, and there adding VM access to a physical drive is not that straightforward (“raw hard disk access”). It might be easier just to create a share on the host for the folder you’re interested in, and mount that with cifs as @BebeMischa described.
@michaelblight
Im on FreeBSD, using bhyve. It’s connected as an AHCI hard disk, just like the primary disk for the HA VM. In the HA Core bash I can see /dev/sdb1, but can’t access the resource for some reason.