Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: Mount NFS without permission to read
#1
Sad 
I'am new at moodeaudio and try to mount a external music source. I tried today several "Mount flags" but still get the problem that the mounted files are not readable.


Code:
drwxrwxrwx 2 root root        0 Feb 14 17:19  .
drwxrwxrwx 2 root root        0 Feb 14 17:19  ..
-rwxrwxrwx 1 root root        4 Feb 14 17:19  test.txt
pi@moode:~ $ vi /mnt/NAS/m4chine/2Raumwohnung/test.txt
pi@moode:~ $ less /mnt/NAS/m4chine/2Raumwohnung/test.txt
/mnt/NAS/m4chine/2Raumwohnung/test.txt: Stale file handle

Same when opening a file with vi: Permission Denied

Code:
pi@moode:~ $ less /mnt/NAS/m4chine/2Raumwohnung/test.txt

I use moodeaudio 7.01
The external Server is a NAS, I've mounted without any problem with OSX, volumio,...

I tried to mount the external library although by using mount:

Code:
sudo umount /mnt/NAS/m4chine
sudo mount -t cifs -o username=username,ro,dir_mode=0777,file_mode=0777 //192.168.1.50/m4chine/EXTERNAL/test /mnt/NAS/m4chine
Same problem!

Any idea?
Reply
#2
The help under mount flags:
"vers=1.0, 2.0, 3.0, 3.1 etc may be needed and/or sec=ntlm depending on what the NAS device requires."
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
I tried all combinations of "vers" with and without "sec=ntlm". Dosen't help! The files are still unreadable as root.

By using ver=default, I can read the version with 'mount -v' that is used between pi and NAS. It ist 3.1.1! 


Code:
mount -v
//192.168.1.50/m4chine/EXTERNAL/test on /mnt/NAS/m4chine type cifs (ro,relatime,vers=3.1.1,cache=strict,username=username,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.50,file_mode=0777,dir_mode=0777,soft,nounix,serverino,mapposix,rsize=65536,wsize=65536,bsize=1048576,echo_interval=60,actimeo=1)

I now tried to add uid=1000 or gid=1000 - with the same result. I can't read the mounted files as user 'pi' or 'root'.
Reply
#4
I've added the following Mount flags and it works:



Code:
vers=default,ro,dir_mode=0777,file_mode=0777,noserverino,_netdev,x-gvfs-show

As I read it is something special with my FritzNas
Reply
#5
Ok, thanks for posting the solution.

IIRC we tested vers=default a while back and it did not work in some of the cases we tried. In upcoming 7.1.0 release we are using nmap to query the NAS for which protocol version(s) it supports and then using highest version.

Heres the command
Code:
sudo apt-get install nmap
nmap HOST_NAME_OR_IP -p 139 --script smb-protocols |grep \|

The output is parsed a bit more by some PHP code.

I'd be interested is seeing what you get for output.

-Tim
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#6
Good idea to query the newest protocol. Here is my output:

Code:
pi@moode:~ $ nmap 192.168.1.50 -p 139 --script smb-protocols |grep \|
| smb-protocols:
|   dialects:
|     2.02
|     2.10
|     3.00
|     3.02
|_    3.11
Reply


Forum Jump: