Use Amd to automount NFS shares
Takeaway: If you need a program to automount remote filesystems, Vincent Danen has a recommendation for you: the BSD Amd suite. Read this tip to get started.
Using networked filesystems is very commonplace, be it NFS or Samba. For most people with Linux networks, NFS is the more popular. Those with mixed environments tend towards using Samba to share files with the Windows crowd, and may even use NFS at the same time to share files with Linux and other UNIX users.
Typically, NFS mounts are handled statically, but this isn't always optimal, so there are two programs for Linux that allow for on-demand or "auto" mounting of remote filesystems: AutoFS and the BSD Amd suite.
Nearly all Linux distributions provide BSD Amd, so it should be a simple urpmi or apt-get away. To get started, simply install the amd or am-utils package.
The first step is to configure amd by editing /etc/amd.conf. This file contains a variety of options with sensible defaults. The [global] section deals with options for the amd daemon itself. The rest are definable mount-points. Most distributions have [/net] pre-defined, which points to the configuration file /etc/amd.net. This file defines network-based remote filesystems, or remote NFS exports.
The /etc/amd.net file is fairly generic and provides some default options. Use it to tweak NFS mount options like the read and write sizes.
Once you've started amd, you can begin to use it without any further configuration. If you have a system on the local network that provides NFS exports, you can immediately access it. Let's say, for example, the server is nfs.foo.org and the exported directory you are interested in is /files; you would use:
$ cd /net/nfs.foo.org/files
Amd will automount /files on nfs.foo.org the moment you change to the directory. If you want to use something more memorable, feel free to symlink the directory elsewhere:
$ cd ~/
$ ln -s /net/nfs.foo.org/files .
Now when you cd ~/files/, the remote NFS export will automatically mount, and you can access the files immediately. Depending on the export options, you may have read-only access or you may be able to read and write to the files on the share.
Amd is extremely easy to use with minimal configuration required. In most cases, it works perfectly out of the box.
Delivered each Tuesday, TechRepublic's free Linux NetNote provides tips, articles, and other resources to help you hone your Linux skills. Automatically sign up today!
Print/View all Posts Comments on this article
|
|
|
|
|
|
|
|
|
|
SponsoredWhite Papers, Webcasts, and Downloads
- The Social Enterprise: Using Social Enterprise Applications to Enable the Next Wave of Knowledge Worker Productivity Oracle
- Email Retention and Archiving: Manage Electronic Records, Minimize Workplace Risks and Maximize Compliance MessageLabs
- Increase IT Efficiency through Virtual Datacenter Automation VMware
- Employee Web Use and Misuse: Companies, their employees and the Internet MessageLabs
- Oracle Web 2.0 Resource Library Oracle
Article Categories
- Security
- Security Solutions, IT Locksmith
- Networking and Communications
- E-mail Administration NetNote, Cisco Routers and Switches
- CIO and IT Management
- Project Management, CIO Issues, Strategies that Scale
- Desktops, Laptops & OS
- Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
- Data Management
- Oracle, SQL Server
- Servers
- Windows NT, Linux NetNote, Windows Server 2003
- Career Development
- Geek Trivia
- Software/Web Development
- Web Development Zone, Visual Basic, .NET





