-   Slackware (
-   -   Automount - releases disks but drives stay mounted (

JohnKFT 04-16-2004 04:20 AM

Automount - releases disks but drives stay mounted
After some struggle I finally got automount working in 9.1 - at least it sort of works. I can put disks in and out quite happily but the drives seem to stay mounted. Entry remains in /etc/mtab and the mounted icon showing in Rox filer, and I am told device is busy if I try to rename it or anything.

One thing I am uncertain of is the absence of /etc/rc.d/init/autofs which all the advice says I should restart. I filled in /etc/auto.master as instructed and made the relevant /etc/auto.* files for each device. I then got it working by doing

# automount -t 10 /mnt/cdrom file /etc/auto.cdrom

I then put this in /etc/rc.d/rc.local and it fires up when I reboot. Autofs module is loaded and being used and I have an automount process running for each device and an entry for each in /etc/mtab like this:

automount(pid2260) /mnt/cdrom autofs rw,fd=5,pgrp=2260,minproto=2,maxproto=3 0 0

The drives seem to mount on booting then stay mounted, but I can put disks in and out with impunity. Any attempt to access the file manager seems to make the drive click for a moment before the window is displayed.

Anyone know what the problem could be? Should my old entries remain in /etc/fstab? I could find nothing about this but tried with and without them commented out and it seemed to make no difference.

ugge 04-19-2004 11:34 AM

The automount program automatically mounts disks/drives when accessed, but only unmounts them after a certain amount of time, default 5 minutes.

/etc/init.d/autofs status will show you how the automount is configured.

JohnKFT 04-19-2004 01:22 PM

Thanks for that. Yes, I set the time delay according to instructions but it seems not to have an effect. I do not have an etc/init.d or any kind of autofs file other than stuff in /usr/src/linux-2.4.22/ and /usr/lib. Everything I read tells me to run /etc/init.d/autofs plus various things like restart etc. Why do I not have it in a standard full Slackware 9.1 install? Anyone know?

Nis 04-19-2004 01:28 PM

Slackware does not use /etc/init.d (SystemV style init scripts); all init scripts are in /etc/rc.d (BSD style). Any local initializations should be put in /etc/rc.d/rc.local

JohnKFT 04-19-2004 01:37 PM

Thanks Nis, that clarifies things. However, I did check all the /etc/rc.d scripts and found no /etc/rc.d/init/autofs that I was also told I should use. As I said originally, I put my automount scripts in /etc/rc.d/rc.local and that seems to make it work apart from this business. Can you throw any light on why I have no autofs script, or is that just what I have effectively made myself and put in rc.local?

ugge 04-19-2004 01:52 PM

The documentation says that it unmounts after a certain amount of inactivity. If I'm not wrong that would mean no process has bean in that directory.
Normally when unmounting partitions you couldn't even have a shell who's current working dir is within that partition.

Check with [b]fuser -m <device name or path>[b]
This will show any processes using that directory/file system.

tobyl 04-19-2004 03:07 PM

This may not be relevant, as I do not use autofs, but bear with me!
What follows only has an effect if you have kde running, and probably konqueror
as well, so if you are using roxfiler, JohnKFT, this may well be no use.
In KDE Control centre/KDE Components/Kde Performance under Preloading, there is an
option to select no of instances preloaded. I found that I sometimes had problems unmounting drives unless this is set to 0.

Please ignore if this has no bearing on your case!


JohnKFT 04-19-2004 04:49 PM

Well, I do not use kde but it is surprising what can be helpful. Both the last two posts have given me what I think is the answer : [ # fuser -m /dev/cdrom ] gave me the pid of the automount process controlling /mnt/cdrom. Presumably this should not be happening. I also discovered that the entry in /etc/mtab that I quoted above is the automount process and is supplemented by another entry for the device when a disk is inserted. The moment the disk is removed the second entry disappears but these remain:

automount(pid598) /mnt/cdrom autofs rw,fd=5,pgrp=598,minproto=2,maxproto=3 0 0
automount(pid602) /mnt/ftp autofs rw,fd=5,pgrp=602,minproto=2,maxproto=3 0 0
automount(pid600) /mnt/floppy autofs rw,fd=5,pgrp=600,minproto=2,maxproto=3 0 0

So what do we think is happening? Clearly the devices are being mounted and unmounted on demand as expected, but the filer - both ROX and xfm - think they are permanently busy so do not allow me control over them. Just checked with bash and even a terminal claims /mnt/cdrom is busy, so the pid of the automount process must be doing this. Anyone any suggestions?

PS I tried experimentally commenting out the above entries in /etc/mtab and reloading things but it made no difference. I guess the pid of automount is making the machine think the devices are mounted rather than the /etc/mtab entries.

ugge 04-19-2004 05:07 PM

You should normally not edit the mtab file directly as this is what the mounting tools do. The mtab keeps a record of what is mounted.

What I can see from the man pages you should configure the mount points in /etc/auto.master
There are no references to /etc/fstab so try to comment out the entries corresponding to the auto mounted file system and see if it works.

All times are GMT -5. The time now is 06:01 AM.