Turn Your NAS Or Windows Share Into A Time Machine Backup

Justin Pot 25-02-2015

Use your NAS, or any network share, for backing up your Mac with Time Machine 4 Resources to Become a Backup Master with Time Machine [Mac] Read More . Apple’s backup software officially only works with supported devices, but with a little work you can trick it into backing up to any network drive!


In 2011, James showed you how to back up your Mac to a homemade time capsule How To Backup Your Mac With A Homemade Time Capsule After losing some fairly important accounting files recently, I realised that my backup strategy is quite flawed. Although I take a weekly bootable backup of my Mac, that doesn't really help when I deleted the... Read More . Any alternative to Apple’s $300 wireless backup unit is welcome, but this method doesn’t work any more.

Happily, there is a way around this for Macs running OS X Yosemite. To summarize, we’re going to do four things:

  1. Create a sparse image – a virtual drive that Time Machine will see as a valid backup disk.
  2. Copy the sparsebundle to your network drive, then mount it.
  3. Tell Time Machine to use the mounted sparsebundle for backups.
  4. Tell your Mac to mount the virtual drive at boot.

Do these four things and your Mac will be backing up to your NAS or Windows share in no time, all the time.

This tutorial assumes you’ve got a working NAS you can access on your Mac, or that you’ve set up Windows to share files with your Mac Easily Share Files Between Windows 7, 8 and Mac OS X Cross platform file sharing sounds complicated, but it doesn't have to be. Here's how to get a PC and and a Mac to share files with each other. Read More .

1. Create A Sparse Image

First things first: we’re going to make a sparse image, which is a resizable kind of virtual disk. There are a few reasons for this:

  • Time Machine will only write to HFS drives, and this virtual drive is one.
  • Unlike other virtual drives, a sparse image only grows when you add information to it – so it will only take up space on your networked drive as needed.
  • You can set a maximum size for your sparse image, effectively capping how much of your network drive’s space Time Machine will ever take up.

There are two main methods to make this image – the first involves the Terminal (commands); the second Disk Utility (GUI).

Open the Terminal, then switch to the Desktop folder:

cd Desktop

Now let’s create the sparse image. Here’s a command to start with:


hdiutil create -size 600g -type SPARSEBUNDLE -fs "HFS+J" TimeMachine.sparsebundle


This will create a 600 GB image named “TimeMachine” – change the size to suit your needs (roughly twice the size of your Mac’s storage space is recommended). Thanks to Stephen Morley for the command.

If you’d rather avoid the terminal, don’t worry: you can use the Disk Utility instead. Open it, then click the New Image button in the toolbar.



First set Image Format as “sparse button disk image”, then set the size you want (setting the size first will probably result in an error message). Give the disk a name (I use TimeMachine in this tutorial), then optionally enable encryption. Save the disk to your desktop.

2. Copy Sparsebundle To The Network, Then Mount It

Head to Finder, and open the network folder you’d like to use for your backup. Drag the sparse image you just created to this folder.



Once everything has copied you can then delete the remaining image on your desktop. Now, double-click the copy of the image on your network share – this will mount it. If everything worked, you should see the new TimeMachine drive in your Finder’s sidebar and on your desktop (depending on your settings).


3. Tell Time Machine To Backup To Your Mounted Drive

Now for the magic step: telling Time Machine to use your virtual drive for backups. Open the Terminal and enter this command:

sudo tmutil setdestination /Volumes/TimeMachine

If you named your image something besides “TimeMachine”, you’ll obviously need to use that name instead.

Let’s see if it worked! Head to System Preferences, then open the Time Machine settings. You should see your virtual drive as the default backup destination. Here’s how that looks for me, after a couple backups:


Congratulations! Go ahead and run your initial backup, if you want – it’s going to take a while. I recommend you plug your Mac directly into your router with an ethernet cable, instead of using WiFi, and use a program like Caffeine to keep your Mac awake Keep Your Mac Awake With A Dose Of Caffeine Read More until the initial backup is done.

4. Tell Your Mac To Mount Your Bundle At Boot

So long as your image is mounted, Time Machine will keep backing up. Restart your Mac, however, and you’ll need open the image again before your backups can start. If you’d rather not go through the effort, Sean Patterson has a quick AppleScript you can create to mount the drive for you.


Paste Sean’s script into Script Editor (find it in Applications), then change the names to refer to your network share and sparsebundle. Test the result and save it as an Application if it works.

In Users and Groups, you can add the application you just made to your Startup Items – it will run when you log in.

If you can’t get this working, and would prefer a GUI tool for the job, check out Control Plane, which lets you automate mounting your Time Machine driver whenever you’re at home Automate Mac Settings Depending On Your Location With ControlPlane You use your Mac differently at home than you do at work. What if it knew the difference between these contexts, and set itself up accordingly? Read More .

The One Hangup: Can’t Use OS X Recovery

The above process gives you a working Time Machine backup, with one caveat: you cannot use this backup to restore using OS X Recovery. That feature lets you roll back your entire Mac history to a given time, which is useful after a system crash or when you’re replacing a hard drive.

In the case of a total drive failure, you’ll need to reinstall OS X entirely How to Reinstall macOS for a Fast and Squeaky Clean Mac Need to restore your Mac to factory settings? Here's how to install a fresh copy of macOS and erase everything. Read More , then mount the Time Machine drive using the steps above. Once that’s done, you can restore your files using the Migration Assistant.


It’s an extra step, but it works.

Apple: Make This Easier!

While I was setting this up, my wife set up the backup feature built into Windows 8 Did You Know Windows 8 Has a Built-In Time Machine Backup? We sometimes forget with all the focus on Windows 8's new "Modern" interface, but Windows 8 has a variety of great desktop improvements. One of them is File History, a built-in backup feature that functions... Read More to save her files to the same drive. There were fewer steps, to say the least.

