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

Nope. It uses a protocol called Samba, which is meant for accessing your drive from another computer (for windows, network > mount network drive). Theoretically you could mount localhost, but there would be lag than. I was searching wild too, eventually I put my hassio onto the bigger disk and used regular Samba, but I still watch here.

Hello, I apologise for my ignorance here, but I’m not sure I understand how to share an external drive via samba.

I have an nuc with integrated drive, I have attached a USB3 drive and formatted with with ext4. I see the drive listed as /dev/sdb (on the host system). Though I don’t see listed within “Host System” in the supervisor.

  • Do I mount the drive within HASS.IO via the terminal?
  • Where should it be mounted within the HASSIO file system?
  • Does the name of the mount point become the under the moredisks option?

Is the addon intended to work under my configuration?

I can see the default shares (addons, backup, config, media, share, ssl).

You can name disks. Put your disk into a supporting machine, and give it the name you want. You do not need host access for this.

1 Like

Hello, i was able to install the addon and mount the drive. I can browse the file system, open files and copy files to my machine.
But if I try to write anything to the disk I get a “catastrophic error” 0x8000FFFF

Any ideas why this could be happening?

Something is messed up with the permissions, my files are marked as read only because I used NTFS on my previous setup. I am going to do a backup and format the disc on ext4.

1 Like

Thanks Kendell. That is the name given during disk initialisation / formatting then.

OK, so here is my filesystem. The disk I wish to share labeled “DATA_DISK”:

This is my config:

workgroup: WORKGROUP
username: hassio
password: [password goes here]
interface: ''
allow_hosts:
  - 192.168.1.0/16
moredisks:
  - DATA_DISK
veto_files:
  - ._*
  - .DS_Store
  - Thumbs.db
  - icon?
  - .Trashes
compatibility_mode: false
autodiscovery: {}

Is that all I have to do? I don’t see it as a share via samba on my network (I just see the default shares (addons, backup, config and so on). I don’t see anything in the logs.

Update:
The logs have come up and there is a reference to protection mode:

[08:15:02] INFO: Protection Mode is true

Disabled protection mode at the add-on panel. Now the disk mounts:

[08:29:33] INFO: Protection Mode is false
[08:29:33] WARNING: MoreDisk option found!
[08:29:34] INFO: More Disks mounting.. DATA_DISK
[08:29:34] INFO: Mount DATA_DISK
[08:29:34] INFO: Success!

But I cannot connect to shares anymore. “Connection Failed”. Not sure why. Nothing appears in the logs as to why the connection is failing:

Established under name 'evatt'
daemon_ready: daemon 'smbd' finished starting up and ready to serve connections
*****
Samba name server EVATT is now a local master browser for workgroup WORKGROUP on subnet 172.17.0.1
*****
*****
Samba name server EVATT is now a local master browser for workgroup WORKGROUP on subnet 172.30.32.1
*****
*****
Samba name server EVATT is now a local master browser for workgroup WORKGROUP on subnet 192.168.1.24
*****

Update:
It’s working! Thanks for the tip Kendell and thanks to Lucio for the awesome addon.

Just curious to know how this this done. Reading some Samba notes I see that there is a “fruit:time machine = yes” as part of the samba share config. Not sure if that can be used in this instance. Or did you guys create a sparse bundle disk image and copy that to a share?

@Lucio_Tarantino how does your plex addon work? i tried \\192.168.1.10\myshare but it says the host is down. the same mount from your samba addon works from motioneye.

in the samba nas addon logs its showing this error when plex nas is trying to connect:

Denied connection from 172.30.33.8 (172.30.33.8)
Connection denied from ipv4:172.30.33.8:55348 to ipv4:192.168.1.10:445

172.30.33.8 seems to be some docker private IP?

ah figured it out - allow_hosts in samba nas addon config needed 172.0.0.0/8

can you please tell if the plex nas addon needs protection mode off or not? it is just connecting to a samba mount so dont see the need. although it complains if it is on. also note that it says it is on even when it is off!

plex nas does not start (the webUI does not open) even after it shows “Success!” in the log:

[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] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: Plex Media Server with NAS
 Recorded media, live TV, online news, and podcasts ready to stream.
-----------------------------------------------------------
 Add-on version: 2.4.0-dht1
 You are running the latest version of this add-on.
 System: HassOS 4.12  (armv7 / raspberrypi4)
 Home Assistant Core: 0.114.2
 Home Assistant Supervisor: 2020.11.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] plex.sh: executing... 
[cont-init.d] plex.sh: exited 0.
[cont-init.d] webtools.sh: executing... 
[cont-init.d] webtools.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[19:51:04] INFO: Starting the Plex Media Server...
[19:51:05] INFO: Network Disks mounting.. //192.168.1.10/P4DISK
[19:51:05] INFO: Mount //192.168.1.10/P4DISK
[19:51:05] INFO: Success!

update: it does not work on the url created by ‘open webui’ -which is pointing to the duckdns host. i had to change it to my homeassistant’s private IP manually :frowning:

