Automount - releases disks but drives stay mounted
SlackwareThis Forum is for the discussion of Slackware Linux.
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.
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.
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:
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.
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?
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
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?
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.
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!
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:
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.