|
|
Configuring automountSummary:
'automount' is an alternative mechanism to mount local and networked media automatically. In this contributed article, Mandrake Linux user Kevin ~McCormick describes a setup. PreparationsThis is based on my reading of the man pages for autofs and also the Automount mini-HOWTO, plus a few trial and error cycles. Your mileage may vary. I use Linux-Mandrake, and the "Supermount" method they have for accessing removable drives wasn't working for me. Anyone who has better ideas should feel free to add improvements.
Creating Mount PointsCreate mount directories as 'root' with mkdir /mnt/dir_name (as 'root'). Directories such as '/mnt/cdrom', '/mnt/floppy', and '/mnt/zip' may have already been created, and you may just want to use these. (More on 'mounting' ) A separate directory for each removable drive should be created because you will probably want to use different timeout (auto unmount) options for each removable drive. However, if the timeout option is the same, you can simply use a mount point for more than one removable drive. Configuring autofs Files In /etcNext edit the '/etc/auto.master' file # For details of the format look at autofs(8).
~# mount point config file ––options
~# my layout:
~# NFS link to server is under /net
~# removable drives are under /mnt/cd, mnt/fd, and mnt/zd
/net /etc/auto.net ––timeout=30 #(this is a network nfs share)
/mnt/floppy /etc/auto.floppy ––timeout=1
/mnt/cdrom /etc/auto.cdrom ––timeout=3
/mnt/zd /etc/auto.zip ––timeout=3
Next create an '/etc/auto.drivereference' file for each removable drive reference in '/etc/auto.master'.
# $Id: auto.misc,v 1.2 1997/10/06 21:52:04 hpa 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) man page ~#==== /etc/auto.zip (has 3 second timeout) zipd -fstype=vfat,users,rw,suid :/dev/hdd zipl -fstype=ext2,users,rw,suid :/dev/hdd1 Note there are two zip drive directories, one for dos (vfat) formatted zip drives and one for linux (ext2) formatted drives. Since they mount to different partitions on the zip drive, it appears separate entries are necessary. See the mini HOWTO on zip drives . - #==== /etc/auto.cdrom (has 3 second timeout) cdrom -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
#==== /etc/auto.floppy (has 1 second timeout) floppy -users,suid,rw,exec,fstype=auto, :/dev/fd0
#==== /etc/auto.net nfs1 -fstype=nfs,rsize=4096,wsize=4096,hard,intr server_name:/share_name Desktop Icons For Easy AccessNext edit the desktop icons (if you use these) on your desktop which reference the removable drives. These icons are perhaps labeled "CD-ROM", "Floppy", and "Zip". For KDE, just right-click the desktop icon and select "Properties" from the pop-up menu. This displays a small dialog and you should click on the "URL" tab to show the URL (uniform resource locater). Edit the URL to be the same as the '/etc/auto.master' mount point plus the 'auto.removabledrive' directory name. Following the examples, the URL for the cdrom drive would be: "/mnt/cdrom/cdrom", for the floppy drive: "/mnt/floppy/floppy", and for the zip drive: "/mnt/zd/zipl" or "/mnt/zd/zipd". Now when you click on these icons, the Konqueror file manager will open and display the contents of the removable drive. If there is no disk in the drive when you click on the icon, you will get an harmless error message. When you are done with the removable drive, close the Konqueror file manager so that there are no active programs with a reference to the directory. After the timeout has elapsed, the removable drive will be automatically unmounted and the removable disk can be taken out without having to worry about files that are not synced or other such annoying problems. In order to access a removable drive directly from the Konqueror file manager, you will need to type the path (e.g. '/mnt/cdrom/cdrom') in the Location bar at the top. If you are using Konsole, xterm, or another terminal emulator, you also just type the path (e.g. $ cd /mnt/cdrom/cdrom). 'autofs' will automatically mount the removable drive when the path is given and when there are no programs referring to the drive, it will automatically unmount after the timeout period has elapsed. Mandrake Linux user James Coliz prefers a slightly different approach: Once I got it up and running, I found it extraordinarily cumbersome to have my floppy on '/auto/floppy/floppy', and my CD on '/auto/cdrom/cdrom'. I'd like to recommend that people consolodate into a single map file. Here's my '/etc/auto.master': /auto /etc/auto.drives ––timeout=2 And my /etc/auto.drives: zip -fstype=vfat,user,rw,suid,uid=root,gid=local,umask=7007 :/dev/zip<br> cdrom -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom<br> floppy -fstype=vfat,user,rw,suid,uid=root,gid=local,umask=7007 :/dev/fd0 Sure they all have the same timeout. But the access is so much simpler... Related Resources:man autofs Revision / Modified: Jan. 09, 2002 / Feb. 11, 2002 Legal: This page is covered by the GNU Free Documentation License . Standard disclaimers of warranty apply. Copyright LSTB and Mandrakesoft. |