SOLVED SMB Madness - share in MacOS shows files, linux command line no

hungarianhc

Patron
Joined
Mar 11, 2014
Messages
234
Hey there!

I'm incredibly hopeful you can help me out here. I have a dataset owned by user / group media-read-write / media_1 respectively. I also have an SMB share on this. I connect to the SMB share w/ my media-read-write credentials on my Mac, and when I do this, it works.

However, I'm trying to mount it on a Raspberry Pi. When I run the below command on the linux distro, it mounts the SMB share without issue, but I can't see its contents. Note that logging in with the same user via MacOS works great. I've tried some tweaks, but I don't get why this isn't working. I'm using the media-read-write user for the Mac and for the linux command line mount. Thanks in advance.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Hey there!

I'm incredibly hopeful you can help me out here. I have a dataset owned by user / group media-read-write / media_1 respectively. I also have an SMB share on this. I connect to the SMB share w/ my media-read-write credentials on my Mac, and when I do this, it works.

However, I'm trying to mount it on a Raspberry Pi. When I run the below command on the linux distro, it mounts the SMB share without issue, but I can't see its contents. Note that logging in with the same user via MacOS works great. I've tried some tweaks, but I don't get why this isn't working. I'm using the media-read-write user for the Mac and for the linux command line mount. Thanks in advance.
Try mounting via linux with `noperm` option. Sometimes the linux SMB client can be rather too clever trying to interpret permissions on the remote server and deny access where the server doesn't.
 

hungarianhc

Patron
Joined
Mar 11, 2014
Messages
234
Hi there! Thanks for jumping in. That doesn't seem to do it. I'll try to be super specific about what the issue is here. I have files on an SMB share that I believe should be visible to the client logging in. When I'm local on the device, logged in as user, media-read-write, here's what I see in a directory...

Code:
% pwd
/mnt/Tank/Media/ROMs/RetroPie-Net-Share/megadrive
% ls -ltr
total 1294
-rwxrwxrwx+ 1 media-read-write  media_1  1294706 Jun 11 22:58 Sonic & Knuckles.zip
-rwxrwxrwx+ 1 media-read-write  media_1       10 Jun 12 00:38 test
-rwxrwxrwx+ 1 media-read-write  media_1       10 Jun 12 00:55 hellp


Based on those file permissions, I would think that anyone would be able to see the files. So then I mount the SMB share from my other device, and I use the following command to do so:

Code:
pi@retropie:~/RetroPie $ sudo mount -t cifs -o username=media-read-write,file_mode=0777,dir_mode=0777,password=xxx,noperm //192.168.1.226/ROMs /home/pi/RetroPie/test


This works fine. I can see the directories when I change into them, but when I do "ls" to show files, I see nothing.

I am completely perplexed here. I am definitely not a permissions expert, but this is boggling my mind.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
What is output of `getfacl /mnt/Tank/Media/ROMs/RetroPie-Net-Share/megadrive/test/<some file you can't see with linux client>`?

When you have mounted the SMB share in linux, does `smbstatus` show the expected user connected to the share?
 

hungarianhc

Patron
Joined
Mar 11, 2014
Messages
234
What is output of `getfacl /mnt/Tank/Media/ROMs/RetroPie-Net-Share/megadrive/test/<some file you can't see with linux client>`?
This is the output:

Code:
% getfacl /mnt/Tank/Media/ROMs/RetroPie-Net-Share/megadrive/Sonic\ \&\ Knuckles.zip 
# file: /mnt/Tank/Media/ROMs/RetroPie-Net-Share/megadrive/Sonic & Knuckles.zip
# owner: media-read-write
# group: media_1
    user:syncthing:rwxpDdaARWcCos:------I:allow
         user:plex:r-x---a-R-c---:------I:allow
         everyone@:rwxpDdaARWc--s:------I:allow
         everyone@:--------------:------I:allow
% 


When you have mounted the SMB share in linux, does `smbstatus` show the expected user connected to the share?

Code:
pi@retropie:~/RetroPie $ sudo smbstatus

Samba version 4.9.5-Debian
PID     Username     Group        Machine                                   Protocol Version  Encryption           Signing             
----------------------------------------------------------------------------------------------------------------------------------------
2145    nobody       nogroup      192.168.1.226 (ipv4:192.168.1.226:56646)  SMB3_11           -                    -                   

Service      pid     Machine       Connected at                     Encryption   Signing     
---------------------------------------------------------------------------------------------
IPC$         2145    192.168.1.226 Mon Jun 13 21:35:42 2022 BST     -            -           
roms         2145    192.168.1.226 Mon Jun 13 21:35:42 2022 BST     -            -           

No locked files


OMG.
UGH.
I knew it.
Something completely ridiculous.
The IP address was wrong. Late night, i've been using the IP address of itself. Wow. What are the odds... Retropie makes SMB sharing available... and it shares the roms folder. SMB must be case insensitive. I've been connecting to myself and remapping the SMB folder, which has the same folder structure, but none of the contents, as my actual SMB drive. That's the mystery. Wow. I'm dumb.

Thank you so much for suggesting the proper diagnostic tools for me!!!
 
Top