Time Machine Samba Backup

I'm hoping someone can give me some pointers. M1 Macbook Pro - Sequoia 15.3.1


I've a NAS on which I've been running afp and have a sparse bundle time machine backup there. I want to convert to smb.


I have successfully managed to backup using the following steps.


Use Finder-Go To Server and open the backup share by entering the NAS as smb://nas.file.share.ip and selecting the correct file share. This mounts as:

//user@nas.file.share.ip/name_of_folder on /Volumes/name_of_folder


In that folder there is a macbook_pro_name.sparsebundle which I mount by right clicking and opening with DiskImageMounter.App


This mounts as:

/dev/disk5s1 on /Volumes/Backups of macbook_pro_name (apfs, local, nodev, nosuid, journaled, mounted by user)


I can then use:

sudo tmutil setdestination /Volumes/Backups\ of\ macbook_pro_name

sudo tmutil inheritbackup /Volumes/Backups\ of\ macbook_pro_name

tmutil detsinationinfo to verify and grab the ID

sudo tmutil setquota ID #Gigabytes


Once done I can then manually start a TM backup.


I want to execute these steps at login of my user, but adding the mounted volumes to login items causes the sparse bundle mount to fail as the SMB mount hasn't completed. I would also like to suppress the finder windows that open when I am doing this.


I have tried a zsh script similar to this:


#!/bin/zsh
mount_smbfs -o nobrowse //user:password@nas.file.share.ip/name_of_folder /Users/user/Not_Backed_UP_Folder/TM 
sleep 30
hdiutil attach /Users/users/Not_Backed_UP_Folder/TM/macbook_pro_name.sparsebundle

 


This also creates the following mount:

/dev/disk5s1 on /Volumes/Backups of macbook_pro_name (apfs, local, nodev, nosuid, journaled, mounted by steve)


However now a manual TimeMachine backup fails.


Can someone suggest how I can automate the mounting of both the smb share and the sparsebundle at startup that mirrors the manual steps above, ideally without opening the finder windows that the manual steps do.

MacBook Pro 16″

Posted on Feb 13, 2025 9:13 AM

Reply
3 replies

Feb 13, 2025 7:03 PM in response to SteveMilner

Do you know if your NAS supports the Time Machine over SMB specification. Older NAS devices do not.


Time Machine should automatically mount the SMB share once you set up the backup.

Did you ever try to set up the new share through the TM interface? You should be able to remove the backup location and add it back. You don't have to mount the Sparse Bundle Disk Image. Just add the mounted share to Time Machine. It should ask if you want to use the existing backup.


I don't use a NAS, but I do use a network backup. I have set it up a few times and sometimes that works, but other times I have to delete the Sparse Bundle and let it begin again. If you need that historical backup, copy the Sparse Bundle Disk Image somewhere else.

Feb 14, 2025 4:02 AM in response to Barney-15E

I don't think my NAS supports the SMB extension to support TM, which is probably why it's not visible through the TM UI


sudo tmutil setdestination -p smb:/user@nas.file.share.ip/name_of_folder


Also fails, probably for the same reason.


I'll do some research on the NAS and SMB shares, or failing that I'll look to see what I can find as an alternative solution

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Time Machine Samba Backup

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.