Jump to content

help! autofs - automounter [solved]


aioshin
 Share

Recommended Posts

ok, I'v read that we can mount smbfs and/or nfs on demand, via automount or autofs. I have a windows box with a shared folder named officefiles, say.. //xp01/officefiles with user=user01 and password=pw001 to access it.

.

here's how I configure it...

.

from a LE2005 box

.

installed autofs

.

kernel support autofs - checked

.

my /etc/auto.master

#/etc/auto.master
/officefiles /etc/auto.smb   --timeout=60

and my /etc/auto.smb

#/etc/auto.smb
drive   -fstype=smbfs,username=user01,password=pw001,uid=1000,gid=1000	   ://xp01/officefiles

.

after restarting autofs, it autocreates /officefiles directory... but when am trying to ls /officefiles, its empty and when am doin a df, its not mounted... what am not sure is, should I create that folder manually? (but it was auto created after starting autofs)..

.

when checking the logs after starting autofs, this is what it shows..

x automount[19337]: failed to mount /officefiles/.directory
Feb  9 15:41:45 nixbox autofs: automount shutdown succeeded
Feb  9 15:41:45 nixbox autofs: automount startup succeeded
Feb  9 15:41:49 nixbox automount[19487]: failed to mount /officefiles/.directory

about the uid, that was set as the same uid of the regular user on my linux box, so it should be able to access the supposedly on demand share...

.

anyone have tried this set-up sucessfully?

 

 

thanks in advance!

Link to comment
Share on other sites

ok, I found the problem, it was me, on my auto.smb config

#/etc/auto.smb
drive   -fstype=smbfs,username=user01,password=pw001,uid=1000,gid=1000	   ://xp01/officefiles

the first entry is "drive", and what I did was just "ls /officefiles" since the "/officefiles" directory was created automatically, now I realized that I should include the "drive" since it is where the //xp01/officefiles will be mounted, so I should have to "ls /officefiles/drive" and it will be mounted. So partially solved...

.

now on my /etc/auto.master

/officefiles /etc/auto.smb   --timeout=60

I stated there the "--timeout=60" and supposedly it'll auto-unmount the mounted drive after 60 seconds according to man page, but it did'nt ...

.

I'll update if I'll be able to fix it

.

if you have a suggestion, thanks in advance

:P

Link to comment
Share on other sites

hmmn... I wonder why on my Mandriva LE 2005, it does not auto unmount the mounted smb or nfs partition after the specified --timeout time.. while on my Centos BOX, the same scenario, accessing thus remote nfs and smb drive using autofs, it did'nt gave me any problem... when I access the on-demand folder, it automatically mounted and after several seconds (time set on --timeout) of not using the mounted directory, the said partition automatically been removed or gone...

.

so in short, autofs on my CentosBox functions correctly or as how it should be while on mandriva (LE 2005), it does not... (in particular, the auto-unmounting problem)

.

is there a special setup that should be done on Mandriva regarding autofs, or maybe its a kind of BUG...

.

hope someone can help, because if I can't resolve it, I will be force to change or replace the current mandriva on some of my workstations.....

.

still googling on it, there might be an issue similar to this before....

Link to comment
Share on other sites

ok.. here's my update, I have several MDK10.1 workstations and autofs does works fine on it, I mean, my issue of not un-mounting it after the defined timeout does not occur on it... hmm, it might be that its only happening on my desktop which is 2005LE... later I'll try to install autofs on another pc that uses LE2005 to see if the problem occurs only on my own desktop...

.

at least I'll not be going to replace any distro, its a lot of work.. :P

.

Link to comment
Share on other sites

I've tried it on another pc that uses LE2005 and the same problem encountered, it will not auto un-mount after the defined --timeout, its using the default kernel of LE2005. I also tried my own desktop to boot on its default kernel but also will not work.

.

what could be the problem with this?

.

googling and googling and googling........

Link to comment
Share on other sites

  • 1 month later...

Ok, I found the fix... installing autofs from source with the latest release and of course removing the one that came from mandriva LE package, and it will now auto-unmount after the specified timeout.

.

The source can be found here: http://www.kernel.org/pub/linux/daemons/autofs/v4/

.

It might be that there is a bug on the autofs package from mandriva in particular to LE2005 ( I have not tried it on 2006, so I dunno), since its not capable of unmounting the mounted device or nfs share after the defined timeout.

 

So considered it solved!!!!

 

:P

Edited by aioshin
Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...
Guest daddyfix
autofs on 2006 has the same problem with 2005, the fix for me, same.. compile and install from source.

 

Aoishin,

 

I am having trouble getting Autofs to mount a windows share. I'm contemplating make-ing the source and trying again.

 

Do you know how the mandrake auto.smb script works? Have you made and windows file system shares (smbfs) with automount?

Link to comment
Share on other sites

autofs on 2006 has the same problem with 2005, the fix for me, same.. compile and install from source.

 

Aoishin,

 

I am having trouble getting Autofs to mount a windows share. I'm contemplating make-ing the source and trying again.

 

Do you know how the mandrake auto.smb script works? Have you made and windows file system shares (smbfs) with automount?

yes, I managed to mount windows shares via autofs... on demand

.

I'm not using the default script, so I create my own auto.smb file.. say, I named it /etc/auto.smb2 and below are the entry:

#/etc/auto.smb2
windows_share -fstype=smbfs,username=userxp,password=mypassword,uid=500,gid=500,dmask=775,fmask
=664 ://192.168.1.1/shared_drive

and heres the entry on my /etc/auto.master file

#/etc/auto.master
/mnt/smb /etc/auto.smb2 -t=10

details on /etc/auto.smb2:

- 192.168.1.1 - ip of windows pc that has a shared folder named shared_drive

- username=userxp / password=mypassword - the user with its password on xp box that has access on the shared folder named shared_drive

- uid and gid belongs to my user on my linux box

- dmask and fmask means that I have full access on that drive, as long as that userxp also has full access on it

windows_share - the name of the folder were the shared_drive will be mounted on my linux box under the details of auto.master file

..

details of auto.master file:

/mnt/smb - so I created manually a folder under /mnt named smb (#mkdir /mnt/smb)

-t = 10 - 10 secods later, it will auto unmount itself when not being accessed.

.

.

ok, after setting those above, you have to make sure that automount has been running... or make sure it run as a service.. "#chkconfig autofs on" will make it run as the ssytem boot, "/etc/init.d/autofs reload" will re-read the autofs config changes.

.

so after starting and reloading autofs, I am now able or should be able to access that defined windows shared folder.

.

as a user who owned the mentioned uid above, if I do 'ls /mnt/smb/windows_share' on my konsole, it should automatically list all the files and sub folders of that shared drive, under the specified path...

.

so just try the way how I'm doin it...

 

and welcome @ MUB! :D

Edited by aioshin
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...