0% found this document useful (0 votes)
58 views

Cisco Systems IOS Operating System

This document provides instructions for setting up automatic mounting of removable media using the autofs service on Linux. It explains that autofs is preferable to supermount for mounting removable drives. It describes creating /etc/auto.vol and /etc/auto.master configuration files to automount volumes like CDs and floppies under /vol/ with a short 3 second timeout to allow easy insertion and removal of media. The steps provided configure autofs to automount local removable volumes while avoiding issues with network shares and supermount.

Uploaded by

Suresh Paladi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Cisco Systems IOS Operating System

This document provides instructions for setting up automatic mounting of removable media using the autofs service on Linux. It explains that autofs is preferable to supermount for mounting removable drives. It describes creating /etc/auto.vol and /etc/auto.master configuration files to automount volumes like CDs and floppies under /vol/ with a short 3 second timeout to allow easy insertion and removal of media. The steps provided configure autofs to automount local removable volumes while avoiding issues with network shares and supermount.

Uploaded by

Suresh Paladi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 7

cisco Systems IOS Operating System

The "IOS" operating system runs on a variety of cisco platforms, including most routers and the
2900 an 3500 families of Fast Ethernet and Gigabit Ethernet switches. In addition, other cisco
products, such as the cisco 500 family of web cache engines implement a command line interface
that is similar to IOS.

IOS has several features that make administration easier. The configuration file is stored as a
sequence of commands. This same sequence of commands can also be displayed on the screen or
written to a file over the network. There is a consistent command line interface for managing this
configuration:

• write terminal (writes configuration to screen)


• write memory (writes configuration to non-volatile memory, e.g. flash)
• write network (writes configuration to tftp server on network)

A large number of things can be displayed with the "show" command. Use "show ?" to get a list.
The command "show run" shows the "running-configuration". The output is the same as that of
"write terminal".

Commands can be abbreviated to the shortest unique string. For example, "write terminal" can be
abreviated as "wr term".

http://www.frigate.com/cisco.html

HowTo Setup Linux AutoFS


