1. Tech

Your suggestion is on its way!

An email with a link to:


was emailed to:

Thanks for sharing About.com with others!

Linux Newbie Administrator FAQ: Accessing Drives

Part 4 of the Linux Newbie Administrator Guide

4.2.8 Can I mount automatically?
(continued after ads...)

Related Resources
Linux Newbie Administrator Guide
0. Linux Benefit
1. Before Installation
2. Linux Resources/Help
3. Basic Operations FAQ
4. Newbie Admin FAQ
~ 4.1 Lilo
~ 4.2 Drives
~ 4.3 X-Windows
~ 4.4 Configurations
~ 4.5 Networking
5. Shortcuts / Commands
6. Linux Applications
7. Learn Linux Commands
A. How to Upgrade Kernel?

Yes, you can automatically mount a filesystem as you access it and unmount when you stop using it. It works similar to what you have experienced under MS Windows. Yet, if you used removable media extensively under DOS or Windows, you must have noticed that automounting is not entirely foolproof.

There are two utilities for automounting under Linux, and they are callled "supermount" and "automount".

Supermount. Mandrake 7.2 gives you the option of using "supermount" as a setup option. So the simplest way to "supermount" is to install latest Mandrake and select this option. My /etc/fstab on a computer running Mandrake may contain the following lines:

/dev/hda3 / ext2 defaults 1 1
none /dev/pts devpts mode=0620 0 0
/dev/hda4 /home ext2 defaults 1 2
/mnt/cdrom /mnt/cdrom supermount fs=iso9660,dev=/dev/cdrom 0 0
/mnt/floppy /mnt/floppy supermount fs=vfat,dev=/dev/fd0 0 0
/mnt/zip /mnt/zip supermount fs=vfat,dev=/dev/zip 0 0
none /proc proc defaults 0 0
/dev/hdb2 /usr ext2 defaults 1 2
/dev/hdb5 swap swap defaults 0 0

In the example above, you may notice that I selected to supermount 3 filesystems: cdrom, floppy and zipdrive. I can edit the file /etc/fstab manually (e.g. with pico) or use the supermount command to customize the supermount to my needs.

Automount. To set up "automount", I first run the programs ntsysv (as root) and make sure that automount service ("autofs") is enabled.

Then, I configure automount by editing the files /etc/auto.master and /etc/auto.misc, e.g. (as root):

pico /etc/auto.master

My /etc/auto.master looks like that:

/misc /etc/auto.misc --timeout 1

This says that my automount devices will be mounted in the directory /misc (which must exist and be empty). My automount drives will automatically unmount one second after I stop using them (for example, after I exit the directory). This is a short time--you may choose a longer one. The detailed config file is /etc/auto.misc . Here is mine:

kernel -ro,soft,intr ftp.kernel.org:/pub/linux
cdrom -fstype=auto,ro :/dev/cdrom
floppy -fstype=auto,rw :/dev/fd0
zipdrive -fstype=vfat,rw :/dev/sda4
dosdrive -fstype=vfat,ro :/dev/hda1
hacker_cdrom -fstype=nfs,ro hacker:/mnt/cdrom
hacker_floppy -fstype=nfs,rw hacker:/mnt/floppy
hacker_usr -fstype=nfs,ro hacker:/usr

Each line consists of 3 space delimited fields. The first field is the "key" which will be the name of the subdirectory (under /misc) to which the device will be mounted. This directory must NOT exist. It will not be visible when I use the command ls , but I can "cd" to it and my device will then mount. Don't ask me why it is so, and how to use this automount in GUI. I don't know. The hacker stuff in my auto.misc is the cdrom and floppy from another computer in my home network.

I automount to the directory /misc (not /mnt) so that I can also mount filesystems manually, without using automount, to the directory /mnt.

Next > 4.2.9 How do I get my parallel-port (external) Zip drive recognized?

Can't find what you are looking for?
Search the

Stay up-to-date!

©2016 About.com. All rights reserved.