Things could be easier were I to spend $300 on a Time Capsule, which I suspect is what Apple would prefer I do, but I still wish Apple would provide more options for Time Machine drives because with a little work you can use just about anything.

Backups are important, but if you don’t have one then you might need some file recovery tools for your Mac if things do go wrong. Trust us – backup your files! You could also opt for online backup services to keep your data safe.

Did the method above work for you? Do you have any suggestion to make things simpler? Let’s talk, fill me in in the comments below.

How do you keep your files safe?

Related topics: Computer Networks, Data Backup, NAS, OS X Yosemite, Time Machine.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. DVS
    December 25, 2017 at 8:50 pm

    at step 2 I get an error: The operation can't be completed because you don't have permission to access some of the items. This of course is not true because I can copy other files to that network drive. After I "ok" the error, the copy seems to proceed fine.

    However, when I try to mount the sparcebundle, I get "image not recognized", and I am stuck. Which of course is totally maddening because it seems to work fine for everyone else.

  2. Bobbvr
    December 1, 2017 at 8:35 am

    If you create a sparsebundle with 128-bits encryption, it will also work with Mac OS X 10.13.1

  3. Stuart Rozier
    August 11, 2017 at 7:51 pm


    this worked like a treat for me, thank you

    im wanting to add another spare bundle from a gas drive connected to the router,

    when i added the backup disk to TM form option (no error their) the original sparebunde disappeared off the desktop,

    is it not possible to backup to 2 x spare bundles ?

    many thanks in advance


  4. Bob Dylan
    July 3, 2017 at 2:58 pm

    Your applescript is no accurate.
    Please make it relative to these instructions.

  5. J Peter
    June 22, 2017 at 10:54 pm

    You said that the Windows 8 backup process is simpler. There's a big difference-- It doesn't back up the whole drive, it only backs up your "documents" folders. The Windows installation, programs, and their associated data (eg web history) aren't backed up. Time Machine backs up everything and lets you access older versions of every file. It really is a total backup

    • Matt M.
      September 20, 2017 at 5:37 pm

      Windows 7 and later actually have not only an incremental backup solution like Time Machine but they have full system image recovery as well. It's called "Windows Image Backup" and you can find it in the control panel search for "file history" then look on the lower left corner for "Backup and Restore" then click on the top left link to "Create a system image." Windows 10 improves on this by offering to make a system image for you when you turn on back up if you select the "Let Windows choose (recommended) option." If you don't like giving that much control of what gets backed up, and need to make sure that a specific folder is backed up you can create a library for it, and then it will be included in the backup, since all libraries are backed up by default.

  6. Gary
    April 3, 2017 at 5:27 am

    Great write up. I followed the instructions. Double clicked the sparse bundle to mount it. Then opened Terminal. However when I enter in the command I get an error.
    sudo tmutil setdestination /Volumes/TimeMachine (after hitting enter I get the following error)
    /Volumes/TimeMachine: Incompatible file system type: smbfs (error 45)
    The backup destination could not be set.
    Any ideas?

    • Gary
      April 4, 2017 at 3:51 am

      Ok I just figured it out. I had entered a command in terminal to Show Unsupported Drives but that did do anything. Then I remembered when I had Snow Leopard there was one piece of info that was missing from every write up. Your sparsebundle needs to be the name of your computer (mine is MacbookPro) then an underscore followed by your ethernet (not your wireless) mac address. So for my 15" Macbook Pro running El Capitan this is what I entered into Terminal(without the quotes) "sudo tmutil setdestination /Volumes/MacbookPro_a82066556588"
      Notice that all colons or dashes have been removed from the mac address. This is critical. Immediately the sparsebundle was available in Time Machine and the backup is working to my Windows Home Server 2011. I should mention when typing the command into Terminal the name of your sparsebundle is case sensitive and must match exactly.
      In Terminal you can enter the command(without quotes) "scutil --get ComputerName" to get the name of your computer, and enter the command " ifconfig en0 | grep ether" to get the mac address. I hope this is helpful to someone.

      • Mark
        April 6, 2017 at 1:05 am


        Thank you! Your advice was extremely helpful and it worked like a charm. I had to use my wireless adapter MAC address since there's no ethernet port but it worked with no issues.

      • Jim
        August 11, 2017 at 2:15 pm

        This worked perfectly for the latest release of MacOS Sierra, where my old sparebundle file had quit working. Very helpful! Thanks!

      • Nick
        February 4, 2018 at 7:54 pm

        It didn't work for me on High Sierra. I did exactly what you said but it just doesn't show up on my time machine. Any suggestions what the problem might be?

  7. Don
    March 27, 2017 at 7:37 pm

    Unfortunately my NAS has plenty of free space but my Mac does not. It will only create a sparsebundle of a size less than the free space remaining on your MAC's internal drive. I wanted to create a 3TB drive for my time machine backups but it failed because my local drive only had 200G free. That limits the size of my sparse bundle to 200G.

    • Leon
      April 6, 2017 at 3:59 pm

      just create any size of sparse bundle image. then copy it over to the NAS. then in the DiskUtility app, Images->Resize, Open your NAS Location's Sparsebundle image file u just copied over to NAS, resize to whatever size you want.

      • Jay
        June 13, 2018 at 12:50 pm

        Man THANK YOU for this advice! I've been desperately looking around for some type of solution to my issues and you single-handedly fixed my problems. Your solution needs to be included in the actual tutorial.

  8. Umut
    March 15, 2017 at 5:25 am

    Hello all,
    Thank you for this great solution. But I have a problem maybe other users also have. I have created my network drive on my linux machine and it connected to my computer with samba. I have created 200 GB of sparesebunle file on my HFS+ partition(My partitions's size 200 GB). I have mounted the file and set it as Time Machine Backup disk in terminal as you did. But when it starts to bakcup up, it gives error "There is 1,75 GB left on your this. There is no enough space on your disk". There was nothing my sparese bundle file. Why is this happening ? Did you face such a problem before ?

  9. Fabian Platte
    March 13, 2017 at 11:43 pm

    I wrote a far more advanced AppleScript for such a setup. It admires that one could leave home and come back and starts the computer while the drive is not accessible. and it does provide an easily editable, guided script to setup for ones specific setup.

    I hope it turns out to be useful for someone:

    #/Copy and past it to the Applescript, adapt it to your needs and save it to an application (like "NAS Time Machine Backup"). Do not forget to make it a startup item.

    #/ Protocol (afp/smb) and name of the network drive || only edit content within the quotes - without a final backslash!
    set NAS_ServerDomain to "smb://{your NAS}"

    #/ Name of the mounted NAS drive (and path to a the folder of the spare bundle file) - e.g "/{NAS drive name}/{your name}/Backup" || only edit content within the quotes - without a final backslash!
    set NAS_DrivePath to "/{NAS drive name}/{your name}/Backup"

    #/ Name of the .sparsebundel file created for the backup || only edit content within the quotes
    set sparsebundleName to "Time Machine"

    #/ Name of the mounted sparsebundle image || only edit content within the quotes - default "untitled"
    set BackupDriveName to "Time Machine"

    #/ Interval to recheck for the backup drive in minutes in case it is not available || only edit content within the quotes - default=30 (the lower the value, the higher the CPU load)
    set Interval to "30"

    #/ Do not edit anything from here onwards
    mount volume NAS_ServerDomain & NAS_DrivePath
    on error
    delay Interval * 60
    end try
    tell application "System Events" to set BackupDriveNames to name of every disk
    if BackupDriveName is not in BackupDriveNames then
    do shell script "hdiutil attach -mountpoint '/Volumes/" & BackupDriveName & "' '/Volumes/" & NAS_DrivePath & "/" & sparsebundleName & ".sparsebundle'"
    delay Interval * 60
    end if
    #/ Copyright ©Fabian Platte, 2017. || DO NOT DELETE this when sharing or modifying

    • Fabian Platte
      March 14, 2017 at 2:14 am

      updated version:
      to make it disappear from the Dock run:
      defaults write /{path}/{to}/{your}/{App}.app/Contents/Info.plist LSUIElement 1

      #/ Protocol (afp/smb) and name of the network drive || only edit content within the quotes - without a final backslash!
      set NAS_ServerDomain to "smb://{your NAS}"

      #/ Name of the mounted NAS drive (and path to a specific folder) - e.g "/{NAS drive name}/{your name}/Backup" - without a final backslash!
      set NAS_DrivePath to "/{NAS drive name}/{your name}/Backup"

      #/ Name of the backup drive || only edit content within the quotes
      set BackupDriveName to "Time Machine"

      #/ Name of the .sparsebundel file created for the backup || only edit content within the quotes - default "untitled"
      set sparsebundleName to "Time Machine"

      #/ Interval to recheck for the backup drive in minutes in case it is not available || only edit content within the quotes - default=30 (the lower the value, the higher the CPU load)
      set Interval to "30"

      #/ Do not edit anything from here onwards
      set NAS_ImageFile to "/Volumes" & NAS_DrivePath & "/" & sparsebundleName & ".sparsebundle"
      POSIX file NAS_ImageFile as alias
      delay Interval * 60
      on error
      mount volume NAS_ServerDomain
      end try
      POSIX file "/Volumes/" & BackupDriveName as alias
      delay Interval * 60
      on error
      do shell script "hdiutil attach -mountpoint '/Volumes/" & BackupDriveName & "' '" & NAS_ImageFile & "'"
      do shell script "tmutil startbackup"
      delay Interval * 60
      end try
      end repeat
      #/ Copyright ©Fabian Platte, 2017. || DO NOT DELETE this when sharing or modifying

  10. Brendonwbrown
    February 22, 2017 at 4:26 pm

    Is this still a working solution on the newest versions of OSX?

    • Vishnu
      February 28, 2017 at 10:26 am

      Works good for me. :)

  11. jbrelsdorfer
    November 29, 2016 at 9:38 am

    This is a good way to solve this problem. Also, I just looked at the airport base station guide. Apparently we can just plug a disk into our compatible apple base stations.
    In this help document HT202807

    Link maybe?:

  12. RideJo
    October 19, 2016 at 11:10 am

    Hi Justin and thank you for sharing this! In my case all seems to work until step 3), I mean the programme Time Machine still does not recognise the volume TimeMachine so I cannot set it up as the backup direction. Do you know from where this problem could come? Cheers.

  13. A Geek
    September 6, 2016 at 9:09 pm

    Brilliant, thanks for sharing!

    I've tried to run it under OSX 10.9.4, but after setting the default drive on Time Machine and trying to open the application I get the message "Can't connect to a current Time Machine backup disk.". Is it because Apple have "detected the bug" and fixed it so we have to pay? Or is it because it's different in my OS? Do you know any workaround for this? Would it work if I upgrade to Yosemite?


  14. Geek
    September 6, 2016 at 8:23 pm

    Brilliant! Thanks for posting!

    I've been trying all this in OSX 10.9, but after setting the new drive for Time Machine and trying to open the application I get "Can't connect to a current Time Machine backup disk.". Is it because Apple have "detected the bug" and have corrected it so we have to pay? Or is it because my OS works differently? Do you know any workaround for this? Would it work if I updated to Yosemite?

  15. cdv
    August 20, 2016 at 1:36 am

    Dude, this is brilliant. You have done what I've been trying forever. So clever. Thanks

  16. Dale
    June 5, 2016 at 10:53 am

    I've followed the instructions, but continue to get the "Can't connect to a current Time Machine backup disk." every time I try to start Time Machine.

    The sparsebundle file volume is mounted correctly (using the Login script method).

    Any ideas how to debug this?

  17. Pvsb
    May 26, 2016 at 12:45 am

    Guanos for the tip! It helps a lot!

  18. Petuel Gaspar
    April 22, 2016 at 8:19 am

    hello ,

    do you have procedure for recovery using this backup procedure.

  19. Paul
    April 4, 2016 at 5:14 am


    I'm using your script on El Capitan, so far the best solution to solve Apple's inability to make El Capitan working with NAS correctly.

    Just one question: Is there a way that the script runs as soon as I am connected to a specific WIFI as I dont always login/out so between home (where the NAS is) and work.

  20. Jarlath
    March 29, 2016 at 5:26 pm

    After creating the sparse file, running the terminal command gives me an error that the samba filesystem is incompatible:

    $ sudo tmutil setdestination /Volumes/Storage/Mackup/aisling_timemachine.sparseimage

    /Volumes/Storage/Mackup/aisling_timemachine.sparseimage: Incompatible file system type: smbfs (error 45)

    • TheCommoner282
      May 18, 2016 at 2:10 pm

      Written in March, I hope you have found the solution by now. For everyone else with the same issue, the reason is Jarlath did not read closely enough.

      Do not point tmutil's setdestination to the the sparsebundle. Instead mount the sparsebundle by double clicking it. This will mount the sparse bundle in /Volume/unidentified (unindentified is the standard name, but you could have chosen your own beforehand).

      Now point tmutil with setdestionation to this mounted Volume.

  21. Saurav Shrestha
    March 9, 2016 at 12:11 am


    Thanks for this tutorial. I've got everything set up and purring along fine.

    There is one unexpected problem I ran into: backing up two macbook pros simultaneously. The sparsebundle wont open because "Resource temporarily unavailable" as its being used by the machine doing the backup.

    Any way around this you think?

    Otherwise I will just create another share and have my second laptop back up onto that share.

    • Justin Pot
      March 9, 2016 at 1:02 am

      Hey there, I've never attempted to use one sparsebundle for multiple Macs but I don't think it's generally a good idea, I'd recommend creating a separate one for each Mac.

      • Saurav Shrestha
        March 9, 2016 at 2:39 pm

        I used it for a day and noticed that my desktop computer's internet speed was getting exceptionally slow. Probably cause of the large volume of read/write operations being performed on the share. This would be nice if I had a mostly unused desktop but for my primary machine it was a little annoying.

        So going to get a 4 TB drive for the Time Capsule instead. I guess there really is no other way around it :)

        Thanks for the alternative though!

        • Justin Pot
          March 9, 2016 at 3:32 pm

          I'm just glad you've got a backup system up and running now, enjoy the peace of mind!

  22. Paulo
    February 25, 2016 at 11:30 am

    If you want to add the disk to TimeMachine without losing your previous backups just add a -a argument to setdestination:
    sudo tmutil setdestination -a /Volumes/TimeMachine

    • Jan
      August 31, 2018 at 6:45 pm

      Holy smokes -- this really needs to be added to the tutorial above!

      I was in a moment of trouble when my original Time Machine backup destination went away after I followed this tutorial. Required a bit of digging to find the inherit and associate commands. Phew!

  23. Adrian
    February 20, 2016 at 10:24 pm


    I did exactly what this article suggested. Every step worked well. The backup(first) started and after a few hours, stops. So I start it again, it continues from where it stopped but takes ages to calculate remaining time (around 30 minutes). When it reaches the target (eg. 67GB), the target starts to increase again and it goes on for another hour or so then stops not completing the first full backup!!

    I tried this process over and over again. No luck. I checked my router...not the issue. The hard drive used. Not the issue. The hard drive was in NTFS first then HFS (my router supports both formats). Didn't make a difference!

    Checked the logs and this is where I guess the problem started:

    21/02/2016 12:10:06.846 am[602]: Stopping backup to allow backup destination disk to be unmounted or ejected.

    21/02/2016 12:10:07.563 am[602]: Copied 1348911 items (105.59 GB) from volume Macintosh HD. Linked 0.

    21/02/2016 12:10:07.642 am[602]: Error writing to backup log. NSFileHandleOperationException:*** -[NSConcreteFileHandle writeData:]: Input/output error

    I have no idea why it stopped to allow the disk to be ejected!! Is it something OS X does?? I am running Yosemite.
    Anybody else having this issue?

    • Andre
      April 12, 2016 at 2:49 pm

      Same thing here. Did you find any solution?

  24. jt
    February 17, 2016 at 8:06 pm

    The really sad part is that the tmutil command makes you "disconnect" ALL previous TM backups permanently. So now I have four backups that i need to redo from scratch... There should've been a warning son that...

  25. Jim Philippou
    January 19, 2016 at 5:22 pm

    Thanks for the great article! Creating the time machine volume worked great. I had issues mounting a volume using the script. After some searching, I found this site:
    which provides an incredibly easy way to automatically reconnect my network drive on a Windows PC.


  26. Dave
    January 16, 2016 at 3:55 am

    Hi. Nice work, quite clear. I followed the instructions. I wanted to create a large space, so I specified 1.4t as the size, and all seemed to work. However, when I began the backup, TimeMachine failed, saying there wasn't enough space, and the drive shows only about 54Gbytes available. Have I done something wrong?

    Shared drive is on Windows 7, is 1.44Tb.

  27. Mary-Anna
    January 9, 2016 at 1:34 pm

    I've tried this using a YouTube video (same technique) and your instructions. Both times, I get stuck in Terminal after inputing the location of the backup drive. It asks for a password. With the YouTube video, I actually set a password but Terminal never accepted it. With your technique, I did not set a password but Terminal still asked for one. Any ideas?

    • Justin Pot
      January 9, 2016 at 4:56 pm

      Have you ensured that all drives are unmounted before repeating the process?

      • Mary-Anna
        January 9, 2016 at 5:55 pm

        Yes. Every time. I make sure it's like I'm starting from scratch.

        • Justin Pot
          January 9, 2016 at 5:57 pm

          Hmm, I'm not sure what would prompt a password then assuming you're using an un-encrypted drive. My only guess is that the network share the sparesbundle is on, and the sparsebundle itself, share a name? Just a guess, not sure what else to add.

        • Mary-Anna
          January 9, 2016 at 6:18 pm

          Well darn. Thanks for your help! I'll keep trying.

        • Jason
          January 15, 2016 at 1:15 am

          the password it asks for is for the mac administrator account. Look in sys preferences under security - does it say at the top "A login password has been set for this user"? That's what it wants.

  28. Fra
    January 7, 2016 at 12:25 pm

    What if instead of using a sparse bundle I use a real Time Machine volume attached to the server? Do you think this will work?

    • Justin Pot
      January 7, 2016 at 3:16 pm

      Only if you server can share the drive using AFP, which is the only network protocol Time Machine supports. I'm hoping Apple starts supporting SMB in future releases, which would make all of this effort unnecessary.

  29. Anonymous
    January 6, 2016 at 7:13 pm

    Thanks for the easy to follow instructions! It still took me a couple of attempts to get it to work, but for two days it was diligently copying the initial backup to my NAS drive. Unfortunately, like in one of your comments above, about midnight last night the sparse bundle unmounted and now won't mount. "no mountable file systems". I can see the sparse bundle in disc utility, and when I select the item with a disc icon (versus disc image) I can run verify disc, which reports that it appears to be OK. When I try to mount it from disc utility it says to try running disc first aid, but the repair button is grayed out. Any suggestions?

    • Justin Pot
      January 6, 2016 at 9:15 pm

      Unfortunately no, this keeps happening to me as well. I'm looking for solutions, but haven't found one.

  30. John Link
    December 17, 2015 at 2:34 pm

    Can the procedure be used to have one network backup drive in addition to a backup drive directly attached to the computer to be backed up?

    • Justin Pot
      December 17, 2015 at 4:02 pm

      Yep, I have both set up right now actually!

      • John Link
        December 17, 2015 at 6:35 pm

        Thank you. That's great news.

        • John Link
          December 17, 2015 at 6:47 pm

          I have six computers on a network, each with its own hard drive dedicated to Time Machine backups. I now want to have an additional hard drive on the network that will contain a secondary Time Machine backup for each of the six computers. That is, on each of the computers I will have Time Machine make two backups, one on the dedicated hard drive and one on the secondary network drive. The network hard drive will be used only for Time Machine backups.

          Should I create six partitions on the network hard drive, i.e., one partition for each of the computers, or is it ok to have all the secondary backups reside in the same (single) partition?

          If I use a single partition for all six backups, can I reset the maximum size of the images after I've created them?

        • Justin Pot
          December 17, 2015 at 6:54 pm

          This is some high level stuff, and if you want to back up that many machines I sincerely think you should look into a Time Capsule, or a NAS that supports Time Machine backups. Trust me: you do not want to mess around with this for that many backups.

        • Anonymous
          December 17, 2015 at 6:58 pm

          What problems would you foresee if I were to proceed as I've described, whether using a single partition or six partitions?

        • Anonymous
          December 17, 2015 at 7:03 pm

          It looks like I could use a Time Capsule with a wired connection rather than wirelessly.

        • Anonymous
          December 17, 2015 at 7:08 pm

          If I had a Time Capsule, would I, on each of my computers, be able to specify it as the secondary location in addition to the hard drive dedicated to the computer?

        • Justin Pot
          December 17, 2015 at 7:29 pm

          Read the comments below and look at all the little hiccups people have run into. Now imagine doing that with 6 backups. I wouldn't want to do it myself.

          If you get a time capsule, or a NAS that supports AFP, you can still set more than one backup drive yes. That's a feature Apple offers as part of Time Machine.

        • Anonymous
          December 17, 2015 at 7:34 pm

          What does Time Machine do when it runs out of space on a Time Capsule used to back up several computers? I know that when using an external drive for backup it deletes the oldest backups in order to free space for the new backup. Does is do the same thing on a Time Capsule used to back up several computers?

        • Justin Pot
          December 17, 2015 at 8:43 pm

          I may be under-qualified to answer your questions, but I believe that yes: it will delete old backups to make room for new ones. I bet the local Apple store could explain more for you.

        • Anonymous
          December 17, 2015 at 8:49 pm

          Thank you for all your help, Justin.

  31. Sean
    December 16, 2015 at 5:18 pm

    The issue I’m having is that when I restart my Mac, the script runs before the network adaptor gets the chance to connect to my WiFi network! Has this not happened to other people?

  32. Chris West
    December 14, 2015 at 1:45 am

    Any way to encrypt the sparsebundle image and have the script enter the password automatically?

    • Justin Pot
      December 14, 2015 at 2:36 am

      Haven't tried the script with the encryption enabled or I'd help you out Chris, sorry about that.

      • Chris West
        December 14, 2015 at 3:55 am

        Have you had any issues where the disk image would unmount in the middle of a backup? I just had this happen.

        • Justin Pot
          December 14, 2015 at 4:33 pm

          Yeah, I've had that from time to time, I've also had a couple of images refuse to connect after a while. Still finetuning this all, beginning to wonder whether it's worth the effort.

  33. Adam Short
    December 8, 2015 at 10:55 pm

    Can't get the restore to work with Migration Assistant. Even if the drive is mounted when I launch Migration Assistant, it seems to go into a special "mode" where all my running apps are closed, and all my mounted drives are unmounted. Just won't find the backup. I've managed to get things going (I think) by manually copying the files out of the backup and back to where they ought to be, but that feels like a horrible hack, and I'm not sure what it's going to do to my file permissions.

  34. Ivan
    December 7, 2015 at 3:37 pm

    I have this running now, But i realized that the time machine backup is saving locally while backing up... and its taking space from my local HDD... which defeats the purpose of the backup if I dont have enough space locally to preform the backup. Is this true for everyone else as well?

    Im assuming the backup will then upload to the network drive after the time machine is complete but as of right now its taking my local storage. and im backing up a 1tb hdd with only 200 gb free.

    Any ideas?

    • Justin Pot
      December 7, 2015 at 3:57 pm

      Did you mount the local sparsebundle instead of the networked one?

      • Ivan
        December 7, 2015 at 6:51 pm

        Nope, I made sure I deleted the local sparsebundle before mounting... not sure why its not working properly.

  35. MacUser
    November 28, 2015 at 11:10 pm

    i love it. You just saved me from spending a lot of money on NAS. I am using external hard drive that is connected to ASUS router. Great tip!

    • Justin Pot
      November 29, 2015 at 2:36 pm

      I hope it works out for you!

  36. Anonymous
    November 6, 2015 at 5:29 am

    I tried what you said but I get this error at the last step:

    /Volumes/TimeMachine: Incompatible file system type: smbfs (error 45)
    The backup destination could not be set.

    • Justin Pot
      November 6, 2015 at 2:19 pm

      Seems like you mounted the Windows share, and not the file image, make sure you name those two things something different and try again.

    • Ken Blackman
      November 25, 2015 at 8:29 am

      I got this error too. The step I totally glossed over was:

      "Once everything has copied you can then delete the remaining image on your desktop. Now, double-click the copy of the image on your network share – this will mount it. If everything worked, you should see the new TimeMachine drive in your Finder’s sidebar and on your desktop (depending on your settings)."

      It's *that* volume that you want to specify in the sudo tmutil command that follows.

  37. Anonymous
    October 19, 2015 at 8:56 pm

    great work! and even the hangup isnt one: u can simply restore the image to a free partition. u only need enough free space and a second mac, while your first crashed. but it takes some time if the backup is big.

    • Justin Pot
      October 20, 2015 at 12:04 am

      Not a bad tip!

  38. Anonymous
    October 19, 2015 at 4:08 pm

    Hi Justin,

    Apologies if you may have covered this already, but I couldn't see my specific issue in the thread/history.

    I recently upgraded to 1TB SSHD from the 500Gb my MacBook Pro came with, and almost within a week of setting up an external NAS based backup via TimeMachine my disk was out of space. Looking into it some more, the only new file was the sparsebundle file which was almost 500Gb. Can I use your instructions to copy this file to the NAS drive, mount and then delete the original sparsebundle file on my laptop? Will this work, please advise?


  39. Anonymous
    October 15, 2015 at 9:36 am

    Just tried this and it appears to work fine, except I had to run the following before I could use the new drive in TM:
    sudo tmutil inheritbackup /path/to/sparsebundle
    (Run before mounting.)

  40. Anonymous
    October 12, 2015 at 11:20 am

    I am getting this error

    /Volumes/TimeMachineAuto: Permission denied (error 13)
    The backup destination could not be set.

    When I type ls -l on /Volumes

    This is the output

    drwxr-xr-x 4 kcherivirala _guest 204 Oct 12 16:19 TimeMachineAuto/

    Then I tried to change the folder to write only mode using 'chmod 755'

    Then I got this error

    chmod: Unable to change file mode on /Volumes/TimeMachineAuto: Read-only file system

  41. Anonymous
    October 5, 2015 at 3:46 pm

    Hi Justin, great tutorial, i have a question, I'm thinking in a scenario of a kernel panic for example, that you need to do a full restore of the hard drive, you think is posible to copy the sparsebundle to a USB drive, then connect that USB drive to the Mac and then do a full restore from that USB drive?

    I think is possible but i'm not so sure.

    • Justin Pot
      October 5, 2015 at 4:21 pm

      This sounds like it would work, but I'm not sure at all. Maybe test it before relying on it?

  42. Anonymous
    October 2, 2015 at 9:31 am

    Hi Justin,

    Just started looking at this.
    I have a QNAP NAS server and before i read this, from a couple of MACs on 10.10.5, i have set up my Time Machine backup by using this terminal command only:
    sudo tmutil setdestination afp://user:password@servername/TMBackup

    My machines mounts following a shutdown/restart and i can use Time Machine to backup/restore files.

    I guess the downsides are things like not being able to set encryption or size restrictions individually.
    Can you tell me anything else that you think would cause me a problem doing it this way that i have not found yet?



    • Justin Pot
      October 2, 2015 at 2:17 pm

      Looks like your NAS supports AFP, in which case you should just ignore my instructions here and set things up the way you did. It's going to be better in every way than my steps outlined above.

  43. Anonymous
    September 22, 2015 at 6:17 pm

    I have been using this "hack" for a couple of months now.
    Starting today, I cant mount my sparsebundle anymore.
    Disk Utility cant repair it...
    Guess the only easy thing to do is to buy a time capsule :P

  44. Anonymous
    September 11, 2015 at 12:09 am

    Hi, everything goes well until i reach migration assistant. What options did you use to have it shown on it.

    • Justin Pot
      September 11, 2015 at 5:05 pm

      I just made sure I had the drive mounted when it was time to do the migration, is that not working for you?

      • Anonymous
        September 11, 2015 at 5:50 pm

        no, i will try mounting the image with disk utility, so far migration assistant is not seeing the script mounted volume under yosemite 10.10.5

        • Justin Pot
          September 11, 2015 at 6:04 pm

          Yeah I've had all sorts of trouble with the script, am thinking about removing it from the article. Let me know if this works for you.

  45. Anonymous
    August 12, 2015 at 10:28 am

    Hi. Thanks for this tutorial.

    I was able to set it up yet when I start the TimeMachine's backup it is stuck at 307Kb. Do you figure any solution?



    • Justin Pot
      August 12, 2015 at 2:25 pm

      I haven't run into this specific problem, and I'm not sure how to help you. If you're on WiFi, trying plugging into the router directly and see how it goes.

      • Anonymous
        August 12, 2015 at 5:48 pm

        It is a router problem. It has a usb port and supports smb shares. When i've configured timemachine there it even crashed from time to time. Huawei quality!

  46. Anonymous
    July 29, 2015 at 1:40 am

    Thanks so much for this! Everything worked up until the point of attempting my first timemachine backup. I get a message saying something along the lines of not enough space. I was limited on how big I could make the 'TimeMachine' disk to the amount of free space on my computer (not enough space for a single backup). Is there a way to make the disk larger using storage space of server I'm using?

    • Anonymous
      July 29, 2015 at 2:22 am

      Whoop! Nevermind. Figured it out. I wasn't copying the correct 'file' onto the server.. Thanks again!

      • Justin Pot
        July 29, 2015 at 2:47 am

        Glad you figured it out!

  47. Anonymous
    June 29, 2015 at 3:09 pm


    Hope you may have seen this. I went through the steps creating the sparse bundle named my computer name along with an _ and my MAC address to keep it unique, as suggested in another site I ready. I had issues with getting everything going there and found this link. Using the same steps I named the bundle and followed the steps with no issues until opening the TimeMachine utility in which it crashes with the error "Can't connect to a current time machine backup disk". Any suggestions?

    • Justin Pot
      June 29, 2015 at 3:19 pm

      I haven't run into this specific problem yet, but for lack of a better suggestion I'd say to restart your computer and reconnect, see if the problem reoccures.

      • Anonymous
        June 29, 2015 at 4:02 pm

        Rebooted server and mac with no luck. I will keep looking into it and post if I find a fix :-(

        • Anonymous
          June 29, 2015 at 6:37 pm

          Scratch that, I wasn't thinking... been a long work day :-( I didn't start a backup and I was launching TM form the launchpad. Basically it couldn't connect to the current backup because none existed. Thanks for the guide, looks like all is working great so far :-)

    • Justin Pot
      June 30, 2015 at 1:30 pm

      I'm glad you got it working, Jerry!

  48. Anonymous
    June 8, 2015 at 2:48 am


  49. ZerockzZz
    May 21, 2015 at 5:50 pm

    You have to add -volname TimeMachine to Your Command to name it correctly.

    diutil create -size 500g -type SPARSEBUNDLE -fs "HFS+J" TimeMachine.sparsebundle -volname TimeMachine

    • Anonymous
      August 10, 2015 at 10:13 pm

      Thank you for this, ZerockzZz! Justin, can you please update the article with this vital little tidbit?

  50. Mike Compeau
    May 20, 2015 at 4:58 pm

    I seem to have gotten this to work "sort of". The TimeMachine sparsebundle was only "mounted" the first day, and then about three days later.
    It won't hang around. Trying to double click on the sparsebundle out on the server doesn't do squat-- nothing happens. I'm frustrated. I'm savvy on most tech stuff but I don't awk and grep and don't speak fluent linux and C+ or anything else programming-ish. So, I'm feeling distinctly out of my depth. When you mention "bundle" i'm suddenly lost. There's entirely too much assumption of knowledge in nearly every single article I've pulled up to try to get help on my situation, so I'm resorting to leaving a message. I hope you can help.

    I have a network/networked drive that is a 5TB drive (Seagate Backup Plus) attached to my Asus router (RT-N56U). I was thinking that I could use your technique to get TimeMachine finally running backups off my MacBook Pro 15, but it seems like a coin toss with bad odds...


    • Justin Pot
      May 20, 2015 at 11:32 pm

      I have certainly found this approach to be inconsistent at times, and the problem is entirely that I can't get the partition to mount at times. In all of these cases I have found that restarting my Mac solves the problem. It's not an ideal solution, I'd rather avoid rebooting, but it does work.

  51. Rick Bousquet
    May 13, 2015 at 2:10 pm

    Actually if they would enable smb protocol in the recovery console it could be restored in theory. I have tested in the way just for purposes of testing as close as possible. I did my TM for 5 days to a smb connected share. It worked great. I than started working on restoring. Found out that smb is disable in the recovery console. I finally used afp to connect to the same share and I could do a complete restore without issues. I really wish they would enable smb in the recovery console. Seems pretty short cited of a company that is promoting smb and trying to move away from afp to not enable this.

    • Justin Pot
      May 13, 2015 at 3:18 pm

      This is really strange, and I hope Apple supports SMB more in future releases. How did you end up using AFP to connect? Does your NAS offer AFP as an option.

  52. Thierry
    May 12, 2015 at 7:20 pm

    I ran everything succesfully, except the last step: reload the backed-up data via Migration assistant. When I fire this one, it unloads all other programs from memory, also the TimeMachine I made on my NAS and loaded into memory..
    Strange behaviour, or error on my side?

  53. David
    May 6, 2015 at 8:15 pm

    Cool - thanks. by the way I only get a plain TimeMachine finder icon - is this right ? Being stupid and fussy I want the real one ;)

    • David
      May 6, 2015 at 8:56 pm

      actual seems to be a well known issue:

    • Justin Pot
      May 6, 2015 at 9:06 pm

      At first it looked plain, but eventually the Time Machine icon did show up for me.

    • David
      May 6, 2015 at 9:20 pm

      I'll keep an eye on things in that case. Another thing do you know the reason why a restore can't be done during a Recovery ? Is there just no option to mount the share during Recovery - I haven't actually ever done one...

    • Justin Pot
      May 6, 2015 at 11:31 pm

      Yeah, there's no way to mount the partition during recovery sadly. It's unlikely we'll ever find a fix for this either.

  54. David
    April 17, 2015 at 6:40 pm

    Thanks for the guide, very useful!

    My NAS (a Drobo 5N) didn't play well at all with tens of thousands of 8 MB files in a single folder, so I had to increase the band size to 128 MB.

    Also, I wanted encryption.

    I solved both problems like so:

    create -size 1800g -type SPARSEBUNDLE -volname "TM" -fs HFS+J -imagekey sparse-band-size=262144 -verbose -encryption -stdinpass TM.sparsebundle

  55. andreas gludsted
    April 13, 2015 at 4:54 pm

    i can't move the TimeMachine.sparsebundle to my network drive
    please help

    • Justin Pot
      April 13, 2015 at 4:58 pm

      Can you move other files to the drive? If not, check your permissions on the server side. Not sure what else the problem could be, what kind of error do you get?

  56. Wil
    April 2, 2015 at 2:08 am

    Dunno if this might help anyone, but I found that by starting my script with a delay command helped it to mount my smb share much more consistently. The delay gives time for my laptop to actually connect to the network before giving up. I just added

    delay 10

    to the top of the script given above (in addition to a few other minor modifications as I'm not fluent in this scripting language). It assumes seconds, apparently. You may need to extend it if you take longer to connect.

    Hope this helps someone. Thank you for the tutorial! A solid backup of my wife's laptop was LONG overdue, since it has most of the pictures of my 3 year old on it!

    • Justin Pot
      April 2, 2015 at 2:04 pm

      Thanks for the idea, it's a good one! You should suggest it on Sean's post as well.

      • Sean
        December 30, 2015 at 1:09 am

        Sorry I didn't read this to begin with... I thought I -HAD- read all the comments and then when you told me to read the comments I noticed there's a "load 10 more comments" at the bottom of the screen, which must be expanded several times

  57. Flavia
    March 26, 2015 at 6:26 pm

    It worked fine until I had to enter the command: sudo tmutil setdestination /Volumes/TimeMachine
    it's asking for a password, I tried modifying the read&write settings but it's still asking for one... I tried all passwords, none work... any idea what it could be and how I could change this? maybe with some terminal commands

    Thanks !!

    • Justin Pot
      March 26, 2015 at 6:52 pm

      It shouldn't be asking for your password at all, are you sure you didn't name the network share Time Machine?

  58. Joe Collins
    March 10, 2015 at 6:01 pm

    Hey Justin,

    Thanks a million for this post! Now I can actually use SMB 3.0 and encryption for my Time Machine!!!

    • Justin Pot
      March 10, 2015 at 9:25 pm

      I'm really glad it was helpful!

  59. Ben Burwitz
    March 10, 2015 at 4:41 pm

    Thanks for this post. Everything was described very clearly, and I actually got most of this to work, which is amazing because I know nothing about computer speak. The only issue I am having is that my NAS has a password required, so I believe I need to somehow incorporate that step into the Applescript so that I can mount at startup. Error I receive when running the script is:

    There was a problem connecting to the server The share does not exist on the server. Please check the share name, and then try again.

    Time machine is successfully pointed to the sparse bundle on the NAS, and the size of that sparse bundle is correct, and I have already performed a backup.

    Any chance someone can help me with the Applescript, otherwise not a huge issue to manually mount.

    • Justin Pot
      March 10, 2015 at 9:27 pm

      I'm afraid I'm not sure how to modify the script to include a password, sorry! I've since set up Control Plane to automate mounting, check out my tutorial here:


      I think I'll edit this article to point out this new solution.

    • mtjoseph
      March 20, 2015 at 1:31 pm

      ayou may have already figured this out. If not, and for others, try this.


  60. Andrew Quebe
    March 10, 2015 at 5:56 am

    Dude, you're amazing! I just spent the last 3 hours trying to figure this out. Thanks a lot!

    • Justin Pot
      March 10, 2015 at 3:16 pm

      Glad the article was helpful! I'd consider it a favour if you shared it with anyone who might be interested.

  61. Joe
    March 4, 2015 at 8:50 pm


    The path of the sparsebundle is //paulnas/Time Machine/TimeMachine.sparsebundle. When I run the script, I get the following error:

    error "hdiutil: attach: extra image argument "/Volumes/Time" - "Machine/" already specified
    Usage: hdiutil attach [options]
    hdiutil attach -help" number 1

    Additionally, after I run the script and try to backup, it seems that Time Machine is directed to the desktop "TimeMachine" instead of the one on the NAS so I get "There isn't enough space on TimeMachine". Here is the script as I ran it. Thanks for any help.

    mount volume "smb://paulnas/Time Machine"
    end try

    do shell script "hdiutil attach -mountpoint /Volumes/Time Machine/ /Volumes/Time Machine/TimeMachine.sparsebundle"

    I'm using Yosemite btw.

    • Justin Pot
      March 4, 2015 at 9:59 pm

      Hey Joe! The first error you're seeing is because there's a space in the name of the network share – this gets weird fast. It's trying to find something at "/Volumes/Time". The quick fix is to rename the share to something without a space.

      The second problem, I think, is because you have too many drives mounted named "TimeMachine". Again, the simplest fix is to name your sparsebundle something else entirely just to avoid confusion.

  62. Matthew Sexton
    February 27, 2015 at 12:14 am

    This didn't work for me. When setting the destination i got:

    "Destination does not support F_FULLSYNC. (error 45)
    The backup destination could not be set."

    I tried both methods of file creation.

    • Justin Pot
      February 27, 2015 at 4:08 am

      Okay, I might be totally off base here, but the only way I can figure that you got that error is if you tried to point time machine at the network drive where the sparsebundle is instead of the mounted bundle itself. That's not it, is it?

      I just tried the method again just to make sure and it worked for me on Yosemite. What version of OS X are you running?

    • Matthew Sexton
      February 28, 2015 at 3:47 pm

      Justin you were correct. I named my sparsebundle and network share the same, so when I ran the command it selected the network share over the sparsebudle. Heads up for anyone else having the same issue. Pick a different name for your bundle and network share. Thanks for the good article.

    • Justin Pot
      February 28, 2015 at 8:31 pm

      I'm glad we could figure it out! Hope the new setup works for you.

  63. biff
    February 25, 2015 at 7:15 pm

    Why doesn't it work via Recovery HD?

    • Justin Pot
      February 25, 2015 at 10:22 pm

      Because it's unsupported, Recovery HD won't see the drive on the network. And, outside of OS X, you can't use the command to manually assign the drive. There's no way around this that I've found.