LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-23-2012, 01:11 PM   #1
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Rep: Reputation: 32
autofs with cifs filesystem creating mountpoint twice?


Hi,

I'm trying to use autofs to automatically mount CIFS shares but running into a strange issue.

I've followed this guide:

http://wiki.centos.org/TipsAndTricks...e1aeaa80bb20b8

and the issue I'm having is this (df output):

Code:
df: `/mnt/mysqlbackup/mysqlbackup': No such file or directory
Now my files look like this:

auto.master
Code:
#
# $Id: auto.master,v 1.4 2005/01/04 14:36:54 raven Exp $
#
# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#
/misc	/etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
#	"nosuid" and "nodev" options unless the "suid" and "dev"
#	options are explicitly given.
#
/net	-hosts
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master

/mnt/mysqlbackup	/auto.smb.top
auto.smb.top
Code:
-fstype=autofs,-Dhost=& file:/etc/auto.smb.sub
auto.smb.sub
Code:
* -fstype=cifs,user,uid=505,rw,suid,credentials=/root/.mysqlbackup.txt	://172.31.8.158/mysqlbackup
basically I've tried all combinations of putting and removing the * infront of the -fstype parameter and putting in or taking out the /mnt/mysqlbackup from the auto.master file...

whenever I try and mount using:
Code:
* -fstype=autofs,-Dhost=& file:/etc/auto.smb.sub

* -fstype=cifs,user,uid=505,rw,suid,credentials=/root/.mysqlbackup.txt	://172.31.8.158/mysqlbackup
I get some kind of recursive directory mount which was basically the df output above mysqlbackup/mysqlbackup ???


How can I just have 1 level of mysqlbackup so that the mount looks like:

/mnt/mysqlbackup/...


Can anyone help?


Thanks
 
Old 03-25-2012, 07:44 AM   #2
ianll
LQ Newbie
 
Registered: Jan 2011
Posts: 18

Rep: Reputation: 2
I seem to have forgotten my autofs memories, so bear with me..

Why have you got the auto.smb.sub configuration file? Is the auto.smb.top doing something special? (I really have forgotten everything!)

Are you trying to mount different things depending on what directory you access?

ianll
 
Old 03-25-2012, 10:35 AM   #3
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Original Poster
Rep: Reputation: 32
Ok I've figured this out!

Basically I created 2 files looking like this:

Code:
auto.master file:

/mnt    /etc/auto.smbmount

auto.smbmount file:

mysqlbackup -fstype=cifs,uid=500,user,rw,credentials=/root/.password.txt 
://SAMBA-SRV/mysqlbackup
and now the autofs service works.

I think the CentOS link confused me:

http://wiki.centos.org/TipsAndTricks/WindowsShares

under method 4. which is kinda weird.


Thanks for the attepted help though.

I mean I have multiple shares/mounts which go under multiple directories; some under /mnt others under /opt/../../ etc....

So have yet to test my 'working' method out 100% but we'll see what happens!
 
  


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
Using Autofs to mount CIFS share and busy files? wernox Linux - Server 5 04-30-2010 05:39 AM
[SOLVED] autofs, fstab and manual cifs mounts fail if using credentials file carltm Red Hat 1 12-02-2009 07:39 AM
cifs + autofs failed to lookup (program) UltraSoul Linux - Software 0 06-22-2008 10:53 AM
using autofs to mount ext3 filesystem markcowley Linux - Software 5 07-17-2006 02:18 PM
using autofs to effectively symlink to an existing filesystem unsteady Linux - General 0 04-12-2001 10:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:46 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