Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
autofs and automatic CDROM mounting. SOLVED with HOWTO
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
asbesto
Tux's lil' helper
Tux's lil' helper


Joined: 18 Sep 2003
Posts: 78
Location: Palazzolo Acreide, ITALY

PostPosted: Tue Oct 26, 2004 8:09 pm    Post subject: autofs and automatic CDROM mounting. SOLVED with HOWTO Reply with quote

note: hotwo is at the BOTTOM.

Well, i don't know exactly if there is a forum for this, but anyway, here's the problem.

I think is ABSURD, STUPID and ANACHRONISTIC that, in 2004, people must have carpal tunnel syndrome for writing all the times that stupid commands "mount /cdrom", "umount /cdrom" and so on, and this for YEARS, on his own PC, with absolutely NO SECURITY PROBLEMS ....

i'm writing those ugly mount commands from about 20 YEARS, and now I'M TIRED. so, my goal is to have cdrom automagically mounted when i insert the cd, as i think it MUST BE in the THIRD MILLENNIUM.

so here's what i've done :

Code:
emerge autofs


no problem here

Code:
enabled AUTOMOUNT v4 support in the kernel (2.4.25), make bzimage, lilo, and reboot.


no problem here :)

Code:
configured autofs :

   gemini autofs # pwd
   /etc/autofs

   gemini autofs # cat auto.master
   /cdrom  /etc/autofs/auto.cdrom

   gemini autofs # cat auto.cdrom
   cdrom           -fstype=auto,ro         :/dev/cdroms/cdrom0


this is what i red on other howto's ... i hope this is correct

Code:
 rc-update add autofs default


it seem all ok here

and, to try it:

Code:
 /etc/init.d/autofs start
gemini autofs # /etc/init.d/autofs start
 * Starting automounter...
 /cdrom                                        [ ok ]


and I THINK THIS IS OK ... (looking into the VOID with WHITE EYES)

Code:
some tests:

gemini autofs # mount
automount(pid3060) on /cdrom type autofs (rw,fd=5,pgrp=3060,minproto=2,maxproto=3)

gemini autofs # ps auxw
root      3060  0.0  0.1  1540  660 pts/1    S    19:54   0:00 /usr/sbin/automount --timeout 60 /cdrom file /etc/autofs/auto.cdrom

===============
and now, LET'S TRY THE HORRIBLE BEAST : i will take that ULTRA PORNO CD from my bookshelf and i will put into my cdrom reader.

ok.

now:

Code:

gemini autofs # ls /cdrom
gemini autofs # ls /cdrom
gemini autofs # ls /cdrom
gemini autofs # ls /cdrom
gemini cdrom # ls *
ls: *: No such file or directory
gemini cdrom # echo HELLOOO???? IS THERE ANY FILE IN THERE !??!?!?!?
-bash: !??: event not found
gemini cdrom #

==================================
i really don't know where i'm wrong. can someone
PLEASE HELP ME ???