First of all, let me tell you that I am a fan of the Well, if that would be so easy, there would no
supermount feature that had been floating need to make up a howto about this feature,
around a long time but Linus was stupid you know - the autofs feature is not actually
enough to overlook the potential for benefit to meant for drives with removable media (so is
home pc and work pc users. He seems to be the technical term) but it was meant to
more interested in bringing linux all that SMP automount harddisk on another PC, somewhat
stuff for extreme-used webservers and other like a windows network share in SMB speak,
LAN server stuff. Yes, we all can benefit from similar to what the samba service can do for
this as it makes the OS better in lots of ways, you. This automount scheme means that you
but at the same time some of the changes do just need to try to access a /net-path (as
simply break the supermount feature over and specified in /etc/auto.net) and the harddisk
over again. The supermount feature does partition will be mounted to your local disk
currently work fine with all devices that can tree for just as long as you need it. When there
signal their state to the kernel, most is no activity on the net-volume then the
prominently the modern ATAPI cdrom device automounter will automatically unmount the
which can tell to the software when the tray network-share again, and usually this is done
opens, so that the kernel can always be sure after a couple of minutes - just compare this
that the same disk is in there. But for stupid with your favourite screensave that blanks your
devices like a floppy disk the supermount logic monitor after a few minutes (or even "lock"s
will be broken in every third linux minor the desktop) and so does the automounter
version you get - just don't count on it. daemon - it will "sync" all changed-data back
to the net-volume and unmount it, just to be
Maybe I have to note that even RMS (Richard safe since the other PC could possibly get shut
M. Stallman) has asked on the linux-kernel down somehow.
mailinglist whether linux could be made to
support a logic just like windows/msdos had However, we can use the automount feature for
with their drive letters, at least somewhat us and some removable media type drives on
similar, and everybody pointed to supermount the local computer - the trick is that we do not
as the name of the feature. However, the use an umount-timeout of 600 seconds (the
supermount logic is not the only answer to the internal default of the autofs daemon) and we
actual problem - all we really want is to insert do not use 60 seconds either (which is the
a cdrom or floppy disk into its drive and then usual default that most init.d/autofs scripts
just access it, read it, write it, and take it out will use or which you will find as "--timeout
again with no mysterious "mount" and 60" in the /etc/auto.master file) but we use
"unmount" commands inbetween - or see the a much shorter value - something that a
cdrom drive locked when forgetting about it. common user will not recognize as a timespan
or anything the user could get nervous about
The other answer to the problem is generally when waiting. Just choose a timespan between
called "automounter" and some kind of 3 seconds and 6 seconds and it will work. If
automount facilities and automount daemons you are going to install the autofs feature for a
have a long tradition in unix history - with the user who does not know about mount/umount
bsd automounter having the fame to have been in the first place, then it is a good idea to use 3
popular for quite a time. The linux kernel does seconds.
now ship the necessary stuff to setup an
automount daemon, and these features work That way, you can write some data to the
reliably. Furthermore, all linux distributions floppy disk, and about three seconds later the
will ship along the autofs daemon and init.d computer will actually write the data as the
startup script to start the automounter - and magic "unmount" will have to sync the data
preinstall an /etc/auto.master and back that was just cached before in the PC
/etc/auto.net configuration file. AFAICS, core. Likewise there is no problem when you
Mandrake is the only distribution to ship a just read some data of the cdrom and then
default kernel with supermount, whereas autofs quickly try to open the tray with the button on
is available in all distributions. the forefront. It might happen that you see the
disk locked in - but the next hit on the button
will finally open it and give the CD back to
you. Well, unless of course some shell of yours
is currently still chewing on the directory of
the disk itself. Sometimes you have to look
through your "file commanders" and see to get
out of the cdrom's directory so that the
automounter can do the actual "unmount".
The Installation

On RPM based systems like Mandrake, Red Hat or SuSE installation - if it has not been installed
by default - is pretty simple: just install the autofs rpm using any of the package managers. These
distributions all ship autofs RPMs with their CDs, no need to go hunting for it on the net. For
Mandrake the quickest way to install autofs would be "urpmi autofs" from a command line. And
make sure to disable supermount as it might clash with autofs: backup your fstab with "cp
/etc/fstab /etc/fstab.supermount" and then issue a "supermount -i disable" which will remove the
supermount tags from the current fstab.

To actually set up the data, I do recommend that you do not add the removable-media entries to
the /etc/auto.net file - that would be misleading the user. Restrict /etc/auto.net to hold
disks shared on other computers or atleast disk partitions being network centric and shared with
other computers on your network. Instead, create a new file called /etc/auto.vol since the term
"vol" is the traditional unix-centric name of what we are about to do - "vol" is short for "volume"
and you might want remind yourself of an analogy of a cd-changer with a dozen disk in the box
but just one drive to actually read one cd at a time. Likewise, the access path should start at "/vol"
on your local system and the "volumes" under that top-directory should be numbered - usually
with a name-prefix telling the type of cd-changer or the computer holding the volumes. A
traditional name would say "cd-1" or "pc3-hdd".

In this example, I will use the dos-like names of our removable media called "/vol/a" and "/vol/d"
for the floppy and cdrom drive - this is in a way a numbering-scheme starting at "a", passing "d"
and "e" and going up to "z". Many linux distributions will start to setup a scheme like
"/mnt/floppy" but I guess you are fine with "/vol/a" too, and at the same time this is a traditional
unix way. Nice eh! :-)

okay, here is your new /etc/auto.master

# Sample auto.master file


# Format of this file:
# mountpoint map options
# For details of the format look at autofs(8).
## /misc /etc/auto.misc --timeout=60
## /net /etc/auto.net --timeout=60
/vol /etc/auto.vol --timeout=3

Note that I did remove the "sample" /misc and /net mountpoints since my home pc does not have
a use for them. To let the timeout be passed right there in the /etc/auto.master happens to be a
relativly new feature with linux, many older distributions will require to set a install-variable (e.g.
suse 6.x) and in some cases you even have to modify the init.d/autofs file.

