[New Addon] Samba NAS. (Mount external disk and share it )

Thank you so much for enabling the media folder in this 9.3.0 update. Keep it up!
God bless!

2 Likes

Hi @Lucio_Tarantino,
Thx the update. itā€™s working.
I have a question. I want to set a sensor with the external HDD folder size. Could you help me, how can I set the folder path?
I try this, but itā€™s not working

homeassistant:
allowlist_external_dirs:
- //192.168.0.143/ext_media
sensor:
platform: folder
folder: //192.168.0.143/ext_media

Where is the mounted folder in file system?

Iā€™m sorry to say that, but you canā€™t.

Sensor type folder and folder watcher donā€™t support network mount but only path on ha docker visible fs.

I think it might be interesting to add the exposure (MQTT?) of the sensors that report the monitoring parameters to the samba addon.

Give me a feedback (like on this post) on this feature if it interest.

1 Like

Thanks for your answer
Yes, Iā€™m interested in. Because now I canā€™t check the free space on the external HDD. So if you can help me give another possibility, then I would be very glad.

You can check the last version. Now shared disk are reported via MQTT to ha.

Any reason why I get this?

[cont-init.d] automount.sh: executing... 
[18:45:52] INFO: Protection Mode is false
[18:45:52] WARNING: MoreDisk option found!
mount: /dev_: mount point does not exist.
[18:45:52] WARNING: Unable to mount external drivers!
[cont-init.d] automount.sh: exited 0.

Any ideas how to fix? Also, where will the drives be mounted?

Hi,
The log means that devfs is not found so no disk is mount.
Can you post the full log and also more information about your system ( hw, sw version, external drive type /fsā€¦ ).

L.

These messages were received into log for me too, but the shared drive is visible next to samba folders. I use an external HDD which plug to raspberry via USB.

Thx for the update. But need some help about the configuration.

1, I updated the Samba NAS
2, I wrote this to the Samba NAS configuration

mqtt_topic: sambanas

3, The Mosquito MQTT logged this

[INFO] found homeassistant on local database
1602852775: New client connected from 172.30.32.1 as auto-8ACCB74F-10A6-9338-482D-9E2D107D2E3D (p2, c1, k60, u'homeassistant').

Is it (auto-8ACCB74F-10A6-9338-482D-9E2D107D2E3D) OK? After 2. step it should have been sambanas?
4, In the configuration.yaml I wrote this

sensor:
  - platform: mqtt
    state_topic: "sambanas/status"

5, I see this in Samba NAS log

[14:48:41] WARNING: No MQTT config.

ext4, if I use port 22222 access I can mount it from /dev/sda1, itā€™s called CONFIG.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] automount.sh: executing... 
[06:34:40] INFO: Protection Mode is false
[06:34:40] WARNING: MoreDisk option found!
mount: /dev_: mount point does not exist.
[06:34:40] WARNING: Unable to mount external drivers!
[cont-init.d] automount.sh: exited 0.
[cont-init.d] mqtt.sh: executing... 
[06:34:41] INFO: MQTT config core-mosquitto:1883 addons:fiev4ahtievoh1daiphie2thahGheic4kaeh9ee5Eej2Ze6ooheexailooNg7hoo
/var/run/s6/etc/cont-init.d/mqtt.sh: line 47: /root/.config/mosquitto_pub: No such file or directory
[cont-init.d] mqtt.sh: exited 0.
[cont-init.d] samba.sh: executing... 
[06:34:43] INFO: Hostname: homeassistant
tdbsam_open: Converting version 0.0 database to version 4.0.
tdbsam_convert_backup: updated /var/lib/samba/private/passdb.tdb file.
Added user homeassistant.
[cont-init.d] samba.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[06:34:43] WARNING: No MQTT config.
nmbd version 4.12.7 started.
Copyright Andrew Tridgell and the Samba Team 1992-2020
[06:34:43] INFO: Starting the AVAHI daemon for homeassistant...
Server version: avahi 0.7; Host name: homeassistant.local
daemon_ready: daemon 'nmbd' finished starting up and ready to serve connections
query_name_response: Multiple (2) responses received for a query on subnet 192.168.1.3 for name MSHOME<1d>.
This response was from IP 192.168.1.23, reporting an IP address of 192.168.1.23.
smbd version 4.12.7 started.
Copyright Andrew Tridgell and the Samba Team 1992-2020
INFO: Profiling support unavailable in this build.
daemon_ready: daemon 'smbd' finished starting up and ready to serve connections
Established under name 'homeassistant'
*****
Samba name server HOMEASSISTANT is now a local master browser for workgroup MSHOME on subnet 172.17.0.1
*****
*****
Samba name server HOMEASSISTANT is now a local master browser for workgroup MSHOME on subnet 172.30.32.1
*****

