LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-21-2005, 12:14 PM   #1
polemon
Member
 
Registered: Jun 2005
Distribution: Fedora 18, Ubuntu 11.10, Ubuntu Server 11.10, DamnSmallLinux 3.4.4, FreeDOS 1.1, OpenBSD 5.0
Posts: 194

Rep: Reputation: 31
Broblem mounting an smbfs in fstab without username/pass and weird names


Hi!

What I need:
there's this windows computer in our network, that has the shared folders 'MSK Archive' and 'MSK Uploads' .
As you can see, those names have a whitespace.
Additionally, i'd like to mount those folders in fstab, without username and password, but i don't know how to do this.

When i mount them from console, i use

'smbmount //jkbox/MSK\ Archive /home/polemon/msk-o guest'

or, i can put the host in quotes

'smbmount "//jkbox/MSK Archive" /home/polemon/msk-o guest'

and it all works fine.

But i need them every day, so i'd like to mount those folders at startup, with fstab.

Please tell me how i can do it.
 
Old 10-21-2005, 12:25 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
I haven't used them but "mount" manual page mentions smbfs and smbmount. Try checking out:

man mount
- Do locate for smb

man smbmount
- Do locate for fstab

The latter talks about using credientials so you don't have to include passwords in fstab.
 
Old 10-21-2005, 01:08 PM   #3
polemon
Member
 
Registered: Jun 2005
Distribution: Fedora 18, Ubuntu 11.10, Ubuntu Server 11.10, DamnSmallLinux 3.4.4, FreeDOS 1.1, OpenBSD 5.0
Posts: 194

Original Poster
Rep: Reputation: 31
Ok, this is what i entered in my fstab:

//10.85.71.1/MSK\ Archive /home/bereziak/msk/archive smbfs _netdev,pamconsole,auto,exec,users,guest 0 0
//10.85.71.1/MSK\ Uploads /home/bereziak/msk/upload smbfs _netdev,pamconsole,auto,exec,users,guest 0 0

but i still get an error, becuase of the whitespace i suppose...

any ideas how i can avoid this problem?
 
Old 10-21-2005, 01:13 PM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Typically you don't "escape" white space (putting in the "\" in front it) -instead you "quote" it.

Try:
"//10.85.71.1/MSK Archive"

--OR---

'//10.85.71.1/MSK Archive'

at the beginning of the line.


or maybe:
//10.85.71.1/'MSK Archive' (or double quotes)


Last edited by MensaWater; 10-21-2005 at 01:18 PM.
 
Old 10-21-2005, 01:26 PM   #5
polemon
Member
 
Registered: Jun 2005
Distribution: Fedora 18, Ubuntu 11.10, Ubuntu Server 11.10, DamnSmallLinux 3.4.4, FreeDOS 1.1, OpenBSD 5.0
Posts: 194

Original Poster
Rep: Reputation: 31
Hmm, hmm, seems like i just learned something new...
Escaping whitespaces with '\' works in bash though...

and thanks for your help, jilighter!

--polemon
 
Old 10-21-2005, 01:55 PM   #6
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
No problem.

I'm assuming the quoting fixed it? If so can you specify which one did it so anyone perusing the thread in future will know without having to ask?

FYI: Quoting/escaping is sometimes more of an art than a science. Different utiltiies will use different things and sometimes you have to nest your quoting escaping and get really bizarre looking command lines just to get it right.

A perfect example:
How to pipe find output into xargs when some of the files have spaces in their names (Oracle is retarded - does this and also names thing "core" just to annoy *NIX users). Had to do this for refreshes on a regular basis.

Normally I'd just do:
find <dirname> -user <UID> |xargs chown <newuser>

The above command would list all files in the specified directory owned by the specifid user and change the owner to the new user specified. It would blow up because of spaces in files as it would think each space was a separate file.

I tried:
find <dirname> -user <UID> |awk '{print "$0"} | xargs chown <newuser>

The awk variable $0 = the entire line.

This did not work though. After some discussion with a coworker we came up with:
find <dirname> -user <UID> |awk '{print "\""$0"\""} | xargs chown <newuser>

Basically had to "quote" the "escapes" that were "escaping" the following "quotes". (Aaaaaaaaaaaaaaaaaaaggggggggggggghhhhhhhhhh!)

On Unix there's a man page called "regexp" - you can find it on line to get some detail. Unfortunately my Linux distros don't have it. You have to do "man egrep" or "man awk" and search for Regular Expressions to get some info that way.

Most utilities that do any amount of text processing will indicate if they do Regular Expressions and also if they depart from its normal operation (see "man sed" for example) if they do.
 
Old 10-25-2005, 12:17 PM   #7
polemon
Member
 
Registered: Jun 2005
Distribution: Fedora 18, Ubuntu 11.10, Ubuntu Server 11.10, DamnSmallLinux 3.4.4, FreeDOS 1.1, OpenBSD 5.0
Posts: 194

Original Poster
Rep: Reputation: 31
I tryed EVERYTHING, Single quotes, double quotes, whole path to share, just the share name, and the combinations of them, nothing worked.

But i found a nice workaround for my problem:

i let the folders mount after init, with a shellscript.

i placed the smbmount lines in /etc/rc.d/rc.local works fine now!
 
  


Reply


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
pass blank username in lynx PlatinumRik Linux - Software 1 07-07-2005 09:43 AM
Forgot modem username/pass... help! Trinity22 Linux - Hardware 4 06-03-2005 07:30 PM
mounting an smbfs share using mount vs /etc/fstab sichen Linux - Networking 4 08-13-2004 06:40 PM
whats the default swat username and pass citrus Linux - Networking 3 08-04-2004 05:25 PM
RH9 mounting SMBFS from fstab - Jefficus Linux - Networking 24 11-24-2003 04:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:23 PM.

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