dianlight / hassio-addons

Hassio.io
MIT License
139 stars 48 forks source link

🐛 [Samba NAS] Can't mount after a restart #244

Closed purierca closed 2 months ago

purierca commented 4 months ago

Addon

SambaNAS

Description

All of a sudden a working mount doesn't mount anymore; tried restart, reboot, plug out/back in... nothing works

Reproduction steps

1. Have a working NTFS mount
2. Restarted HA (HA OS Green)
3. Mount doesn't mount
4. Try troubleshooting, no result

For ref, if it helps, I'm also pasting here the hardware info (from Supervisor)

DEVLINKS: >-
  /dev/disk/by-diskseq/16-part1
  /dev/disk/by-id/ata-WDC_WD5000AAVS-00ZTB0_WD-WCASU3950686-part1
  /dev/disk/by-id/usb-WD_5000AAV_External_57442D574341535533393530363836-0:0-part1
  /dev/disk/by-id/wwn-0x50014ee1ab9dd38c-part1 /dev/disk/by-label/Jellyfin
  /dev/disk/by-partuuid/67faf365-01
  /dev/disk/by-path/platform-fd880000.usb-usb-0:1.1:1.0-scsi-0:0:0:0-part1
  /dev/disk/by-path/platform-fd880000.usb-usbv2-0:1.1:1.0-scsi-0:0:0:0-part1
  /dev/disk/by-uuid/D672035972033E2D
DEVNAME: /dev/sda1
DEVPATH: >-
  /devices/platform/fd880000.usb/usb6/6-1/6-1.1/6-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sda/sda1
DEVTYPE: partition
DISKSEQ: '16'
ID_ATA: '1'
ID_ATA_DOWNLOAD_MICROCODE: '1'
ID_ATA_FEATURE_SET_AAM: '1'
ID_ATA_FEATURE_SET_AAM_CURRENT_VALUE: '254'
ID_ATA_FEATURE_SET_AAM_ENABLED: '1'
ID_ATA_FEATURE_SET_AAM_VENDOR_RECOMMENDED_VALUE: '128'
ID_ATA_FEATURE_SET_HPA: '1'
ID_ATA_FEATURE_SET_HPA_ENABLED: '1'
ID_ATA_FEATURE_SET_PM: '1'
ID_ATA_FEATURE_SET_PM_ENABLED: '1'
ID_ATA_FEATURE_SET_PUIS: '1'
ID_ATA_FEATURE_SET_PUIS_ENABLED: '0'
ID_ATA_FEATURE_SET_SECURITY: '1'
ID_ATA_FEATURE_SET_SECURITY_ENABLED: '0'
ID_ATA_FEATURE_SET_SECURITY_ENHANCED_ERASE_UNIT_MIN: '130'
ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN: '130'
ID_ATA_FEATURE_SET_SMART: '1'
ID_ATA_FEATURE_SET_SMART_ENABLED: '1'
ID_ATA_SATA: '1'
ID_ATA_SATA_SIGNAL_RATE_GEN1: '1'
ID_ATA_SATA_SIGNAL_RATE_GEN2: '1'
ID_ATA_WRITE_CACHE: '1'
ID_ATA_WRITE_CACHE_ENABLED: '1'
ID_BUS: ata
ID_FS_BLOCKSIZE: '4096'
ID_FS_LABEL: Jellyfin
ID_FS_LABEL_ENC: Jellyfin
ID_FS_SIZE: '500106788352'
ID_FS_TYPE: ntfs
ID_FS_USAGE: filesystem
ID_FS_UUID: D672035972033E2D
ID_FS_UUID_ENC: D672035972033E2D
ID_MODEL: WDC_WD5000AAVS-00ZTB0
ID_MODEL_ENC: >-
  WDC\x20WD5000AAVS-00ZTB0\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
ID_PART_ENTRY_DISK: '8:0'
ID_PART_ENTRY_NUMBER: '1'
ID_PART_ENTRY_OFFSET: '2048'
ID_PART_ENTRY_SCHEME: dos
ID_PART_ENTRY_SIZE: '976771072'
ID_PART_ENTRY_TYPE: '0x7'
ID_PART_ENTRY_UUID: 67faf365-01
ID_PART_TABLE_TYPE: dos
ID_PART_TABLE_UUID: 67faf365
ID_PATH: platform-fd880000.usb-usb-0:1.1:1.0-scsi-0:0:0:0
ID_PATH_TAG: platform-fd880000_usb-usb-0_1_1_1_0-scsi-0_0_0_0
ID_PATH_WITH_USB_REVISION: platform-fd880000.usb-usbv2-0:1.1:1.0-scsi-0:0:0:0
ID_REVISION: 01.01B01
ID_SERIAL: WDC_WD5000AAVS-00ZTB0_WD-WCASU3950686
ID_SERIAL_SHORT: WD-WCASU3950686
ID_TYPE: disk
ID_USB_DRIVER: usb-storage
ID_USB_INSTANCE: '0:0'
ID_USB_INTERFACES: ':080650:'
ID_USB_INTERFACE_NUM: '00'
ID_USB_MODEL: 5000AAV_External
ID_USB_MODEL_ENC: 5000AAV\x20External
ID_USB_MODEL_ID: '1100'
ID_USB_REVISION: '1.65'
ID_USB_SERIAL: WD_5000AAV_External_57442D574341535533393530363836-0:0
ID_USB_SERIAL_SHORT: 57442D574341535533393530363836
ID_USB_TYPE: disk
ID_USB_VENDOR: WD
ID_USB_VENDOR_ENC: WD\x20\x20\x20\x20\x20\x20
ID_USB_VENDOR_ID: '1058'
ID_WWN: '0x50014ee1ab9dd38c'
ID_WWN_WITH_EXTENSION: '0x50014ee1ab9dd38c'
MAJOR: '8'
MINOR: '1'
PARTN: '1'
SUBSYSTEM: block
TAGS: ':systemd:'
USEC_INITIALIZED: '6185237'

Addon Logs

Jellyfin
[11:28:05] INFO: Automount is Enabled!
---------------------------------------------------
[11:28:05] INFO: Checking Mounting disks for reserved names:

    Jellyfin
---------------------------------------------------
---------------------------------------------------
[11:28:06] INFO: Mounting disks:

    Jellyfin
---------------------------------------------------
[11:28:06] WARNING: Your Jellyfin is ntfs. This is an EXPERIMENTAL support
mount: /mnt/Jellyfin: wrong fs type, bad option, bad superblock on /dev/sda1, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.
[11:28:06] WARNING: Fail to mount Jellyfin 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
[11:28:06] INFO: Hostname: homeassistant
[11:28:06] INFO: Interfaces: end0 
[11:28:06] INFO: Enabling S.M.A.R.T for /dev/sda
smartctl 7.4 2023-08-01 r5530 [aarch64-linux-6.6.33-haos] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org

[11:28:06] INFO: Docker Interface: hassio 172.30.32.0/23
=== START OF ENABLE/DISABLE COMMANDS SECTION ===
tdbsam_open: Converting version 0.0 database to version 4.0.
tdbsam_convert_backup: updated /var/lib/samba/private/passdb.tdb file.
SMART Enabled.
SMART Attribute Autosave Enabled.
Added user homeassistant.
SMART Automatic Offline Testing Enabled every four hours.