1 Like

The Time machine compatibility is made by fruit.
The samba.conf template in the addon is:

[global]
    min protocol = SMB2
    ea support = yes
    vfs objects = catia fruit streams_xattr  
    fruit:metadata = stream
    fruit:model = MacSamba
    fruit:veto_appledouble = no
    fruit:posix_rename = yes 
    fruit:zero_file_id = yes
    fruit:wipe_intentionally_left_blank_rfork = yes 
    fruit:delete_empty_adfiles = yes
 
    netbios name = %%NAME%%
    workgroup = %%WORKGROUP%%
    server string = Samba NAS HomeAssistant config
 
    security = user
    ntlm auth = yes
 
    load printers = no
    disable spoolss = yes
 
    log level = 1
 
    bind interfaces only = yes
    interfaces = %%INTERFACE%%
    hosts allow = %%ALLOW_HOSTS%%
 
   idmap config * : backend = tdb
   idmap config * : range = 3000-7999

and every external disks:

[%%DISKNAME%%]
   browseable = yes
   writeable = yes
   path = /%%DISKNAME%%

   valid users = %%USERNAME%%
   force user = root
   force group = root
   veto files = %%VETO_FILES%%
   delete veto files = %%DELETE_VETO_FILES%%

   vfs objects = catia fruit streams_xattr
   fruit:aapl = yes
   fruit:time machine = yes

L.

2 Likes

Any way the recycle bin could be enabled?

I can enable the vfs_recycle but I don’t know is what you want.
According to the manual https://www.samba.org/samba/docs/current/man-html/vfs_recycle.8.html:

The Recycle Bin will not appear in Windows Explorer views of the network file system (share) nor on any mapped drive.

I don’t know if exists a way to enable the Recycle Bin… :frowning:

L.

Thanks, so how do I specify a share as a time machine backup in the addon configuration?

All I need is to make the delete file functionality in Atom to work. It’s okay if it isn’t a mapped drive, I don’t use the add-on for that.

Just to understand, you talk about what Atom/Samba case; this https://github.com/atom/atom/issues/10596 os this https://github.com/atom/atom/issues/3306 or other?

Recycle bin folder has different name for different system so I need to know if you connect from Windows or Linux or Mac.

please do not continue to fill this discussion with these topics. If you open an issue on the project github we can continue there,.

L.

Which GitHub? This is the error:
image

Installed this addon on a Raspberry Pi 4 running latest Hassio on Debian and I am getting the below error. Official ‘Samba’ addon worked fine without any issues. Help is appreciated.

[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... 
[16:12:14] INFO: Protection Mode is false
[16:12:14] WARNING: MoreDisk option found!
[16:12:14] INFO: More Disks mounting.. /dev/sda1
[16:12:14] INFO: Mount /dev/sda1
mkdir: can't create directory '//dev/sda1': File exists
[16:12:14] WARNING: Unable to mount external drivers!
[cont-init.d] automount.sh: exited 0.
[cont-init.d] mqtt.sh: executing... 
[16:12:14] ERROR: Got unexpected response from the API: Service not enabled
[cont-init.d] mqtt.sh: exited 0.
[cont-init.d] samba.sh: executing... 
[16:12:16] INFO: Hostname: raspberrypi
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.
[16:12:17] INFO: Starting the MQTT daemon for disks info...
[16:12:17] INFO: Starting the AVAHI daemon for raspberrypi...
nmbd version 4.12.7 started.
Copyright Andrew Tridgell and the Samba Team 1992-2020
Server version: avahi 0.7; Host name: raspberrypi.local
daemon_ready: daemon 'nmbd' finished starting up and ready to serve connections
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
[16:12:18] INFO: Sending MQTT autodiscovery...
Error: -h argument given but no host specified.
Use 'mosquitto_pub --help' to see usage.
Got SIGTERM: going down...
Got SIGTERM, quitting.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] mqtt.sh: executing... 
[16:12:18] INFO: MQTT cleanup.
Error: -h argument given but no host specified.
Use 'mosquitto_sub --help' to see usage.
[cont-finish.d] mqtt.sh: exited 1.
[cont-finish.d] umount.sh: executing... 
[16:12:18] INFO: Unmount drivers.
umount: /dev: target is busy.
[cont-finish.d] umount.sh: exited 32.
[cont-finish.d] done.
[s6-finish] waiting for services.
s6-svwait: fatal: unable to subscribe to events for /var/run/s6/services/mqtt-handler-service: Read-only file system
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
```````

You need to setup MQTT for Home Assistant, and also try doing a hard reboot.

@KTibow - did you manage to get files from your attached external drive to appear in your HA Media Browser? What was the process you used to do this? I’m pretty new to HA so not experienced with debug access etc.

I’m running HA on a raspberry pi with the ‘official’ image if that makes any difference.

Edit - actually, ignore this! I just re-read a previous post and saw that you moved Hassio to your larger drive to get round this issue. I’m going to look into installing HA on the external drive and getting the PI to boot from it