Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-21-2005, 12:14 PM
|
#1
|
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:
|
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.
|
|
|
10-21-2005, 12:25 PM
|
#2
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
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.
|
|
|
10-21-2005, 01:08 PM
|
#3
|
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:
|
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?
|
|
|
10-21-2005, 01:13 PM
|
#4
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
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.
|
|
|
10-21-2005, 01:26 PM
|
#5
|
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:
|
Hmm, hmm, seems like i just learned something new...
Escaping whitespaces with '\' works in bash though...
and thanks for your help, jilighter!
--polemon
|
|
|
10-21-2005, 01:55 PM
|
#6
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
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.
|
|
|
10-25-2005, 12:17 PM
|
#7
|
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:
|
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!
|
|
|
All times are GMT -5. The time now is 09:23 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|