Then (mkdir /vol ; chmod 775 /vol) to create the mountpoint on your disk - most linux
distribution do not have this old/common directory, they just have "/mnt" which is used for some
other taks too (e.g. the installation CDs might get mounted there) and so we do not want to abuse
it. Next we create the /etc/auto.vol file.
# 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
a -fstype=auto,rw,sync,umask=002 :/dev/fd0
d -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom

which assumes you already have a symlink /dev/cdrom pointing to your cdrom drive (which
might be actually /dev/hdb).

And basically, this is it, now you need to restart the autofs daemon using (/etc/init.d/autofs
stop ; /etc/init.d/autofs start) and you can start accessing "/vol/a" and "/vol/d". Well,
you could of course make a some new icons on your KDE desktop - just rightlick on the
background and click on "new URL", then enter an URL as "file:/vol/a" and choose an icon
represting a floppy. The next time that you click on that icon, a file-manager will pop up with
"/vol/a" in its view - which is the floppy disk of course.

Doing More With It

This scheme with an icon is however needed Well, you may have guessed now why we
for another reason - to guess why, just let your called it "/vol/a". If you go and install
file-commander point to "/vol". So, what do "cygwin" or some other unix-emulation under
you see. What? Nothing? Well, that's good - as windows, then this unix-layer will map the
long as there is no mounted volume then there local "A:" to "Z:" drives as direct unix-tree
should not be an entry. This is very, very paths calling them "/A" to "/Z". We simply
important: about once a day, some cron script adopted this naming scheme for a true unix
will run over your harddisk and look for trash system to access the floppy that our windows
files, and cleaning up other stuff like would call "A:". I expect most users to be able
compressing manual pages and such stuff. to remember this mapping as "/A". Right? :-)
Nothing important, but this script will often
run the whole file tree and when it comes to a But we can go even beyond that (which I
directory like "/vol" it will scan all the actually do on my system) and map the
subdirectories of it - being possibly removable msdos/windows drives too. Well, this assumes
media which are not there (which would not be that your linux installation has detected the
that much of a problem - the subdirectory win98 partitions on your harddisk and has put
would be empty). But when they are there then them into your /etc/fstab. In many cases,
it will happily scan your cdrom disk. And that these disk partitions are mounted permanently
is not what you want, right? to the effect that the cron-find scripts will
search these drives too while running once a
At the same time, this is also a problem for all day. Well, this is unnecessary, so let's remove
those point-n-click programs being around. the corresponding lines from /etc/fstab and
Just try to open an image in "gimp" being on add them instead to /etc/auto.vol ..
the floppy disk. The gimp's "file open" dialog including setting up symlinks for easy access.
box will open up and let you choose the file in
the file tree, but the "/vol/a" directory does not Even more, I use some of my harddisk as a
yet exist and there is now way to just say backup storage and as a backside storage so I
"/vol/a" to get a list of files. You would have to can put the mandrake rpms (or the complete
remember the path and filename on the floppy cooker rpms) on that extra partition. And since
- which is not quite convenient. But again, it is accessed through an autofs point, it will
there is a way around it: create symlinks. The not be searched by the cron-find daemon nor
cron-find daemon above will not walk across will I be able to wrongly delete some stuff
symlinks since he knows that a symlink will there by mistake - it is another partition
end at a real file or directory that he will come anyway. To get yet another benefit, just
across at another time too - and it would not be remember those startup times when the screen
good to scan a directory twice. says "mounted too many times, check forced"
and runs "fsck" on your "fstab"-partitions. The
On the other hand, a symlink is just some text, "auto.vol" partitions however are not listed in
so it does not mount the disk unless of course "fstab", so that "fsck" would have to be run
someone is trying to read the symlink in the manually .. once a year. Since it is just some
process of trying to open the thing being at the backup storage, this is not a problem anyway -
other end of the symlink. In that moment, the I do not run programs on those partitions.
disk gets locked&mounted in the cd drive
making the "/vol/a" path to magically appear in After all my, /etc/auto.vol looks like this
that very moment. Just try yourself - insert a last table:
floppy, and do (ln -s /vol/a /A) create a
symlink for "/vol/a" as the name "/A". Now
wait three seconds, so that the floppy gets
unmounted. Run (ls /vol) - and see nothing,
just an empty directory. Then run (ls /A ; ls
/vol) and see the "/vol/a" directory to be there
since you accessed it through "/A" in less than
three seconds before. This will also work in
"open-file" dialog boxes - just use "/A" instead
of "/vol/a".

