Timemachine Macos Setup
To set up a Debian-based NAS that works well with macOS clients. I’ll break it down into steps:
1. Base Setup on Debian
- Install Debian (stable recommended).
-
Update the system:
sudo apt update && sudo apt upgrade -y
-
Install useful tools:
sudo apt install vim htop curl wget net-tools avahi-daemon -y
2. Storage Preparation
-
Identify your disks:
lsblk
-
Partition & format (e.g., Btrfs or ext4):
sudo mkfs.btrfs /dev/sdX
-
Mount permanently by editing
/etc/fstab
.
3. File Sharing Options for macOS
macOS supports SMB and AFP. AFP is deprecated, so SMB (via Samba) is the best option.
Install Samba
sudo apt install samba -y
Configure
Edit /etc/samba/smb.conf
and add a share:
[macshare]
path = /srv/nas/macshare
browseable = yes
read only = no
guest ok = no
create mask = 0664
directory mask = 0775
Create directory & set permissions:
sudo mkdir -p /srv/nas/macshare
sudo chown -R $USER:$USER /srv/nas/macshare
Add Samba user:
sudo smbpasswd -a yourusername
Restart Samba:
sudo systemctl restart smbd
4. Bonjour (Avahi) for Easy macOS Discovery
Install Avahi:
sudo apt install avahi-daemon avahi-discover -y
This allows your NAS to appear automatically in Finder under “Network”.
5. (Optional) Time Machine Support
macOS can back up to SMB shares if flagged as a Time Machine volume.
Add this inside your Samba config:
[TimeMachine]
path = /srv/nas/timemachine
valid users = yourusername
read only = no
vfs objects = fruit streams_xattr
fruit:time machine = yes
fruit:metadata = stream
Then:
sudo mkdir -p /srv/nas/timemachine
sudo chown -R yourusername:yourusername /srv/nas/timemachine
sudo systemctl restart smbd
6. Access from macOS
- In Finder:
⌘ + K
→smb://<your-nas-ip>/macshare
- Or find it under Network if Avahi works.