LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-03-2005, 08:36 PM   #1
ic_torres
Member
 
Registered: Nov 2005
Location: ABAP
Distribution: slackware 12.0, Vector Linux STD 6.0 and 5.8, ZenWalk 4.6.1, OpenBSD 3.9
Posts: 389

Rep: Reputation: 34
automounting cdrom and floppy


guys just want to ask..who among of you are using automount in cdrom and floppy?

cn i ask for some help? i heard that "autofs" should be used. . ryt? where should i place this? to etc/fstab? cn i see some of your sample?

thanks in advance. .
 
Old 11-03-2005, 10:04 PM   #2
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
autofs must be supported by your kernel, I don't know if it works as module, never used it, but I guess it will.
Here are threads that may guide you: http://www.linuxquestions.org/questi...hreadid=342218
http://www.linuxquestions.org/questi...hreadid=343578

I found those searching for rc.autofs which you will need to download to use autofs, this is the search: http://www.linuxquestions.org/questi...der=descending
 
Old 11-06-2005, 07:56 PM   #3
ic_torres
Member
 
Registered: Nov 2005
Location: ABAP
Distribution: slackware 12.0, Vector Linux STD 6.0 and 5.8, ZenWalk 4.6.1, OpenBSD 3.9
Posts: 389

Original Poster
Rep: Reputation: 34
hello group. . here is the copy of the script i got from google for automount. . .i just want you have a comment if this will work.. but it seems that i really dont have a directory name "auto.master" in /etc as mentioned in the article.

autofs.script :
**********************************************
cd
echo "Please ignore any errors when making directories"
### Let us make sure the two directories exist, ignore errors
mkdir /mnt/floppy
mkdir /mnt/cdrom
### Let us backup the auto files in case they haven't
mv /etc/auto.master /etc/auto.master_old
mv /etc/auto.floppy /etc/auto.floppy_old
mv /etc/auto.cdrom /etc/auto.cdrom_old

### Create the files for autofs
echo "/mnt/cdrom /etc/auto.cdrom --timeout 10" > /etc/auto.master
echo "/mnt/floppy /etc/auto.floppy --timeout 3" >> /etc/auto.master
echo "floppy -user,suid,fstype=msdos :/dev/fd0" > /etc/auto.floppy
echo "cdrom -fstype=iso9660,ro :/dev/cdrom" > /etc/auto.cdrom

### Create the links to floppy drive and cdrom drive

ln -s /mnt/floppy/floppy a:
ln -s /mnt/cdrom/cdrom d:
ln -s /mnt/floppy/floppy floppy
ln -s /mnt/cdrom/cdrom cdrom

# Let us restart autofs, you might have to reboot
cd /etc/rc.d/init.d
./autofs restart

### if it did not work, reboot
### try "./autofs start" if the restart claims autofs has not been started
cd


*************************************

will this script will work even i dnt have the auto.master in /etc? ? ? i need you help guys.. thanks in advance. .
 
Old 11-07-2005, 02:36 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,170
Blog Entries: 1

Rep: Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038
You can take a look at /usr/doc/autofs-3.1.7/samples/ for rc.autofs.in, auto.master, auto.misc.
You have to modify a little rc.autofs.in and put it in /etc/rc.d/, or you can use the following startup script I found elsewhere:
Code:
#!/bin/sh
#
# Date   : Feb 04, 2004
# Author : Terminator, <jimmy@mtc.dhs.org>
#
# rc.autofs - Starts the filesystem automounter
# Based on rc.autofs by David Cantrell, <david@slackware.com>

#
# This function will build a list of automount commands to execute in
# order to activate all the mount points. It is used to figure out
# the difference of automount points in case of a reload
#
function getmounts()
{
   # Check for local maps to be loaded
   if [ -f /etc/auto.master ]
   then
      cat /etc/auto.master | sed -e '/^#/d' -e '/^$/d'| (
         while read dir map options
         do
            if [ ! -z "$dir" -a ! -z "$map" \
                 -a x`echo "$map" | cut -c1` != 'x-' ]
            then
               map=`echo "/etc/$map" | sed -e 's:^/etc//:/:'`
               options=`echo "$options" | sed -e 's/\(^\|[ \t]\)-/\1/g'`

               if [ ! -d $dir ]
               then
                  mkdir -p $dir
               fi

               if [ -x $map ]
               then
                  echo "/usr/sbin/automount -p /var/run/automount.pid -t 3 $dir program $map 
$options $localoptions"
               elif [ -f $map ]
               then
                  echo "/usr/sbin/automount -p /var/run/automount.pid -t 3 $dir file $map 
$options $localoptions"
               else
                  echo "/usr/sbin/automount -p /var/run/automount.pid -t 3 $dir `basename 
$map` $options $localoptions"
               fi
            fi
         done )
   fi

   # Check for NIS maps to be loaded
   if [ -e /usr/bin/ypcat ] && 
      [ `ypcat -k auto.master 2>/dev/null | wc -l` -gt 0 ]
   then
      ypcat -k auto.master | (
         while read dir map options
         do
            if [ ! -z "$dir" -a ! -z "$map" \
                 -a x`echo "$map" | cut -c1` != 'x-' ]
            then
               map=`echo "$map" | sed -e 's/^auto_/auto./'`

               if echo $options | grep -- '-t' >/dev/null 2>&1
               then
                  mountoptions="--timeout $(echo $options | \
                     sed 's/^.*-t\(imeout\)*[ \t]*\([0-9][0-9]*\).*$/\2/g')"
               fi

               options=`echo "$options" | sed -e '
                  s/--*t\(imeout\)*[ \t]*[0-9][0-9]*//g
                  s/\(^\|[ \t]\)-/\1/g'`

               if [ ! -d $dir ]
               then
                  mkdir -p $dir
               fi

               echo "/usr/sbin/automount -p /var/run/automount.pid -t 3 $dir yp $map $options 
$localoptions"
            fi
         done )
   fi
}


autofs_start() {
  if [ -x /usr/sbin/automount ]; then
    echo -n "Starting autofs daemons...  "
    (grep -q autofs /proc/filesystems || modprobe -q autofs || modprobe -q autofs4) 2> /dev/null
    getmounts | sh
  fi
}

autofs_stop() {
  echo -n "Stopping autofs daemons...  "
  umount -a -f -t autofs 2> /dev/null
  killall -15 automount 2> /dev/null
  modprobe -q -r isofs 2> /dev/null
  (modprobe -q -r autofs4 || modprobe -q -r autofs) 2> /dev/null
}

autofs_restart() {
  autofs_stop
  sleep 1
  autofs_start
}

case "$1" in
'start')
  autofs_start
  ;;
'stop')
  autofs_stop
  ;;
'restart')
  autofs_restart
  ;;
*)
  echo "usage $0 start|stop|restart"
esac
 
  


Reply



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
where is floppy and cdrom Mantorok Slackware 6 10-21-2005 10:58 PM
Help - installing without cdrom or floppy nonidentity Linux - Laptop and Netbook 3 10-17-2004 04:51 PM
Floppy and CDRom subaruwrx Slackware 1 06-15-2004 05:43 AM
ATAPI floppy/dvdrom/cdrw automounting, slackware 9.1 Ben2210 Slackware 13 03-02-2004 12:55 AM
CDROM and Floppy Smooth Linux - Newbie 1 07-19-2003 07:03 AM

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

All times are GMT -5. The time now is 02:00 PM.

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