2

I have a usb drive connected to my router, it's a share, works fine from all our windows machines and from Ubuntu, but not from Raspbian. I got the IP-address with nmblookup -S WORKGROUP and the path with smbtree -N, and I can list it:

pi@RPi2a ~ $ /usr/bin/smbclient -L //192.168.2.253/SMBSHARE -N  
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.3.14]  

        Sharename       Type      Comment  
        ---------       ----      -------  
        samba           Disk      samba share dir  
        IPC$            IPC       IPC Service (Samba Server)  
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.3.14]  

        Server               Comment  
        ---------            -------  
        MY_LT  
        RPI2A                RPi2a server  
        SMBSHARE             Samba Server  

        Workgroup            Master  
        ---------            -------  
        WORKGROUP            SMBSHARE  

I'm trying to mount it with:

sudo mount -t cifs //192.168.2.253/SMBSHARE/samba/usb1_1 /mnt/pishare --verbose -o guest  

Resulting in:

mount.cifs kernel mount options: ip=192.168.2.253,unc=\\192.168.2.253\SMBSHARE,guest,user=,prefixpath=SAMBA/USB1_1,pass=********  
mount error(6): No such device or address  

Trying to find a solution, I came across this and this (among many many others). Trying to connect with smbclient:

$ sudo /usr/bin/smbclient \\\\192.168.2.253\\SMBSHARE\\samba\usb1_1 -Nd=3  

I get:

...  
Connecting to 192.168.2.253 at port 445  
Connecting to 192.168.2.253 at port 139  
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.3.14]  
tree connect failed: NT_STATUS_BAD_NETWORK_NAME  

I should add that Samba does run on the RPi, for sharing some folders on the Pi itself. As I understood, cifs doesn't use /etc/samba/smb.conf, the smbclient command is just for checking permissions. But I don't even get there. Should I pass more parameters to smbclient?

I don't understand why mount.cifs can't find the share, when smbclient -L does list it properly. Nor do I see how permissions enter into it, as I can successfully browse and read everything from Windows and Ubuntu without credentials.

2 Answers 2

1

The mount needs to be of the form //<server>/<share>. From the smbclient -L output, the relevant parts are:

        Sharename       Type      Comment  
        ---------       ----      -------  
        samba           Disk      samba share dir  
        IPC$            IPC       IPC Service (Samba Server)  
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.3.14]  

        Server               Comment  
        ---------            -------  
        MY_LT  
        RPI2A                RPi2a server  
        SMBSHARE             Samba Server  

As $IPC$ is a default share, the likely only valid share here is samba. The server can be identified either via the IP (192.168.2.253) or by name (SMBSHARE).

Unfortunately in the mount command, the two are combined, both in

sudo mount -t cifs //192.168.2.253/SMBSHARE/samba/usb1_1 /mnt/pishare --verbose -o guest  

and in

$ sudo /usr/bin/smbclient \\\\192.168.2.253\\SMBSHARE\\samba\usb1_1 -Nd=3  

The double server portion is incorrect. It should be //192.168.2.253/samba/... or //SMBSHARE/samba/....

0

Instead of

-o guest

as your mount option, try

-o username=guest,password=foo,iocharset=utf8,sec=ntlm,noserverino

(password can be anything you want, but it can't be empty.)

This is a fairly recent change in CIFS support, and in my experience older guest network shares needed to be changed over to use these options.

1
  • 1
    Thanks, but it didn't fix it, alas. I checked the cifs-utils install as per here, and I tried with ,file_mode=0777,dir_mode=0777,port=445 appended, and verified that port 445 is listening. Still I get mount error(6): No such device or address. Am now going to wade through man mount.cifs.
    – RolfBly
    Commented Nov 5, 2016 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.