s6-rc: info: service init-smartd successfully started
Added user _ha_mount_user_.
---------------------------------------------------
[11:28:07] INFO: Exposed Disks Summary:
[CONFIG]                path = /homeassistant # TM:false  FS:native  #
[ADDONS]                path = /addons # TM:false  FS:native  #
[SSL]                   path = /ssl # TM:false  FS:native  #
[SHARE]                 path = /share # TM:false  FS:native  #
[BACKUP]                path = /backup # TM:false  FS:native  #
[MEDIA]                 path = /media # TM:false  FS:native  #
[ADDON_CONFIGS]         path = /addon_configs # TM:false  FS:native  #
---------------------------------------------------
s6-rc: info: service init-samba successfully started
s6-rc: info: service init-mqtt: starting
s6-rc: info: service wsdd: starting
s6-rc: info: service smbd: starting
s6-rc: info: service nmbd: starting
s6-rc: info: service avahi: starting
s6-rc: info: service wsdd successfully started
s6-rc: info: service nmbd successfully started
s6-rc: info: service smbd successfully started
s6-rc: info: service cifs-supervisor-mount: starting
s6-rc: info: service avahi successfully started
[11:28:07] INFO: Starting the AVAHI for homeassistant...
Waiting for daemon ...
[11:28:08] INFO: Automount Shares...
[11:28:08] INFO: MQTT support not enabled in config
s6-rc: info: service init-mqtt successfully started
nmbd version 4.18.9 started.
Copyright Andrew Tridgell and the Samba Team 1992-2023
[11:28:08] INFO: Starting the wsdd daemon for WORKGROUP/homeassistant...
[11:28:08] INFO: Wait Samba Server to going up..(max 30s)
smbd version 4.18.9 started.
Copyright Andrew Tridgell and the Samba Team 1992-2023
[11:28:08] INFO: Interfaces: -i end0 
INFO: Profiling support unavailable in this build.
2024-07-17 11:28:09,327:wsdd INFO(pid 370): using pre-defined UUID cb6a33a0-b841-531d-a34e-09ecec492eb1
2024-07-17 11:28:09,333:wsdd INFO(pid 370): joined multicast group 239.255.255.250 on 192.168.1.40%end0
2024-07-17 11:28:09,341:wsdd INFO(pid 370): scheduling Hello message via end0 to 239.255.255.250%end0
2024-07-17 11:28:09,365:wsdd INFO(pid 370): joined multicast group [ff02::c] on fe80::f269:54e6:84fa:2ad0%end0
2024-07-17 11:28:09,367:wsdd INFO(pid 370): scheduling Hello message via end0 to ff02::c%end0

No locked files
Samba version 4.18.9
PID     Username     Group        Machine                                   Protocol Version  Encryption           Signing              
----------------------------------------------------------------------------------------------------------------------------------------

Service      pid     Machine       Connected at                     Encryption   Signing     
---------------------------------------------------------------------------------------------

s6-rc: info: service cifs-supervisor-mount successfully started
s6-rc: info: service mqtt-disk-handler: starting
s6-rc: info: service mqtt-disk-handler successfully started
s6-rc: info: service mqtt-handler: starting
s6-rc: info: service mqtt-handler successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
2024-07-17 11:28:09,680:wsdd INFO(pid 370): 192.168.1.32 - - "POST /cb6a33a0-b841-531d-a34e-09ecec492eb1 HTTP/1.1" 200 -
*****

Samba name server HOMEASSISTANT is now a local master browser for workgroup WORKGROUP on subnet 172.30.32.1

*****

Addon Config

workgroup: WORKGROUP
username: homeassistant
allow_hosts:
  - 10.0.0.0/8
  - 172.16.0.0/12
  - 192.168.0.0/16
  - 169.254.0.0/16
  - fe80::/10
  - fc00::/7
automount: true
moredisks:
  - Jellyfin
mountoptions:
  - nosuid
  - relatime
  - noexec
available_disks_log: true
medialibrary:
  enable: true
veto_files:
  - ._*
  - .DS_Store
  - Thumbs.db
  - icon?
  - .Trashes
compatibility_mode: false
recyle_bin_enabled: false
wsdd2: false
mqtt_nexgen_entities: false
autodiscovery: {}
other_users: []
acl: []
interfaces: []
password: [REDACTED]

Architecture

other

OS

HaOS

purierca commented 4 months ago

It looks disk specific as I've just mounted another disk, also NTFS, and one works but not the other

[12:10:41] WARNING: Fail to mount Jellyfin nosuid,relatime,noexec ! [12:10:41] WARNING: Your NextCloud is ntfs. This is an EXPERIMENTAL support [12:11:02] INFO: Mount NextCloud[ntfs] Success!

dianlight commented 4 months ago

11:28:06] WARNING: Your Jellyfin is ntfs. This is an EXPERIMENTAL support mount: /mnt/Jellyfin: wrong fs type, bad option, bad superblock on /dev/sda1, missing codepage or helper program, or other error. dmesg(1) may have more information after failed mount system call.

Probably the NTFS is not unmounted clean. Just mount it in a Windows PC, check the disk and rety. NTFS in Linux is experimental and not cover all fs state.

purierca commented 3 months ago

Hi @dianlight thanks for the answer, you were right it's due to NTFS, it would just suddenly stop working and I had to re-allocate the partitions for the disks to work. I tried multiple times with two differnt HDDS.

It's now all Ext4l for the sake of simplicity.

Thanks for the help