# 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

## kernel -ro,soft,intr ftp.kernel.org:/pub/linux


a -fstype=auto,rw,sync,umask=002 :/dev/fd0
c -fstype=auto,rw,sync,umask=002 :/dev/hda1
d -fstype=auto,rw,sync,umask=002 :/dev/hda5
e -fstype=auto,rw,sync,umask=002 :/dev/hda6
m -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
n -fstype=iso9660,ro,nosuid,nodev :/dev/scd0

# the following entries are samples to pique your imagination


#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

02 -fstype=auto :/dev/hda2
07 -fstype=auto :/dev/hda7
12 -fstype=auto :/dev/hda12
13 -fstype=auto :/dev/hda13
1 -fstype=auto :/dev/hdd1
3 -fstype=auto :/dev/hdd3
5 -fstype=auto :/dev/hdd5
6 -fstype=auto :/dev/hdd6
7 -fstype=auto :/dev/hdd7
8 -fstype=auto :/dev/hdd8

last modified 09/2002 (prior version)

http://freespace.sourceforge.net/guidod/howto/autofs.html

Introduction
2.1. What is NFS?

The Network File System (NFS) was developed to allow machines to mount a disk partition on a
remote machine as if it were on a local hard drive. This allows for fast, seamless sharing of files
across a network.

It also gives the potential for unwanted people to access your hard drive over the network (and
thereby possibly read your email and delete all your files as well as break into your system) if
you set it up incorrectly. So please read the Security section of this document carefully if you
intend to implement an NFS setup.

There are other systems that provide similar functionality to NFS. Samba
(http://www.samba.org) provides file services to Windows clients. The Andrew File System
from IBM (http://www.transarc.com/Product/EFS/AFS/index.html), recently open-sourced,
provides a file sharing mechanism with some additional security and performance features. The
Coda File System (http://www.coda.cs.cmu.edu/) is still in development as of this writing but is
designed to work well with disconnected clients. Many of the features of the Andrew and Coda
file systems are slated for inclusion in the next version of NFS (Version 4)
(http://www.nfsv4.org). The advantage of NFS today is that it is mature, standard, well
understood, and supported robustly across a variety of platforms

2.2. What is this HOWTO and what is it not?

This HOWTO is intended as a complete, step-by-step guide to setting up NFS correctly and
effectively. Setting up NFS involves two steps, namely configuring the server and then
configuring the client. Each of these steps is dealt with in order. The document then offers some
tips for people with particular needs and hardware setups, as well as security and troubleshooting
advice.

This HOWTO is not a description of the guts and underlying structure of NFS. For that you may
wish to read Linux NFS and Automounter Administration by Erez Zadok (Sybex, 2001). The
classic NFS book, updated and still quite useful, is Managing NFS and NIS by Hal Stern,
published by O'Reilly & Associates, Inc. A much more advanced technical description of NFS is
available in NFS Illustrated by Brent Callaghan.

This document is also not intended as a complete reference manual, and does not contain an
exhaustive list of the features of Linux NFS. For that, you can look at the man pages for nfs(5),
exports(5), mount(8), fstab(5), nfsd(8), lockd(8), statd(8), rquotad(8), and mountd(8).

It will also not cover PC-NFS, which is considered obsolete (users are encouraged to use Samba
to share files with Windows machines) or NFS Version 4, which is still in development.

http://www.linux.org/docs/ldp/howto/NFS-HOWTO/intro.html

You might also like