LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need help mounting SAMBA network share (https://www.linuxquestions.org/questions/linux-newbie-8/need-help-mounting-samba-network-share-4175437201/)

Bozrdang 11-14-2012 09:42 PM

Need help mounting SAMBA network share
 
I am trying to mount a smb share from my NAS onto my Ubuntu 12.04 desktop. I've tried the following:

Code:

mount -t cifs //192.168.1.42/mysql_backup /media/mysql_backup
Whenever I run that it asks for a password. Once for sudo and then it just says password. I don't know what other password it wants so I enter my current user password again and I get:

Code:

mount error(13): Permission denied
I'm not sure what to do about this. I've read about specifying a username and password, but the username and password for what? The NAS share that I am trying to mount is not password protected. I can navigate to it and manipulate files on both Win and Ubuntu (via Browse Network)without ever having to enter a username or password.

So what do I need to do to get my share mounted?

TroN-0074 11-14-2012 10:09 PM

can you do it from your file browser under the network option? If you are in Ubuntu then Nautilus has the capability. Look on the pane on the left side of Nautilus click on the Network icon then it will display your shares on the network. You must know the user and password of SAMBA.

Good luck to you.

Bozrdang 11-14-2012 10:15 PM

Sorry, I should've been more clear. I need to figure out the command to perform the mount so I can put it in fstab to automount on boot.

I didn't realize there was a username and password for SAMBA. How do I find out what it is?

TroN-0074 11-14-2012 10:27 PM

This link shows you the steps to set up SAMBA in Debian running in a Raspberry Pi http://elinux.org/R-Pi_NAS
For Ubuntu will be very similar. Read the steps first it will show you how to create a SAMBA user and how to set up the password.

Good luck to you.

Bozrdang 11-15-2012 11:28 AM

I am trying to mount a share from my NAS. So would I need to setup a Samba user on Ubuntu or my NAS? And if there is no user setup now, wouldn't that just mean security isn't enabled and shouldn't I be able to mount the share without any credentials?

I'm asking because I want to understand this as opposed to just knowing something will work without fully grasping why.

Bozrdang 11-15-2012 01:57 PM

After much trial and error I have it working. Here is the line I added to fstab:

Code:

//192.168.1.42/mysql_backup  /media/mysql_backup  cifs  guest,uid=1000,gid-1000  0  0
I gather that some user/pass has to be specified or you need to specify guest. The uid & gid I used are my user on Ubuntu. Without specifying that it was mounted with root user and group which kept me from being able to write to files. I don't understand why it mounted as root rather than the current user/group or even the user/group already assigned to the files and dirs on the server. This is something I still don;t understand about Linux.

One problem. When I boot Ubuntu I see a quick message about CIFS error. It's too quick to read it all. When I run grep cifs /var/log/syslog I see the following:

Code:

Nov 15 14:44:13 Ubuntu-VM kernel: [      4.170545] CIFS VFS: cifs_mount failed w/return code = -101
Nov 15 14:44:13 Ubuntu-VM kernel: [      4.419017] CIFS VFS: cifs_mount failed w/return code = -101

I haven't created any other mounts in my fstab so I can only assume those messages are related to this mount, but it seems to be working correctly. How do I figure out what those errors are related to?


All times are GMT -5. The time now is 02:50 AM.