<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/a-quick-primer-on-autofs-8xmha9vnx" -->

---
title: A Quick Primer on Autofs | daily.dev
description: A concise setup guide for mounting Samba/CIFS network shares using autofs on Raspberry Pi OS (Debian/Ubuntu-based systems). Covers installing autofs,...
canonical: https://daily.dev/posts/a-quick-primer-on-autofs-8xmha9vnx
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: A Quick Primer on Autofs | daily.dev
og:description: A concise setup guide for mounting Samba/CIFS network shares using autofs on Raspberry Pi OS (Debian/Ubuntu-based systems). Covers installing autofs,...
og:url: https://daily.dev/posts/a-quick-primer-on-autofs-8xmha9vnx
og:image: https://api.daily.dev/og/posts/8XMHA9VnX.png
og:image:alt: A Quick Primer on Autofs
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# A Quick Primer on Autofs

**[apalrd's adventures](https://daily.dev/sources/apalrd)** · 3 min read · 0 upvotes · 0 comments

## Summary

A concise setup guide for mounting Samba/CIFS network shares using autofs on Raspberry Pi OS (Debian/Ubuntu-based systems). Covers installing autofs, configuring the master autofs file, creating a samba shares config file with mount options (fstype, credentials, permissions), and restarting the service. Explains why autofs is preferred over fstab for CIFS shares and includes a troubleshooting tip about the cifs kernel module.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.apalrd.net/posts/2021/autofs>

## Questions this post answers

### How do I configure autofs to mount a Samba CIFS share on Debian or Ubuntu?

Install autofs with apt, then add a line like `/- /etc/auto.smb.shares --timeout 15 browse` to `/etc/auto.master`. Create `/etc/auto.smb.shares` with an entry such as `/mnt/data -fstype=cifs,rw,username=<user>,password=<pass>,noperm,dir_mode=0777,file_mode=0777 ://server/share`. Create the mount point directory, then restart autofs with `sudo systemctl restart autofs`. Access the share to trigger the automount.

_Linux self-hosters configuring NAS mounts track setups like this on daily.dev._

### Why use autofs instead of fstab for CIFS network shares on Linux?

fstab is unreliable for CIFS shares because it mounts at boot time when the network may not be ready, causing failures. Autofs mounts shares on demand when they are accessed and unmounts them after a configurable timeout, making it more robust for network filesystems that may not always be reachable.

_Developers managing home lab storage find practical comparisons like this on daily.dev._

## Similar posts on daily.dev

- [How to Set Up an NFS Mount on Ubuntu \(Step-by-Step Guide\)](https://daily.dev/posts/how-to-set-up-an-nfs-mount-on-ubuntu-step-by-step-guide--djsnnlsya) · DigitalOcean Community · 0 upvotes · 0 comments
- [My NAS got simpler when I stopped overthinking whether to use SMB or NFS](https://daily.dev/posts/my-nas-got-simpler-when-i-stopped-overthinking-whether-to-use-smb-or-nfs-zaxlluxd2) · XDA Developers · 0 upvotes · 0 comments
- [Accessing Files Using Java With Samba JCIFS](https://daily.dev/posts/accessing-files-using-java-with-samba-jcifs-3ufy4ulbd) · Baeldung · 0 upvotes · 0 comments
- [Samba 4.25 Released With Experimental SMB3 Persistent Handles](https://daily.dev/posts/samba-4-25-released-with-experimental-smb3-persistent-handles-wdtknv3fd) · Phoronix · 0 upvotes · 0 comments

---

Tags: [#linux](https://daily.dev/tags/linux)

[View this post on daily.dev](https://daily.dev/posts/a-quick-primer-on-autofs-8xmha9vnx)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"A Quick Primer on Autofs","url":"https://daily.dev/posts/a-quick-primer-on-autofs-8xmha9vnx","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/a-quick-primer-on-autofs-8xmha9vnx"},"datePublished":"2026-08-11T08:54:03.449Z","dateModified":"2026-08-11T09:21:09.290Z","description":"A concise setup guide for mounting Samba/CIFS network shares using autofs on Raspberry Pi OS (Debian/Ubuntu-based systems). Covers installing autofs,...","image":"https://media.daily.dev/image/upload/s--foaA6JGU--/f_auto/v1722860399/public/Placeholder%2004","thumbnailUrl":"https://media.daily.dev/image/upload/s--foaA6JGU--/f_auto/v1722860399/public/Placeholder%2004","isAccessibleForFree":true,"articleSection":"apalrd's adventures","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"apalrd's adventures","logo":"https://media.daily.dev/image/upload/s--4zkx8dRj--/f_auto,q_auto/v1786438309/logos/apalrd?_a=BAMAMicg0","url":"https://daily.dev/sources/apalrd"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/a-quick-primer-on-autofs-8xmha9vnx","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"linux","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"apalrd's adventures","item":"https://daily.dev/sources/apalrd"},{"@type":"ListItem","position":3,"name":"A Quick Primer on Autofs"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/a-quick-primer-on-autofs-8xmha9vnx#faq","mainEntity":[{"@type":"Question","name":"How do I configure autofs to mount a Samba CIFS share on Debian or Ubuntu?","acceptedAnswer":{"@type":"Answer","text":"Install autofs with apt, then add a line like `/- /etc/auto.smb.shares --timeout 15 browse` to `/etc/auto.master`. Create `/etc/auto.smb.shares` with an entry such as `/mnt/data -fstype=cifs,rw,username=<user>,password=<pass>,noperm,dir_mode=0777,file_mode=0777 ://server/share`. Create the mount point directory, then restart autofs with `sudo systemctl restart autofs`. Access the share to trigger the automount. Linux self-hosters configuring NAS mounts track setups like this on daily.dev."}},{"@type":"Question","name":"Why use autofs instead of fstab for CIFS network shares on Linux?","acceptedAnswer":{"@type":"Answer","text":"fstab is unreliable for CIFS shares because it mounts at boot time when the network may not be ready, causing failures. Autofs mounts shares on demand when they are accessed and unmounts them after a configurable timeout, making it more robust for network filesystems that may not always be reachable. Developers managing home lab storage find practical comparisons like this on daily.dev."}}]}
```