I have a new problem after some settings. I have set back these but the problem is still. And the mount driver has been lost.

[services.d] starting services
[16:14:56] WARNING: No MQTT config.
[16:14:56] INFO: Starting the AVAHI daemon for homeassistant...
[services.d] done.
nmbd version 4.12.7 started.
Copyright Andrew Tridgell and the Samba Team 1992-2020
daemon_ready: daemon 'nmbd' finished starting up and ready to serve connections
Server version: avahi 0.7; Host name: homeassistant.local
smbd version 4.12.7 started.
Copyright Andrew Tridgell and the Samba Team 1992-2020
INFO: Profiling support unavailable in this build.
daemon_ready: daemon 'smbd' finished starting up and ready to serve connections
Established under name 'homeassistant'
*****
Samba name server HOMEASSISTANT is now a local master browser for workgroup WORKGROUP on subnet 172.17.0.1
*****
*****
Samba name server HOMEASSISTANT is now a local master browser for workgroup WORKGROUP on subnet 172.30.32.1
*****
*****
Samba name server HOMEASSISTANT is now a local master browser for workgroup WORKGROUP on subnet 192.168.0.143
*****
Failed to fetch record!
pcap cache not loaded

mqtt_topic default is ā€œsambanasā€, the ā€œauto-xxā€ is the mqtt client id.
You donā€™t need to manually config the sensor, a pool fo new sensor is registered in HA via MQTT auto discovery.

I think you are affected the same bug of @KTibow where in the image there is no the directory structure so devfs and mosquitto config donā€™t starts.

Iā€™m publish now the version 9.3.0-nas2 with the fix. Please try.

L

Hi,
there is a bug in 9.3.0-nas1 where dev_ dir stripped in the autobuild system so is unable to mount disks.
Please retry with the new version 9.3.0-nas2.

L.

So where does it mount the disk to?

The disks are mounted in the docker and then shared with the same name by samba.

So if I wanted to use this dialog:
image
What would I put after the 192.168.1.3? For the media folder itā€™s \media.
OH! Itā€™s the disk label, so mine is called CONFIG, so itā€™s \\192.168.1.3\CONFIG.

The name of the disk?!?!?
Sorry but I donā€™t understand. :frowning:

In the addon config you need to add what disks you need to mount. The name is the disk-partition label of your disk and is used also for share name.

For exampe

  • I hava an external disk with label LIBRARY connected to USB
  • I add the config:
moredisks:
  - LIBRARY

-Now I can mount ā€œ//homeassistant/LIBRARYā€ on my Mac ( for windows use \ ).

You can also see the name in the addonā€™s log:

 [cont-init.d] automount.sh: executing... 
 [17:15:12] INFO: Protection Mode is false
 [17:15:14] WARNING: MoreDisk option found!
 [17:15:17] INFO: More Disks mounting.. LIBRARY
 [17:15:17] INFO: Mount LIBRARY
 [17:15:18] INFO: Success!
 [cont-init.d] automount.sh: exited 0.
 [cont-init.d] mqtt.sh: executing...
1 Like

Yeah, that was what I figured out. Now I just need to figure out how to put the drive in the media browserā€¦

Thank you very much @Lucio_Tarantino. Everything is working. I can configurate the size monitoring too.
image

Unfortunately the MQTT communication disconnects easily.
This is the SambaNAS log after starting:

*****
Samba name server HOMEASSISTANT is now a local master browser for workgroup WORKGROUP on subnet 192.168.0.143
*****
idmap range not specified for domain '*'
Failed to fetch record!
pcap cache not loaded
idmap range not specified for domain '*'
idmap range not specified for domain '*'
Failed to fetch record!
pcap cache not loaded
idmap range not specified for domain '*'
idmap range not specified for domain '*'
idmap range not specified for domain '*'

This is the Mosquito log:

1602875607: New connection from 172.30.32.1 on port 1883.
[INFO] found homeassistant on local database
1602875608: New client connected from 172.30.32.1 as auto-EAACCDEA-4FEF-362F-DCD3-628318BB0E73 (p2, c1, k60, u'homeassistant').
1602875641: New connection from 172.30.32.1 on port 1883.
[INFO] found addons on local database
1602875641: New client connected from 172.30.32.1 as mosq-Sdr0rpJTmr28WmbAbN (p2, c1, k60, u'addons').
1602875641: Client mosq-Sdr0rpJTmr28WmbAbN disconnected.
1602875701: New connection from 172.30.32.1 on port 1883.
1602875701: New client connected from 172.30.32.1 as mosq-kDlyMItEtfDu1Uczhw (p2, c1, k60, u'addons').
1602875701: Client mosq-kDlyMItEtfDu1Uczhw disconnected.