Cannot access USB Storage via SMB

Hi all,

As per subject, my sd card content is accessible via SMB, but I cannot see my USB hard drive from my Windows 10. This just happened maybe few days ago.

I found a previous user with similar issue from [SOLVED] Error in mounting a USB External Hard Disk and his issue somehow resolved magically.

I installed smbclient and ran it to get some info, but got some error as below:

root@osmc:~# sudo smbclient -L 192.168.1.65
Enter root’s password:
Anonymous login successful
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.2.14-Debian]
tree connect failed: NT_STATUS_ACCESS_DENIED
root@osmc:~#

Also collected logs as below :
https://paste.osmc.tv/oguhiloweq

and testparm -v log as well here:
https://paste.osmc.tv/usosaborav.vhdl

Appreciate if anyone can advise what is wrong. If more logs is needed, kindly let me know what command to run so I can put it here.

Edit: Would like to add that I manage to access the hard disk content via FTP just fine, by browsing the media folder.

Try sudo chown osmc:osmc /mount/*

hi grahamh,

the command doesnt seem to work:

osmc@osmc:~$ sudo chown osmc:osmc /mount/*
chown: cannot access ‘/mount/*’: No such file or directory

my bad - /media/*

Can you run this command again but as user osmc not root and then give the respective osmc password when asked

ran the command and nothing happen. still failed to access my usb after that :frowning:

same thing happened:

osmc@osmc:~$ sudo smbclient -L 192.168.1.65
Enter root’s password:
Anonymous login successful
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.2.14-Debian]
tree connect failed: NT_STATUS_ACCESS_DENIED

It’s still tries to login as root! because you used sudo.
run smbclient -L 192.168.1.65

This is what solved the problem for me

In your log I see:

Dec 12 22:17:24 osmc sudo[725]: osmc : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/net usershare add My Book /media/My Book Auto-mount Volume osmc\osmc:f
Dec 12 22:17:24 osmc sudo[725]: pam_unix(sudo:session): session opened for user root by (uid=0)
Dec 12 22:17:24 osmc udisks-glue[348]: net usershare add: cannot convert name "osmc\osmc" to a SID. The connection was refused. Maybe smbd is not running.

I don’t have any similar lines in my logs for an ntfs share. Are you using a custom script to share the disc, and if so is the syntax right?

Ok tried to run it again, with osmc user:

osmc@osmc:~$ smbclient -L 192.168.1.65
Enter osmc’s password:
session setup failed: NT_STATUS_LOGON_FAILURE
osmc@osmc:~$

Yeah I saw this thread but this is troubleshooting Samba in overall isn’t it? My Samba is actually running, just could access the USB storage. SD card content works fine.

I don’t run any extra script. I just add the samba services from app store then it just start working with my USB storage, and I have to disable guest access due to SMBv1 restriction, and then it work flawlessly till its not.

Is the IP of your OSMC Samba server?
Are you sure you use correct smb credentials?

Suggest to upload full logs grab-logs -A and also your smb.conf cat /etc/samba/smb.conf | paste-log and share the urls.