Samba NAS
The CM5 runs a Samba server exposing four shares: Windows network backups, Apple Time Machine, read-only access to Frigate snapshots, and a Gentoo binary package host. Avahi provides mDNS registration so macOS clients discover the Time Machine share automatically without manual configuration.Package requirements
The following packages are installed by the image script:smb.conf
The complete Samba configuration is written to/etc/samba/smb.conf by the image script:
/etc/samba/smb.conf
Share reference
[global]
[global]
Sets the server role to standalone (no Active Directory domain), registers the server via mDNS with
multicast dns register = yes, and limits log files to 50 KB per client. Replace WORKGROUP with your Windows workgroup name if needed.[windows-backups]
[windows-backups]
A read/write share for Windows File History and manual backups. Access is restricted to members of the
nas-users group. Files are created with 0664 permissions and directories with 0775 to allow group members to read each other’s files.[timemachine]
[timemachine]
Apple Time Machine share using the
fruit VFS module stack: catia handles macOS special characters in filenames, fruit provides the AFP-compatibility layer and Time Machine advertisement, and streams_xattr stores extended attributes as filesystem xattrs rather than separate files. fruit:aapl = yes enables Apple extensions protocol negotiation.[frigate-snapshots]
[frigate-snapshots]
Read-only share exposing
/media/frigate/snapshots. Members of nas-users can browse and download detection snapshots from any SMB client without SSH access to the CM5.[gentoo-binhost]
[gentoo-binhost]
Public read-only share for Gentoo binary packages. The same directory is also served over HTTP by nginx — see the Gentoo binhost section below.
User and group setup
All share access (exceptgentoo-binhost) requires membership in the nas-users group:
Apple Time Machine over SMB
macOS discovers Time Machine destinations advertised over mDNS. Thefruit VFS module handles the advertisement when combined with Avahi.
Avahi service advertisement
Create an Avahi service file to advertise the Time Machine share:/etc/avahi/services/timemachine.service
_adisk._tcp service record is what macOS looks for when populating the Time Machine destination list. adVN=timemachine must match the Samba share name exactly.
Enabling services
nmb.service provides NetBIOS name resolution for older Windows clients. It is not required for macOS Time Machine but is harmless to enable.Configuring Time Machine on macOS
Add backup disk
Click Add Backup Disk. The CM5 should appear as
CM5-NAS in the list under Network Locations.Authenticate
Enter the credentials for a user in the
nas-users group (the Samba password, not the system password).Gentoo binhost (nginx)
Thegentoo-binhost share is also served over HTTP by nginx, which Portage uses to fetch binary packages directly via URL:
/etc/nginx/sites-available/gentoo-binhost
make.conf to use the CM5 as a binary host:
/etc/portage/make.conf
Syncing packages to the binhost
Usersync to push built packages from a Gentoo build machine to the CM5:
Storage layout
| Path | Share | Purpose |
|---|---|---|
/srv/nas/windows-backups | windows-backups | Windows File History and manual backups |
/srv/nas/timemachine | timemachine | macOS Time Machine backups |
/media/frigate/snapshots | frigate-snapshots | Frigate detection snapshots (read-only) |
/srv/gentoo-binhost | gentoo-binhost | Gentoo binary packages (SMB + HTTP) |
Consider mounting
/srv/nas on a dedicated Btrfs subvolume on the NVMe or SATA drive for performance and snapshot isolation. The @frigate subvolume already has nodatacow set — apply the same flag to any subvolume that holds large, frequently written files.