What's new

Share USB drive from linux box (Raspberry pi)

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

leon

Regular Contributor
Hello,

I like to access the USB drive connected to my ASUS RT-AC66U. I have enable Samba share on the router with proper settings such that I can access the drive via a Win 7 computer.

When I tried to access the same share with the below, I got permission denied,

Code:
pi@raspberrypi ~ $ sudo mount -t cifs //192.168.1.1/samba -o username=xxxxxx,password=xxxxxx /mnt/mt1
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

I check the system log on the rounter and it shows
Code:
Jan 21 11:40:45 smbd[984]: [2014/01/21 11:40:45, 0] smbd/sesssetup.c:reply_sesssetup_and_X(1265)
Jan 21 11:40:45 smbd[984]:   reply_sesssetup_and_X:  Rejecting attempt at SPNEGO session setup when it was not negoitiated.

The drive is EXT3 formatted.

Any suggestions?

I have another questions: does the drive have to be EXT3 formated? Can it be NTFS for using Samba?
 
I think that for the mount command you need to double the slashes:

Code:
sudo mount -t cifs ////192.168.1.1//samba -o username=xxxxxx,password=xxxxxx /mnt/mt1

Also make sure /mnt/mt1 exists and has the right permissions.
 
I think that for the mount command you need to double the slashes:

Code:
sudo mount -t cifs ////192.168.1.1//samba -o username=xxxxxx,password=xxxxxx /mnt/mt1

Also make sure /mnt/mt1 exists and has the right permissions.

The error is now bad UNC
 
I think the -o switch must be last.

If i mimic my working mount:
Code:
mount ////192.168.1.1//samba /mnt/mt1 -t cifs -o "username=xxxxxx,password=xxxxxx"

Not sure if the quotes are needed, but my mount works.
 
For public shares you can use following command:

Code:
sudo mount -t cifs -o guest,sec=ntlm,rw,file_mode=0777,dir_mode=0777 //192.168.1.1/sda1 /**YourDirectory**

replace **YourDirectory** with your local directory
 
My RPi uses a share created on my NAS (Synology).
I just followed a short procedure I found with Google.
 
I think that for the mount command you need to double the slashes:
backslashes. I'm mounting NAS SAMBA share to router with:
Code:
SHARE=\\\\192.168.1.3\\Public
MPOINT=/tmp/mnt/Public

[ -d "$MPOINT" ] || mkdir $MPOINT
[ -z "$(lsmod | grep cifs)" ] && insmod /lib/modules/2.6.22.19/kernel/fs/cifs.ko
if [ -z "$(mount | grep cifs)" ]; then
            echo Mounting $SHARE to $MPOINT ...
            mount $SHARE $MPOINT -t cifs -o "username=guest"
fi
 
I tried to put the -o switch last, I got "Permission denied" error. The system log have the same error that I've shown in my original post.

I tried to append "sec=ntlm,rw,file_mode=0777,dir_mode=0777" after my password, I get

Code:
Retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

There is no error on the system log

I also tried using back slash such as

Code:
pi@raspberrypi /tmp $ sudo mount \\\\192.168.1.1\\samba /tmp/mt -t cifs -o username=xxxxx,password=xxxxx

I got "Permission denied" error.... sigh...
 
Could you post the result of

Code:
ls -al /mnt

to make sure the mount point exists and have the right permissions?
 
Here are the commands I issued. I only change the username and password

Code:
pi@raspberrypi /mnt $ sudo mount \\\\192.168.1.1\\samba /mnt/mt -t cifs -o username=username,password=password
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
pi@raspberrypi /mnt $ ls -al /mnt
total 12
drwxr-xr-x  3 root root 4096 Feb 16 17:15 .
drwxr-xr-x 23 root root 4096 Jan 28 22:23 ..
drwxr-xr-x  2 root root 4096 Feb 16 17:15 mt


Over at the router side, this is setup as

Code:
RT-AC66U->Generic Flash Disk->sdb1->samba

I suppose I do not need to include sdb1?

The system log at the router side shows

Code:
Feb 16 17:23:50 smbd[9704]: [2014/02/16 17:23:50, 0] smbd/sesssetup.c:reply_sesssetup_and_X(1265)
Feb 16 17:23:50 smbd[9704]:   reply_sesssetup_and_X:  Rejecting attempt at SPNEGO session setup when it was not negoitiated.
 
Try sec=ntlmv2 at the end.

so:
pi@raspberrypi /tmp $ sudo mount \\\\192.168.1.1\\samba /tmp/mt -t cifs -o username=xxxxx,password=xxxxx,sec=ntlmv2
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top