Ubuntu With autofs and Infinite Recursive Directories

Trying to get autofs working on Ubuntu, I found that everything worked except that I could never actually get at the folder contents. Instead, I would get an infinitely recursive set of empty folders:

jeff@ubuntu:~$ ls /smb/myserver/
backup/ info/ media/ pictures/ share/
jeff@ubuntu:~$ ls /smb/myserver/media
backup/ info/ media/ pictures/ share/
jeff@ubuntu:~$ ls /smb/myserver/media/media/media/media/media
backup/ info/ media/ pictures/ share/
jeff@ubuntu:~$

In the end, I inadvertently solved the problem by installing samba.

sudo apt-get install smbfs

Otherwise, installation worked just like the Internets said. The most important bit is to configure your /etc/auto* files correctly. Here’s a rundown of mine:

My /etc/auto.master:

#misc /etc/auto.misc --timeout=60
/smb /etc/auto.smb
#/misc /etc/auto.misc
/net /etc/auto.net

Additionally, /etc/auto.smb.yoursevername must contain your username and password, and only be read-write accessible by root:

username=yourusername
password=yourpassword

Resources:
This page was helpful. As an aside, this page shows how to substitute cifs for smbfs.

About Jeff Fitzsimons

Jeff Fitzsimons is a software engineer in the California Bay Area. Technical specialties include C++, Win32, and multithreading. Personal interests include rock climbing, cycling, motorcycles, and photography.
This entry was posted in Technology. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *