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

Seem that I have found a solution myself. It was a crazy bug and reinstallation fixed the issue.

Thanks for this amazing add-on, very useful. Does you know how I can edit the the samba.conf template, to enable me to have my mounted drive name not show in capital letters please? I presume if I go into the docker container and edit it there it will just revert next time the add-on is loaded and actually needs to be done within the configuration section?

Thanks

On another note, any idea why I canā€™t use manually configured MQTT (yaml) without it crashing? I would like to be able to limit the number of entities it produces via auto discovery, and also to be able to tweak their units/precision settings, so have set the following in the autodiscovery section of the configuration:

disable_discovery: true
disable_persistent: true

Initially this seemed to work for a while. However now I canā€™t run the add-on without a load of MQTT related errors, usually culminating in an add-on crash. If I set disable_persistent to true then the add-on works again, but I get all the entities back again that I donā€™t want via auto discovery.

Traceback (most recent call last):
  File "/usr/local/bin/mqtt_daemon.py", line 18, in <module>
    from ha_mqtt_discoverable import Settings, DeviceInfo
  File "/usr/lib/python3.11/site-packages/ha_mqtt_discoverable/__init__.py", line 470, in <module>
    class DeviceInfo(BaseModel):
  File "pydantic/main.py", line 186, in pydantic.main.ModelMetaclass.__new__
TypeError: Argument 'bases' has incorrect type (expected list, got tuple)
[14:25:08] WARNING: mqtt-handler crashed, halting add-on

Iā€™ve tried deleting the sambanas auto discovery topics in MQTT explorer. Any suggestions please? Thanks.

Just adding a note of thanks for this Addon. Just stumbled on it today as I started to update my home LAN. Using a Pi4, I initially thought it would be a dedicated NAS project but seems like this addon with an external drive is able to meet all my needs streaming to various home media players and TVā€™s.

Thank you for this !

Hi, I tried using the veto file option but face an issue where all files disapear, just like in official addon Custom Samba Share? - #18 by diamant-x
Any idea if your addon could have a fix for it? Or how to hide files from specific points? Thanks.

Hi,

I have the latest Home Assistant OS running on my RPi 4B with Samba NAS add on installed. I have an external SSD connected (not mounted) to my Pi 4B on a USB 3.0 port with two ext4 partition, sdb1 (filesystem) and sdb2 (main storage). I want to be able to use the sdb2 partition connected to the Pi as a Network Time Machine Backup through Samba. I was earlier able to do this when I was running Raspberry Pi OS by mounting the drive (at /home/ex and made a folder named pibackup inside which served as target folder for backup) and edited the file smb.conf file at /etc/samba/ as follows.

Added:

**[global]**:

vfs objects = catia fruit streams_xattr

fruit:metadata = stream

fruit:model = MacSamba

fruit:posix_rename = yes

fruit:veto_appledouble = no

fruit:nfs_aces = no

fruit:wipe_intentionally_left_blank_rfork = yes

fruit:delete_empty_adfiles = yes

Edited:

[homes]
   comment = Home Directories
   browseable = no

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
   read only = no (previously yes)

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
   create mask = 0777 (previously 0700)

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
   directory mask = 0777 (previously 0700)

Ran the following commands to add password:

sudo smbpasswd -a pi
sudo systemctl enable smbd
sudo nano /etc/nsmb.conf

Added at the end to make it accessible directly in the file browser:


path = /home/ex/pibackup

writeable=Yes

create mask=0777

directory mask=0777

public=no

Since, I am new to Home Assistant OS, I am unable to replicate this. I have setup root SSH access using ā€˜HassOS SSH port 22222 Configuratorā€™ add-on and also installed Samba NAS add-on. How do I accomplish this? Is there some smb.conf file installed by this addon that I can edit in a similar way?

Also, some instructions to create an MQTT sensor to track the sdb2 disk usage would be really appreciated!

-Sayam

Any chance someone can explain how I can set an idle time for a connected HDD that is not being used all the time?

Thank you.

Where do I place this code for Time Machine to work??

If my external SSD for the NAS is connected to USB during RPi5 boot (HA OS on SSD) HA will not boot up. So, it seems that the Pi doesnā€™t know which of the two SSD it should boot from. Is there a way I can change a configuration so I can leave the NAS SSD plugged in while HA boots from the main SSD?

And, I have the NAS SSD assigned as a network drive in HA > System > Storage. When HA boots, there is an error and I have to reload the network drive. I would like to resolve this as well. Any help would be very much appreciated.

I was able to configure it and it found the drive - everything looks good, except Iā€™m not able to copy 20GB over to the empty 75GB drive because ā€œnot enough spaceā€. Mount point is at /media/mydrivename

I have the original Samba Addon installed - is that a problem?

I tried mount my external HDD with NUC through USB cable but it didnā€™t work. I need more help for this case.

1 Like

Where you able to get it working on you NUC?

So how does one ā€œMount external diskā€ ? I see no mention of that in the Documentation or Configuration section of the Add-on. I can map a drive to the internal HA drive but that is all it will let me do. :crossed_fingers:t4:

When I add the command line ā€œmoredisksā€ to the /homeassistant/configuration.yaml I get this error when I restart HA:

Logger: homeassistant.helpers.translation
Source: helpers/translation.py:226
First occurred: 2:34:26 PM (1 occurrences)
Last logged: 2:34:26 PM

Failed to load integration for translation: Integration ā€˜moredisksā€™ not found.

Moredisk is an option for the sambanas addon config not for homeassistant config.

1 Like

Thank you for the reply Lucio. Can you tell me where in Home Assistant I can find the ā€œsambanas addon config fileā€? Iā€™ve looked in all folders with File editor in Home Assistant and can not find it? Or do I have to create the config file from scratch?

From UI:
Settings->Add-ons->Samba NAS->Configuration
From Ha core you canā€™t see
From Host depending on your installation
From Hassos /addons/sambanas/config.yaml

But the real question is: are you sure you have installed the addon? Isnā€™t it better for you to try your hand at a non-custom HA configuration and study the basic concepts?

L

1 Like

100% right about that! I had HAos up and running on an old laptop but it started to die on me so I was down for bit as I waited for my Intel NUC to arrive so yeahā€¦ I need to take a refresher course for sure. Seems like once I hit 60+ my mind is just not as good at retaining what I had already learned :older_man:t4:

But thank for that info as I now have it showing correctly under addons. I had installed Samba share but not Samba NAS :man_facepalming:t4:

Formatted the 2TB USB disk to ext4 like is recommended and I get this:

mount: /mnt/HD3: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error.
dmesg(1) may have more information after failed mount system call.
[17:06:35] WARNING: Fail to mount HD3 nosuid,relatime,noexec,- !
s6-rc: info: service init-automount successfully started
s6-rc: info: service init-smartd: starting
s6-rc: info: service init-samba: starting
s6-rc: info: service hd-idle: starting
s6-rc: info: service hd-idle successfully started
[17:06:35] INFO: Hostname: homeassistant
[17:06:35] INFO: Interfaces: wlo2 eno1
[17:06:35] INFO: Docker Interface: hassio 172.30.32.0/23
[17:06:35] INFO: Enabling S.M.A.R.T for /dev/sda
smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.6.29-haos] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF ENABLE/DISABLE COMMANDS SECTION ===
SMART Enabled.
SMART Attribute Autosave Enabled.
SMART Automatic Timers not supported

SMART Enable Automatic Offline failed: scsi error badly formed scsi parameters