One of the great things about UNIX and Linux is that they were built from the start to be multitasking and multiuser operating systems.
As networking became faster, new additions were done that was also multitasking and multiuser, such as the network file system, or NFS.
The automounter is an important part of managing a UNIX network with a few users and machines to several hundreds or thousands of them.
Linux implements the automounter as autofs. It is not limited to network file systems, and can do other local devices as well, such as CD-ROMs, floppies, USB devices, and much more.
When combined with KDE's session saving feature, this becomes a very convenient setup, where any user can login anywhere, and get the same session as he last left it, with the same applications opening up as they were.
This article focuses on how to use the automounter in Linux for remote file systems.
If you have a home network of several machines used by several people, a few issues may crop up after some time using it. For example:
- Users will have data on their local machines. This complicates things such as backups, which are easier if they are centralized.
- Users may want to access their data from other machines, such as a test machine in the lab, or if their own machine is down.
The answer to the above is to use the automounter to make the users' home directories available on any machine they log in to.
The assumption here is that you have a server that has NFS running, and that the /etc/exports file has the home directories setup to be shared.
Then you have to setup every client machine per the following steps:
To acheive this, you need to install and configure the the autofs package. If you are using an RPM based distribution, then check RPMFind for your distribution and architecture.
On Mandrake, you can use the following command:
On Debian, you can use apt-get.
After you finish the installation, you have to configure autofs.
First, as root, you have to edit the file: /etc/auto.master to include the following line:
/home /etc/auto.home --timeout=60
Then, create a new file called /etc/auto.home, and add the following line in it:
* -fstype=nfs,rw,nosuid,soft server:/home/&
You have replace server in the above file by the hostname of your NFS server.
The secret to this working as well as it does, is the * and /home/& parts. This tells the automounter to mount user directories on demand. This setup makes things simple, and eliminates the need to list every user's home directory in the configuration file.
Then, issue the following command as :
Now, any access to home directories from any client machine will cause this directory to be mounted.
Combined with KDE's session saving, this becomes a very convenient feature, since users get their exact session on any machine they login to.
My daughters use this feature to login from another machine if their own one has a problem.
Neat, isn't it?