Use network drive

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?