omarchy-config/smb-setup.md
2026-07-17 20:02:49 +02:00

3.6 KiB

SVR52 Samba Client Setup (Omarchy / Arch Linux)

Purpose

This document describes the complete client-side configuration for automatically connecting to the Samba share hosted on svr52 (a Raspberry Pi server) from another Linux machine running Omarchy/Arch.

The server is accessed primarily over Tailscale, meaning the machine may not be on the same LAN.

The goal is:

  • Automatically access the Samba share after boot.
  • Do not fail boot if the server is unavailable.
  • Wait until the share is actually accessed before attempting to connect.
  • Work reliably with Tailscale's startup delay.

Server Information

Hostname:

svr52

Samba user:

ta52

Primary share:

smb

Mount point on client:

/home/milan/svr52

Required packages

Arch:

sudo pacman -S cifs-utils smbclient

Verify connectivity

List available shares:

smbclient -L //svr52 -U ta52

Expected shares:

smb
ta52
print$
IPC$

Credentials file

Create:

mkdir -p ~/.smb
nano ~/.smb/svr52

Contents:

username=ta52
password=costarica

Protect it:

chmod 600 ~/.smb/svr52

Create mountpoint

mkdir -p ~/svr52

/etc/fstab

Append:

//svr52/smb /home/milan/svr52 cifs credentials=/home/milan/.smb/svr52,uid=1000,gid=1000,_netdev,nofail,x-systemd.automount,x-systemd.idle-timeout=10min 0 0

Explanation

  • credentials=... Uses the credentials file.

  • uid=1000,gid=1000 Files appear owned by the normal user.

  • _netdev Marks this as a network filesystem.

  • nofail Boot continues even if the server is unreachable.

  • x-systemd.automount Do not mount during boot. Mount only when the directory is first accessed.

  • x-systemd.idle-timeout=10min Automatically unmount after 10 minutes of inactivity.


Reload systemd

sudo systemctl daemon-reload

Test

Unmount if currently mounted:

sudo umount ~/svr52

Start automount:

sudo systemctl start home-milan-svr52.automount

Status should show:

Active: active (waiting)

Verify automount

Before accessing:

findmnt ~/svr52

Expected:

autofs

Access the folder:

ls ~/svr52

Then verify:

findmnt ~/svr52

Expected:

autofs
└── cifs //svr52/smb

This confirms the automount triggered successfully.


Why automount is required

A normal fstab mount fails because:

  1. systemd processes /etc/fstab
  2. Tailscale has not yet connected
  3. svr52 cannot be reached
  4. Samba mount fails

Automount fixes this because:

  1. Boot finishes normally.
  2. Tailscale connects.
  3. User later opens:
~/svr52
  1. systemd performs the mount only then.

This completely avoids boot-time race conditions.


Useful commands

List shares:

smbclient -L //svr52 -U ta52

Manual mount:

sudo mount -a

Unmount:

sudo umount ~/svr52

Status:

systemctl status home-milan-svr52.automount

Verify mount:

findmnt ~/svr52

Reload systemd after editing fstab:

sudo systemctl daemon-reload

Current Working Configuration

  • Client OS: Omarchy (Arch Linux)
  • Transport: Tailscale
  • Hostname: svr52
  • Share: smb
  • Credentials file: ~/.smb/svr52
  • Mount point: /home/milan/svr52
  • Mount type: CIFS
  • Mount strategy: systemd automount
  • Idle timeout: 10 minutes

This configuration has been tested and confirmed working. The Samba share mounts automatically on first access after Tailscale is connected, eliminating boot-time failures caused by network startup timing.