Better later than never, here is a hack to achieve this :
sudo ifconfig lo0 alias 127.0.0.2/32
Plug your usb drive, then via System Preferences / Sharing add a smb share to a folder time-machine-macbook in the drive time-machine-usb
Then, add a destination backup (Time Machine will see it as a network share)
sudo tmutil setdestination -a "smb://user:[email protected]/time-machine-macbook"
You can see if it's ok with:
tmutil destinationinfo
> ==================================================
Name : time-machine4
Kind : Network
URL : smb://kenji@realserver._smb._tcp.local./time-machine
ID : D820D053-C74A-4A06-A7E1-E60C8EA7934F
====================================================
Name : time-machine-macbook
Kind : Network
URL : smb://[email protected]/time-machine-macbook
Mount Point : /Volumes/time-machine-macbook
ID : F707BD0B-64DF-4DB6-A3B7-824470FB5EB2
Then start a backup with tmutil startbackup and mount will show:
/dev/disk3s1 on /Volumes/time-machine-usb (apfs, local, nodev, nosuid, journaled, noowners)
//[email protected]/time-machine-macbook on /Volumes/time-machine-macbook (smbfs, nobrowse)
You can see detailed progress with tmutil status:
Backup session status:
{
BackupPhase = Copying;
ClientID = "com.apple.backupd";
DateOfStateChange = "2018-06-28 17:38:21 +0000";
DestinationID = "F707BD0B-57DC-4DB6-A3B7-824470FB5EB2";
DestinationMountPoint = "/Volumes/Time Machine Backups";
FirstBackup = 1;
Percent = "0.08711567546702646";
Progress = {
TimeRemaining = 32679;
"_raw_totalBytes" = 355694600192;
bytes = 34429528173;
files = 887351;
totalBytes = 391264060211;
totalFiles = 2922384;
};
Running = 1;
Stopping = 0;
"_raw_Percent" = "0.09679519496336274";
}
In my case, near 1000000 files were done in about two hours (USB2 disk penalty, versus more than 8 hours via Wi-Fi), I calculate percentages with a small script:
tm-progress.sh
Files : 918702 / 2922384 (31.43%) - Bytes : 32.21 GiB / 364.39 GiB (8.84%)
We can here that many files can make Time Machine to progress "slowly" in Bytes, but nearly 1/3 of files have been copied.
Next step, when backup is finished, plug the usb drive to your realserver and copy the sparsebundle over the "uncompleted one" (or in the shared folder). Of course, Time Machine should be disabled during this step to prevent mounting a partially copied sparsebundle (and maybe corrupting it)
I have used an apfs drive to benefit of snapshots (to be able to revert to a previous "backupdb" in case of sparsebundle corruption, not tested yet)
Edit: even faster mode :
Once the backup has reached BackupPhase = Copying to make it faster you can make the backupbundle mount directly (without sending every operation through smb) by canceling the backup, renaming My-Computer.backupbundle to something like 1My-Computer.backupbundle, and creating a symbolic link :
ln -s /Volumes/time-machine-usb/1My-Computer.backupbundle /Volumes/time-machine-macbook/My-Computer.backupbundle
This tricks timemachine into following the link to the backupbundle localy, and not mount it through smb, which speeds up the backup. Make sure you move the backupbundle back when you have finished your local backup.
Answer from ıɾuǝʞ on Stack Exchange
Hi all, does anyone currently use Time Machine but instead of an external drive use a network share and if so, how have you set it up?
Time Machine Backups to external drive over network
macos - Can I use Time Machine to back up data to a Windows shared drive? - Ask Different
Time Machine back up
Is possible to have a Time Machine disk over the home network?
Videos
Better later than never, here is a hack to achieve this :
sudo ifconfig lo0 alias 127.0.0.2/32
Plug your usb drive, then via System Preferences / Sharing add a smb share to a folder time-machine-macbook in the drive time-machine-usb
Then, add a destination backup (Time Machine will see it as a network share)
sudo tmutil setdestination -a "smb://user:[email protected]/time-machine-macbook"
You can see if it's ok with:
tmutil destinationinfo
> ==================================================
Name : time-machine4
Kind : Network
URL : smb://kenji@realserver._smb._tcp.local./time-machine
ID : D820D053-C74A-4A06-A7E1-E60C8EA7934F
====================================================
Name : time-machine-macbook
Kind : Network
URL : smb://[email protected]/time-machine-macbook
Mount Point : /Volumes/time-machine-macbook
ID : F707BD0B-64DF-4DB6-A3B7-824470FB5EB2
Then start a backup with tmutil startbackup and mount will show:
/dev/disk3s1 on /Volumes/time-machine-usb (apfs, local, nodev, nosuid, journaled, noowners)
//[email protected]/time-machine-macbook on /Volumes/time-machine-macbook (smbfs, nobrowse)
You can see detailed progress with tmutil status:
Backup session status:
{
BackupPhase = Copying;
ClientID = "com.apple.backupd";
DateOfStateChange = "2018-06-28 17:38:21 +0000";
DestinationID = "F707BD0B-57DC-4DB6-A3B7-824470FB5EB2";
DestinationMountPoint = "/Volumes/Time Machine Backups";
FirstBackup = 1;
Percent = "0.08711567546702646";
Progress = {
TimeRemaining = 32679;
"_raw_totalBytes" = 355694600192;
bytes = 34429528173;
files = 887351;
totalBytes = 391264060211;
totalFiles = 2922384;
};
Running = 1;
Stopping = 0;
"_raw_Percent" = "0.09679519496336274";
}
In my case, near 1000000 files were done in about two hours (USB2 disk penalty, versus more than 8 hours via Wi-Fi), I calculate percentages with a small script:
tm-progress.sh
Files : 918702 / 2922384 (31.43%) - Bytes : 32.21 GiB / 364.39 GiB (8.84%)
We can here that many files can make Time Machine to progress "slowly" in Bytes, but nearly 1/3 of files have been copied.
Next step, when backup is finished, plug the usb drive to your realserver and copy the sparsebundle over the "uncompleted one" (or in the shared folder). Of course, Time Machine should be disabled during this step to prevent mounting a partially copied sparsebundle (and maybe corrupting it)
I have used an apfs drive to benefit of snapshots (to be able to revert to a previous "backupdb" in case of sparsebundle corruption, not tested yet)
Edit: even faster mode :
Once the backup has reached BackupPhase = Copying to make it faster you can make the backupbundle mount directly (without sending every operation through smb) by canceling the backup, renaming My-Computer.backupbundle to something like 1My-Computer.backupbundle, and creating a symbolic link :
ln -s /Volumes/time-machine-usb/1My-Computer.backupbundle /Volumes/time-machine-macbook/My-Computer.backupbundle
This tricks timemachine into following the link to the backupbundle localy, and not mount it through smb, which speeds up the backup. Make sure you move the backupbundle back when you have finished your local backup.
See my other answer first which is a lot simpler!!
This is Kenji's answer ("ıɾuǝʞ" above), reworked painfully and explained by a complete noob (myself) for other complete noobs. I also added an important workaround in the last step:
Better later than never, here is a hack to achieve this:
Open Terminal.app and enter the following command:
sudo ifconfig lo0 alias 127.0.0.2/32Plug in your usb drive
- Go to
System Preferences/Sharing Open the lock in the bottom-left corner
(Whenever asked for your password, go ahead and enter it)
Tick "File Sharing" on the left pane.
- Tick
Optionsbutton and activate both SMB and AFP - Click the
+sign in the middle pane (titled "Shared Folders") and locate your USB drive. Create a folder (e.g. "time-machine-macbook") and select it to create the shared folder. Then, add a destination backup (Time Machine will see it as a network share), using the following command in Terminal.app:
sudo tmutil setdestination -a "smb://user:[email protected]/time-machine-macbook"(If you get an error that Terminal needs more access rights to your disk, then go ahead and follow the instructions of the error message to give such rights and repeat this step.)
You can check if it's ok with the following Terminal command:
tmutil destinationinfoAnd you will get the following reply on your Terminal window:
================================================== Name : time-machine4 Kind : Network URL : smb://kenji@realserver._smb._tcp.local./time-machine ID : D820D053-C74A-4A06-A7E1-E60C8EA7934F ==================================================== Name : time-machine-macbook Kind : Network URL : smb://[email protected]/time-machine-macbook Mount Point : /Volumes/time-machine-macbook ID : F707BD0B-64DF-4DB6-A3B7-824470FB5EB2Then start a backup with Terminal command:
tmutil startbackupTerminal command
mountwill show (among others) something like:/dev/disk3s1 on /Volumes/time-machine-usb (apfs, local, nodev, nosuid, journaled, noowners) //[email protected]/time-machine-macbook on /Volumes/time-machine-macbook (smbfs, nobrowse)`You can see detailed progress with Terminal command:
tmutil statusWhere you'll get something like:
Backup session status: { BackupPhase = Copying; ClientID = "com.apple.backupd"; DateOfStateChange = "2018-06-28 17:38:21 +0000"; DestinationID = "F707BD0B-57DC-4DB6-A3B7-824470FB5EB2"; DestinationMountPoint = "/Volumes/Time Machine Backups"; FirstBackup = 1; Percent = "0.08711567546702646"; Progress = { TimeRemaining = 32679; "_raw_totalBytes" = 355694600192; bytes = 34429528173; files = 887351; totalBytes = 391264060211; totalFiles = 2922384; }; Running = 1; Stopping = 0; "_raw_Percent" = "0.09679519496336274"; }Of course you can also have a rough idea of the progress by opening Time Machine where you will get the total MB copied as well as a calculation of the time remaining.
In Kenji's case, near 1000000 files were done in about two hours (USB2 disk), versus more than 8 hours necessary via Wi-Fi. My results were quite faster with a USB3 disk. In 2h I had backed-up more than 500MB.
Next step, when backup is finished, plug the usb drive to your realserver and copy the sparsebundle over the "uncompleted one" (or in the shared folder). Of course, Time Machine should be disabled during this step to prevent mounting a partially copied sparsebundle (and maybe corrupting it). I have used an apfs drive to benefit of snapshots (to be able to revert to a previous "backupdb" in case of sparsebundle corruption, not tested yet)
If #12 above doesn't work and Time Machine cannot backup TO the really-networked drive (but may possibly be able to read it), then the workaround is to copy the backup bundle inside a new sparsebundle! Awkwardly, Time Machine can use networked sparsebundles as backup destinations (but not it's own backupbundle!).
Have your drive connected via USB (for speed) and use Disk Utility to create inside it a sparsebundle with the necessary size to fit all your backup. This might take a few hours depending on the size and speed, so choose to do it overnight. If you don't have enough drive space, then unfortunately you should remove your previously created backup and re-create it later on from the beginning inside the new sparsebundle.
To create the new spasebundle, open Disk Utility, click File/New Image/Blank Image and in the pop-up window add a filename (e.g. BackupBundle.dmg), no tags, choose to be inside your USB drive root, choose a volume name (e.g. BackupBundle), size larger than your HD size, format definitely Mac OS Extended (Journaled), no encryption, Single partition - Apple Partition Map, and finally sparse bundle disk image. Check again your selected size (sometimes it gets back to default) and hit save.
Hours later, when it's over, you may test your new sparsebundle over the network. Connect your drive to your router, open Finder, and double click your BackupBundle.sparsebundle. You should see a new disk on the sidebar and on your desktop called BackupBundle. Then open Terminal and see if the sparsebundle can be added as a backup destination. If not, then you can set it manually via Terminal.app:
sudo tmutil setdestination -a "/Volumes/BackupBundle"After all this, you can copy Time Machine's backupbundle inside your BackupBundle.sparsebundle. This will also take hours, so you may want to do it the next night. Alternatively, if you didn't have room in steps 14-15 and you had to delete it, you can set Time Machine to use it as backup destination when connected via USB and then again after the first full backup is completed to select the same destination via network.
Good luck!
I do Time Machine backups for two MacBook's across the network using SMB and Windows Home Server and have had no problems. It is tricky to configure however once running it really works well. I have had no major issues except forgetting to set my exclusion list correctly, and Time Machine runs happily over wireless and wired LAN.
After the initial configuration it has really been set and forget. There is a ServerFault question here with links and details on how to set it up. It mentions WHS specifically but will work for any Windows Server Setup or even Windows XP/Vista/7 client machines using SMB shares. Just remember to enable the guest account for sharing.
Just a thought:
I did not read the linked article, but: enabling backups is one thing, while restoring might need some more tweaks? I kind of doubt the installation disc will offer you to restore a full system when it's on an SMB share.
In order to create a Time Machine backup to an unsupported drive (pretty much anything that's not formatted HFS+) you need to run the following Terminal command:
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
Your share will now show up as a valid Time Machine destination in the Time Machine Preference Pane.
Time Machine will then create a disk image on that drive that will act just like a HFS+ drive for Time Machines purposes (hard linking, etc.). One advantage of using a disk image over using the entire drive is that you can limit the size it will grow to of the disk image using Disk Utility.
Be sure to check Louis Gerbarg's answer as well for why it's unsupported and you have to jump through a hoop to enable it.
There are various hacks to setup a diskimage on the share, which I am sure other people will describe in depth. Having said that DO NOT USE SMB TO STORE TIME MACHINE BACKUPS.
Guaranteeing writes on a disk image backed over a network store is complicated. Apple had reliability issues with Time Machine over AFP for years, and they controlled the entire stack. In order to guarantee write ordering and write stability (which are necessary in order for Time Machine to work in the presence of intermittent networking, such as walking out or range of the base station or putting the machine to sleep midbackup and waking it up out of range) Time Machine depends on features specific to AFP (For those interested, those are published as part of the Time Machine Network Server Requirements).
If you want to backup to a Windows Machine you should probably get a copy of ExtremeZ-IP, if it is a linux box running SAMBA you should install netatalk.