Use network drive

You need to mount the remote share, like (from memory)

mount -t cifs //server/share /mntpoint

In HassOs? That is using the SAMBA client which is not likely in a stripped down OS.

That would work for a full Linux installation like Raspbian Lite.

I admit I have not tested if cifs is available in hassos. mount obviously will be.

Hi! Im the exatly same idea to move the hassio’s db (mariadb) on hdd with fritzbox router… you had a solution ? :slight_smile: thankyou

Seriously, I’m not sure it’s a good idea regarding performance.
Local sdcard VS remote smb disk ?

Maybe doing backup on smb is better.

Regards

What do yoyr performance ttests show?

Don’t need to do this test, a local db will always more fast than a db on remote disk.
Plus SMB doesn’t seem to be the good protocol for db hosting.

If you have a wrt friendly router or a NAS, you can host a SQL (or whatever) server. (Or a Pi)

Just my point of view :joy_cat:

Can you flash wrt on your router ?

That depends on how fast your local disk is, how fast the network is, what protocol you use, what IO is like on each machine. There are many variables.

Not much of a good protocol for any damn thing. NFS would be superior. Many systems run their entire OS over NFS.

My first statement was local db on sdcard / remote smb with hdd. Easy case :wink:

Completely agree with NFS. (Lol about SMB…)
A db server on a NAS or anything able to run it.

Depending if you need to read all of your data at every connection…
Maybe smb can handle db backup and when you need to read all data you can merge all backups, but on a powerful device, not a Pi.

What do you think about ?

Some stuff to read https://mariadb.com/kb/en/mariabackup/

I kind of found this thread looking for a way to mount a network path in HassOS.
The OP wanted to do pretty well what I want. Camera Storage on a NAS. In my case, it is OpenMediaVault and the setup has enough speed.
Some will cringe at this, but I have a few Windows machines, so it is CIFS, Has anyone got a realtively pain-free way to mount a CIFS folder in HassOS so it is accessible to Add-ons like MotionEye and possibly Plex?

1 Like

I finally pieced together the steps required to mount samba and nfs devices in hassos running on a rasberry pi.

apk update
apk add cifs-utils
mkdir /mnt/backup
mount -t cifs -o username=supersexysysadmin,password=supersecretpassword //192.168.42.42/homeassistant /mnt/backup

You can add this to /etc/fstab then run mount -a but it doesn’t persist reboots so it’s kind of pointless. The package installs don’t persist either, I assume it’s a docker thing.

//192.168.42.42/homeassistant /mnt/backup cifs credentials=/root/.smbstreetcred,uid=8123,gid=8123 0 0

Here’s how to do it with nfs. My network share is on a freeNAS box and I had to specify the full remote path to mount it. I assume that’s a freeNAS default for nfs exports.

apk update
apk add nfs-utils
rpcbind
mount -t nfs 192.168.42.42:/mnt/Abyss/backups/homeassistant /mnt/backup

Here’s the “useless” nfs entry for fstab.

192.168.42.42:/mnt/Abyss/backups/homeassistant /mnt/backup nfs rw 0 0

I spent several hours trying to get a working init script for rpcbind in OpenRC but gave up when I discovered the persistance problem. I can still use this for manual backups but I also want to store camera footage on my NAS. Does anyone know how to make docker persist these changes?

4 Likes

I tried to use this to save video to my NAS but when I add a mounted directory (smb or nfs) to allowlist_external_dirs I get this error.

not a directory @ data['allowlist_external_dirs'][0]

I made sure the directory was mounted and writable. Local directories work fine here though.

Did you find a way to persist?

I’m thinking that if the Samba addon works, maybe the way to do it is via creating a addon like the Samba addon.

Use the ssh & webterminal addon. It has the ability to add packages on hass startup - you want cifs-utils from memory, and to rn commands on startup too (I gave the command above).

1 Like

Actually I want rclone to mount the drive.

So I need FUSE to be installed in HASSIO.

I’ve done it using:

apk add --upgrade fuse

After that, I’ve been able to mount the google drive without problems.
But…, every time I reboot I loose all of my changes.

Furthermore, after mounting the system under /media/gdrive I cannot see them inside the media browser:
image

File seen:
image

And in the media browser:
image

how is the drive mounted? The output of

mount|grep gdrive

1 Like

myremote: on /media/gdrive type fuse.rclone (rw,nosuid,nodev,relatime,user_id=0,group_id=0)

However, I can’t access that from Home Assistant.
If I create a file manually, I can see from Home Assistant, but I can’t see the mounted information.

So, I am able to mount the samba share (I’m using hassio vm image). What I have to do now to persist it across reboots?