LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 07-11-2006, 08:25 AM   #16
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31

you should just install the autofs package "sudo apt-get install autofs" that will make all the /etc/auto.* and init scripts. You have to install the package for it to work
Like installing iptables, the kernel has support for it (module) but you still need the package to implement it.
 
Old 07-11-2006, 09:31 AM   #17
fopetesl
Member
 
Registered: Jan 2005
Location: Yorkshire Dales, UK
Distribution: Ubuntu 5.10; Mandriva 2007; Debian Lenny
Posts: 147

Original Poster
Rep: Reputation: 15
Ummm. Yes. I understood that but what about kernel compatibility?

Like I said, I don't want to take the risk of breaking my system, (even if I do have a back up),i.e. is the repository autofs package up to the latest kernel? If I do as you suggest and it does break, what next?

Surely there is a way of manually constructing the files and links.
 
Old 07-11-2006, 12:14 PM   #18
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
The package contains the binary needed to use autofs you wont be able to use it without that, no matter what config files and links you have. The package in the repository will be fine on with your kernel. The only thing in the kernel for autofs is support for it, it's not implemented unless you get the package. The only way it would have a (slim) possibility that it wouldn't work is if you make a custom kernel, and even then it wouldn't break your system if it wasn't the right version, automount just wouldn't work (well). The package doesn't install any kernel modules just uses the autofs4 one.
 
Old 07-11-2006, 06:33 PM   #19
igorc
Member
 
Registered: May 2005
Location: Sydney, Australia
Distribution: Ubuntu 5.04, Debian 3.1
Posts: 74

Rep: Reputation: 15
Hi,

You can try adding the following line in /etc/fstab file:

/dev/fd0 /mnt/floppy auto user,defaults,noauto 0 0

which should automatically mount the floppy drive when floppy disk is being inserted in the drive.

Regards.
 
Old 07-12-2006, 02:08 AM   #20
fopetesl
Member
 
Registered: Jan 2005
Location: Yorkshire Dales, UK
Distribution: Ubuntu 5.10; Mandriva 2007; Debian Lenny
Posts: 147

Original Poster
Rep: Reputation: 15
igorth : won't work because a floppy drive doesn't have any method of signalling that a disk has been inserted whereas most cdrom drives do.
Am still working on autofs though I cannot see yet how that will see a disk being inserted.
 
Old 07-12-2006, 03:49 AM   #21
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
what I think it (should) do it try and mount the device when the mount point is accessed?
 
Old 07-12-2006, 06:39 AM   #22
fopetesl
Member
 
Registered: Jan 2005
Location: Yorkshire Dales, UK
Distribution: Ubuntu 5.10; Mandriva 2007; Debian Lenny
Posts: 147

Original Poster
Rep: Reputation: 15
autofs from thread 1097848
Quote:
autofs works this way round:

(eg floppy set op in autofs to mount to /mnt/floppy)

1) you try to access /mnt/floppy
2) autofs makes the directory
3) autofs mounts the floppy
4) when you've not accessed the device for longer than the timeout, autofs umounts the device
5) the directory dissappears


You will not find the floppy unless you navigate to where it should appear

With autofs you do not create the directory a device mounts into. You will only see the directories a device mounts to when you have already navigated there

You may need to remove the device from your fstab to avoid confusion.
Well it doesn't on my system! I removed the /dev/fd0 line from fstab and set up:
Code:
#
# $Id: auto.master,v 1.3 2003/09/29 08:22:35 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 --timeout=30
#/misc	/etc/auto.misc
#/net	/etc/auto.net
Code:
#
# $Id: auto.misc,v 1.2 2003/09/29 08:22:35 raven Exp $
#
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage

cd		-fstype=iso9660,ro,nosuid,nodev	:/dev/cdrom
floppy		-fstype=vfat,ext2,rw,sync,umask=002	:/dev/fd0

# the following entries are samples to pique your imagination
#linux		-ro,soft,intr		ftp.example.org:/pub/linux
#boot		-fstype=ext2		:/dev/hda1
#floppy		-fstype=ext2		:/dev/fd0
#e2floppy	-fstype=ext2		:/dev/fd0
#jaz		-fstype=ext2		:/dev/sdc1
#removable	-fstype=ext2		:/dev/hdd
created a directory /misc with 755 permission.
Insert a floppy (with FAT files) and try to ls /misc/floppy. Nada.
So I go to Places->Computer->Floppy and click..whirr..whirr..eventually the files show up. Where are the files? Not in /misc/floppy but in /media/floppy!!
So
Code:
root@ubuntu:/etc#  mount
/dev/hda1 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
tmpfs on /dev type tmpfs (rw,size=10M,mode=0755)
automount(pid7770) on /misc type autofs (rw,fd=4,pgrp=7770,minproto=2,maxproto=4)
/dev/fd0 on /media/floppy type vfat (rw,nosuid,nodev,quiet,shortname=winnt,uid=1000,gid=1000,umask=077,iocharset=utf8)
How does the system know to mount into /media/ ?? I removed the mount point from fstab!!
Not only that why isn't autofs taking over and creating /misc/floppy?
I tried deleting directory /media/floppy then accessing the floppy from Places->Computer but the directory is re-created and it does not disappear when I remove the floppy.
Also I note that
Code:
root@ubuntu:/etc# tail -n 10 /var/log/syslog
Jul 12 14:53:14 localhost automount[9796]: lookup(program): lookup for floppy failed
Jul 12 14:53:14 localhost automount[9796]: failed to mount /misc/floppy
Jul 12 14:53:29 localhost automount[9805]: lookup(program): lookup for floppy failed
Jul 12 14:53:29 localhost automount[9805]: failed to mount /misc/floppy
Jul 12 14:53:31 localhost automount[9808]: lookup(program): lookup for floppy failed
Jul 12 14:53:31 localhost automount[9808]: failed to mount /misc/floppy
so something is either wrong in my auto.* files or the system is blocking access to autofs (?)

Last edited by fopetesl; 07-12-2006 at 07:55 AM.
 
Old 07-12-2006, 08:16 AM   #23
fopetesl
Member
 
Registered: Jan 2005
Location: Yorkshire Dales, UK
Distribution: Ubuntu 5.10; Mandriva 2007; Debian Lenny
Posts: 147

Original Poster
Rep: Reputation: 15
Solved!

I read this:
Quote:
On Sat, 14 May 2005 20:51:28 -0400
Michael B Allen <mba2000 ioplex com> wrote:

> /mnt/foo if accessed. However with FC3 this simply does not work. I get:
>
> May 14 20:44:00 quark automount[9844]: lookup(program): lookup for foo failed

I made an error. I accedentally created the auto.foo map file with
executable permissions. If you do this the autofs init script will
interpret it as a "program" and attempt to execute it rather then parse
it as a regular map file. Simply doing chmod -x on it and restarting
autofs fixes the problem.

Needless to say the autofs documentation is in need of some work.

Mike
Now floppy and cd get mounted and unmounted!
Great! Thanks for you kind help. Now all I need to do is to sort recognition of USB Stick and USB floppy.
 
  


Reply

Tags
autofs, automount



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
Why can't I automount my zip drive? dr_who Linux - Newbie 4 04-26-2006 04:24 AM
Automount Floppy Not Working mfeat Linux - Software 4 08-09-2004 09:25 AM
automagically mount Magneto-Optical Drive? wytiger Fedora 0 07-27-2004 10:56 PM
automount floppy, suse 9.0 Horny Toad Linux - Newbie 3 04-22-2004 03:00 PM
re: automount and cdrom and floppy ergo_sum Linux - Newbie 2 08-12-2003 03:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

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

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