:(
_________________
AMEN


Last edited by asbesto on Wed Oct 27, 2004 1:12 pm; edited 2 times in total
Back to top
View user's profile Send private message
donjuan
l33t
l33t


Joined: 11 May 2004
Posts: 760
Location: At Uni

PostPosted: Tue Oct 26, 2004 9:30 pm    Post subject: Reply with quote

I just tried Ivman (it's finally in portage) and it works quite well with the default settings. It just mounts the cd to /media/<watever> instead of /mnt/<whatever>. It's probably pretty simple to change, but I don't feel like doing it right now. It's just a quick solution in case nobody else can help you much with autofs.
_________________
Command-line ACCEPT_KEYWORDS is considered harmful, use the package.* files.

The Stage 1 on 3 Install
Back to top
View user's profile Send private message
asbesto
Tux's lil' helper
Tux's lil' helper


Joined: 18 Sep 2003
Posts: 78
Location: Palazzolo Acreide, ITALY

PostPosted: Wed Oct 27, 2004 12:19 pm    Post subject: I solved the problem. autofs use 2 ABSURD files for config! Reply with quote

Hi,

i solved the problem.

autofs have to be configured in this way:

Code:
asbesto@gemini asbesto $ cat /etc/autofs/auto.master
# $Id: auto.master,v 1.1 2000/08/08 17:53:33 achim Exp $
# Sample auto.master file
# Format of this file:
# mountpoint map options
# For details of the format look at autofs(8).
/mnt    /etc/autofs/auto.cdrom
#/home  /etc/autofs/auto.home


and

Code:
asbesto@gemini asbesto $ cat /etc/autofs/auto.cdrom
# $Id: auto.misc,v 1.2 2002/10/27 05:21:15 bcowan 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
#boot           -fstype=ext2            :/dev/hda1
cdrom           -fstype=auto,ro         :/dev/cdroms/cdrom0
#floppy         -fstype=auto            :/dev/fd0


EXPLANATION:

in auto.master you specify "/mnt" as starting point for the
other mount points, and a file to configure them (in
our case, auto.cdrom)
in auto.cdrom you specify the mount point itself.

so if you want to mount the cdrom in /mnt/cdrom, you have
to specify /mnt in auto.master and auto.cdrom as file for
configuring the mount point; and cdrom in auto.cdrom
file.

I'M WONDERING WHY, WHY THE AUTHORS OF AUTOFS
CHOOSE THIS DAMN WAY of using SUCH A HORRIBLE
SYSTEM to configure a program!!!
:evil:

WASN'T MORE SIMPLE TO USE JUST ONE (1) FILE, with
something like
Code:

/mnt/cdrom     /dev/cdrom    options     otheroptions 

???!?!?!?!?

8O

things like those are the DAMNATION of linux; so people choose
mac os-x and windows due to semplicity... :(

i hope we at freaknet medialab make a patch to autofs source
code to develop a more simple and automatic configuration scheme.

:D

http://www.freaknet.org
_________________
AMEN
Back to top
View user's profile Send private message
asbesto
Tux's lil' helper
Tux's lil' helper


Joined: 18 Sep 2003
Posts: 78
Location: Palazzolo Acreide, ITALY

PostPosted: Wed Oct 27, 2004 12:46 pm    Post subject: autofs and automatic CDROM mounting HOWTO Reply with quote

How to install autofs (automount) and configure it to have cdrom automagically mounted HOWTO

by asbesto at freaknet dot org

http://www.freaknet.org

:D

1) install autofs:

Code:
emerge autofs


2) let it start at boot:

Code:
 rc-update add autofs default




3) We here assume that /mnt will be the directory where all mounts resides, for example /mnt/cdrom, /mnt/floppy and so on (according to "man hier") :)

so edit /etc/autofs/auto.master like here:

Code:

gemini root # cat /etc/autofs/auto.master
# $Id: auto.master,v 1.1 2000/08/08 17:53:33 achim Exp $
# Sample auto.master file
# Format of this file:
# mountpoint map options
# For details of the format look at autofs(8).
/mnt    /etc/autofs/auto.cdrom
#/home  /etc/autofs/auto.home


We choosed auto.cdrom as configuration file for our cdrom. so, now, let's edit /etc/autofs/auto.cdrom like here:


Code:
gemini root # cat /etc/autofs/auto.cdrom
# $Id: auto.misc,v 1.2 2002/10/27 05:21:15 bcowan 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
#boot           -fstype=ext2            :/dev/hda1
cdrom           -fstype=auto,ro         :/dev/cdroms/cdrom0
#floppy         -fstype=auto            :/dev/fd0


ok. Now let's edit /etc/conf.d/autofs to set the timeout for automatic unmount of the cdrom:

Code:
gemini root # cat /etc/conf.d/autofs
# Config file for /etc/init.d/autofs

#
# e.g. localoptions='rsize=8192,wsize=8192'
#
localoptions=''

#
# additional options for automount, ie. timeout
#
daemonoptions='--timeout 1'



As you can see, we set timeout = 1 second; so i can access the cdrom, do whatever i want, and after 1 second i can simply eject it :)

This is not slow due to caching.

Now, you have to COMPILE YOUR KERNEL enabling "AUTOMOUNT"
support V4 in the Filesystem section.
Install the new kernel and
reboot.

After the reboot, you can simply access the /mnt/cdrom directory and you will have your cdrom contents automagically mounted without doing NOTHING. :)

NOTE:

i really hate this way of having 2 files for configuring such a simple thing like autofs.
it will be BETTER to have 1 SINGLE config file, something like

Code:

# Proposal for a new autofs single config file
#
# autofs mountpoint  device mountpoint  device       options
  /mnt               /cdrom             /dev/cdrom   -fstype=auto,ro         


Why 2 separate files ? why this stupid complexity ?
i hope we will develop a patch for autofs to use only 1 config
file instead of 2, here at freaknet medialab.

:)


http://www.freaknet.org
http://poetry.freaknet.org
_________________
AMEN
Back to top
View user's profile Send private message
TheCarNinja
Tux's lil' helper
Tux's lil' helper


Joined: 16 Sep 2003
Posts: 124
Location: New York

PostPosted: Sat Mar 19, 2005 7:31 am    Post subject: Reply with quote

Very nice. Very handy. Good post.
_________________
TheCarNinja
--
~Adopt an unanswered post today!~
Life is more fun sideways.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum