LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-17-2008, 02:59 AM   #1
idokus
LQ Newbie
 
Registered: Sep 2004
Distribution: ubuntu
Posts: 10

Rep: Reputation: 0
mount a (windows) network drive using command line


I have a problem mounting a network drive, I need to do this in command line, since I need it to be a script multiple users can use.

Manually I can mount it using the "connect to a windows network" tool in the places menu. So the server, share and credentials are valid.

Code:
root# mount -t cifs //<server>/Users$/<userdir> /mnt/local_mount/ -o credentials=/mnt/login
returns:

Code:
mount error 20 = Not a directory
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
I know the server-share and /mint/local_mount both exists and the local mount is a directory.

If someone knows what command is equivalent to the mount in the connect to network (windows share), that would be helpful as well.
 
Old 12-17-2008, 06:01 AM   #2
Felipe
Member
 
Registered: Oct 2006
Posts: 302

Rep: Reputation: 32
This is the way I use to mount it
/sbin/mount.cifs "//server/share" "/mnt/point" -o credentials=credencials_file,iocharset=utf8,file_mode=0600,dir_mode=0700


and it works fine.

I suppose that <user_dir> is a share in the server ¿no? You can see it with

smbclient -L server
or
smbclient -L server -u user_windows

I don't know if this is what you are looking for....
 
Old 12-17-2008, 07:32 AM   #3
idokus
LQ Newbie
 
Registered: Sep 2004
Distribution: ubuntu
Posts: 10

Original Poster
Rep: Reputation: 0
This is somewhat I was looking for, yet I don't see why that should work and the command I'm giving, isn't.

Perhaps the problem is that <userdir> isn't a share, but User$ is. But that is a hidden share, so it probably won't show up in "smbclient -L server"
 
Old 12-17-2008, 07:44 AM   #4
Felipe
Member
 
Registered: Oct 2006
Posts: 302

Rep: Reputation: 32
With smblclient you list all shares, even if they are hidden.

Windows Explorer doesn't show shares which finish with "$", but linux does.

An easy (and bad way) to hide shares in windows is to put a $ sign to the name of the share. But if you connect from linux (for example, using konqueror, in the url put \\sever, you see all shares, even hidden).
 
Old 12-17-2008, 08:00 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
How is the Users share defined. If the service offered is the /home directory, then you need to mount //server/Users$
instead. If the definition uses /home/%U, then the users home directory is substituted and you should mount //server/<username>.

If you browse to //server/Users$, do you see all of the users on the server or just you?
 
  


Reply

Tags
cifs, mount, network


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing Windows shared drive from command line michaelmalak Linux - Networking 2 11-10-2008 06:34 PM
mount: unknown filesystem type 'ntfs' when trying to mount windows drive... DiZASTiX Linux - Hardware 12 09-28-2008 07:29 PM
Mount USB drive from command line rcrummett Linux - Newbie 10 09-25-2008 05:16 PM
can not mount a samba drive on command line but see via GUI cricballa Linux - Newbie 9 10-20-2007 08:40 PM
mount of samba share hangs on command line Gates1026 Linux - Software 2 11-19-2003 08:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration