LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux > 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

Tags used in this thread
Popular LQ Tags , ,

Reply
 
Thread Tools
Old 12-17-2008, 03:59 AM   #1
idokus
LQ Newbie
 
Registered: Sep 2004
Distribution: ubuntu
Posts: 9
Thanked: 0
mount a (windows) network drive using command line


[Log in to get rid of this advertisement]
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.
idokus is offline  
Tag This Post , ,
Reply With Quote
Old 12-17-2008, 07:01 AM   #2
Felipe
Member
 
Registered: Oct 2006
Posts: 76
Thanked: 1
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....
Felipe is offline     Reply With Quote
Old 12-17-2008, 08:32 AM   #3
idokus
LQ Newbie
 
Registered: Sep 2004
Distribution: ubuntu
Posts: 9
Thanked: 0

Original Poster
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"
idokus is offline     Reply With Quote
Old 12-17-2008, 08:44 AM   #4
Felipe
Member
 
Registered: Oct 2006
Posts: 76
Thanked: 1
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).
Felipe is offline     Reply With Quote
Old 12-17-2008, 09:00 AM   #5
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 12,876
Thanked: 232
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?
jschiwal is online now     Reply With Quote

Reply

Bookmarks


Thread Tools

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 07:34 PM
mount: unknown filesystem type 'ntfs' when trying to mount windows drive... DiZASTiX Linux - Hardware 12 09-28-2008 08:29 PM
Mount USB drive from command line rcrummett Linux - Newbie 10 09-25-2008 06:16 PM
can not mount a samba drive on command line but see via GUI cricballa Linux - Newbie 9 10-20-2007 09:40 PM
mount of samba share hangs on command line Gates1026 Linux - Software 2 11-19-2003 09:57 AM


All times are GMT -5. The time now is 05:20 AM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration