|« HOWTO:Set up NFS sharing||HOWTO Sort out kvm »|
NFS is great when you have one dedicated server and it's up all the time. If like me you have a few PCs with Linux and you want to share the mounted file systems. The order you boot your machines up can be important and you could even get deadlocks where two machines are waiting for each other. NFS can also appear to hang the booting process if a remote server is not available. If this happens then you have to manually mount the NFS systems, I find that a pain.
With autofs, the file systems are mounted as required or on demand, and then automatically unmounted when they have not been used for some time. This means you can have two machines both of which mount file systems from the other and the order you boot them does not matter as long as the remote system is not required during the boot. For example your HOME area in on a remote NFS file system. To mount the remote system just access it. Change directory to it, list the contents of it or execute a script or program from it.
Also for removable devices you don't have the bother of mounting and unmounting them. They just work. Insert a cdrom, access it, when you are done wait for the timeout and eject it.
We can now place a cd/dvd into one of the devices and it will be mounted when we use ls or cd /mnt/cd we will see a further subdirectory 0 or 1 depending on the device we used.