Autofs montare cdrom howto asbesto

Da Poetry Hacklab.

Poetry Hacklab MINI HOWTO

AUTOFS e MOUNT AUTOMATICO dei CDROM - HOWTO 
autofs and automatic cdrom mounting - howto

ENGLISH TEXT AT BOTTOM

keywords: autofs, cdrom, mount, umount, automatic, third
          millennium, george bush, animal terror

----------------------------------------------------------
E' INCIVILE, INCIVILE ed ASSURDO che nel 2004, a 30 e passa anni
dalla nascita di UNIX, con sistemi operativi evolutissimi super
3D e cose spaziali tipo max os-x, noi poveracci si sia costretti
a farci venire la SINDROME DEL TUNNEL CARPALE scrivendo come
disgraziati cose del tipo

mount /cdrom

umount /cdrom


cosi' MI SONO ROTTO I COGLIONI e siccome non c'e' un solo howto
decente su come installare una cosa che MONTI IN AUTOMATICO il
CDROM, ecco qua l'howto. 

Questo e' per gentoo, cosi' se avete altro andate a cagare.

1) emerge autofs. 

2) rc-update add autofs default

3) joe /etc/autofs/auto.master
   e metteteci

   /mnt    /etc/autofs/auto.cdrom

nota: /mnt sara' la dir. dove autofs creera' il filesystem di
tipo "autofs", dove andra' a fare i mountpoint per cdrom e quant'altro.
nota: io uso /cdrom per montare il cdrom. le dir /mnt/cdrom, /mnt/floppy
eccetera sono una STRONZATA COLOSSALE. pero' PORCODIO va fatto per
forza cosi' perche' /mnt dev'essere l'inizio dei mount point 
specificati negli altri file, come in auto.cdrom... vedi (@)

poi,

4) cp /etc/autofs/auto.misc /etc/autofs/auto.cdrom
5) joe /etc/autofs/auto.cdrom

   e metteteci

   cdrom           -fstype=iso9660,ro      :/dev/cdrom

(@) ecco qui il mount pount. con /mnt sopra, in auto.master, e 
cdrom qui, ho definito /mnt/cdrom. ma PORCO CLISTO, non bastava
un SOLO file di configurazione? PERCHE' 2, PERCHE ??!?!?!

ok ?
salvate.

   se volete il mount su /cdrom, come le persone CRISTIANE, allora
   fate semplicemente un link

6) ln -s /mnt/cdrom /cdrom

   e vi risolvete la maledizione del /mnt.

7) compilare il kernel con la fottuta opzione autofs del cristo, che
   OVVIAMENTE NON SI CHIAMA AUTOFS, ma "AUTOMOUNT", e sta nella
   sezione dei filesystem


8) reboot

fate riavviare, e poi ... 

9) ls /cdrom

e vuala', dovrebbe automaticamente montarvelo al volo. dopo
1 secondo, potete tirar fuori il cd. QUESTO E' IL FUTURO, AMICI


=====================================================================

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.


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


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

NOTE: you can find this HOWTO and some comments on 
http://forums.gentoo.org, searching for "autofs cdrom howto".

Strumenti personali