Home > other Stuff > How to: Use existing Time Machine backups wireless

How to: Use existing Time Machine backups wireless

This how-to describes how to use shares on your local network as backup volumes for Apple’s Time Machine. This is interesting especially if the network is wireless! And different from other hints on the web, this article tells you how you can keep your existing backups for that. Apple sells this functionality with its Time Capsule products (but they do not support the reuse of existing backups).

If you don’t want to read the whole article and know the Terminal well, here it is in very compressed form:
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
sudo hdiutil create -srcdevice /dev/<diskXsY> -format UDSB -fs HFS+J -volname Backups -layout NONE /Volumes/<your network share>/.<your ethernet macaddress without colons>

Many posts on the web helped me to get this working and I would like to thank especially Florian Kruse for his article on this topic. If you are setting up Time Machine for the first time and would like to do that over network, read his article.

What you will need:

  1. Time.
  2. Some kind of computer (Mac, Linux, Windows, …) that you have access to and that is connected to your network. I will reference to it as the server from now on.
    If it’s possible to connect external hard drives to your router, you can of course use this as your server as well.
  3. A network share on the server (the place where your backups will be kept). This can also be your existing external drive where you keep your backups right now.
  4. The same amount of free space that your existing backups take up. And it must not be on the same partition on which the existing backups are stored right now!
    One way to find out how much space they use is to open the Disk Utility (under /Applications/Utilities), select the backup volume and see what it says at the bottom of the window.
    This is because you will need to create a copy of your backups (see next section why). If you’re planning to use your external hard drive as your backup volume, you will need to create the copy elsewhere, format your backup volume and then move the copy back.

How it works:

If you connect an external drive (e.g. over USB) to your Mac and make your backups, the files, folders and Time Machine config files are naturally written onto the partition you chose.
But if you use Volumes that are mounted over network, Apple decided to use another technique. They create a SparseBundle file on the network drive (read here what it is). This file is a kind of disk image and contains all the data we would have on a USB drive. It is then mounted on your Mac and is used for backups.
Now you could say: “Why this double trouble”? There are some reasons why we want this!
The best thing is, that it has the HFS+ Journaled filesystem! This way we can use any network share without having it to support HFS+ Journaled. Maybe you have tried to connect your USB drive to the server before. What happened? Right you can’t mount it writable because HFS+ Journaled isn’t fully supported by Linux, yet.
Another advantage is, that it only takes up the space it needs! You don’t have to create a fixed partition that takes up hundreds of gigabytes even if it’s not used. Nevertheless it can be unmounted (which Time Machine actually does) every time the Backup is not needed.
Yet another important reason: The files on your Mac can have complicated extended permissions and hard- and soft-links etc.. Network shares like Samba(Windows share) or FTP do not support these high fidelity file permissions and types. So you wouldn’t be able to use them as backup volumes.

Before you start:

Make sure your Mac can connect to the network share on the server and has read and write permissions. The used protocol is irrelevant (see section above why).
I cannot explain how to set up the network share in this article since and is different for each platform and type.
Warning: Be careful with your backups! I myself had a head-crash while my backups were broken. Yes, it is possible! So always know where your backup files are!

How to do it:

  1. Turn Time Machine off so it doesn’t interfere.
  2. Creating the SparseBundle (the interesting part)
    As I said before, you will need empty space in size of your backups where you can save the bundle file. If it’s on the network share, great! That’s where it should be. If you’re planning to use your external hard drive as your network share, you will need to create the bundle file elsewhere, delete your backups and then move the bundle there. “Elsewhere” can also be on the external drive as long it’s on a different partition.    

    1. Find out the backup identifier
      To do so, in Terminal (/Applications/Utilities) enter
      ls -la /Volumes/<nameofyourtimemachinevolume>
      It will show you a list of files. Find the one that starts with a dot and ends with a twelve digit hex-code e.g .0019e56f322a Write down this string somewhere.
    2. Find out the device file of the backup volume. Therefore open the Disk Utility (/Applications/Utilities). There, right-click (control-click) on the backup volume and open the Information window. The device filename is the name after Disk Identifier. It should be something like disk1s1. Again, note it.
    3. Unmount the backup volume
      In Disk Utility, select the backup volume and hit unmount. Do not eject the disk!
    4. Create the SparseBundle by opening the Terminal (/Applications/Utilities) and entering the following line:
      sudo hdiutil create -srcdevice /dev/diskXsY -format UDSB -fs HFS+J -volname Backups -layout NONE /path/to/free/space/filename
      Where diskXsY is the Disk Identifier you found in 3.2 and /path/to/free/space is the location where you would like to save the bundle file to. When it’s done, you will find a file named filename.sparsebundle there.
      Hint: This operation takes a long time. It took about an hour for my 75 GB backup.
    5. Optional: If you did not create the file on the network share, move it there now (in Finder hold down the option key for moving instead of copying). If you would like to use your existing backup drive as the network share, you will probably need to format it first (not as HFS+ Journaled!) and then move the sparsebundle file there. To format it, use Disk Utility.
    6. Name the file right
      The .sparsebundle file must have the same name you found in 3.1. Finder won’t let you rename files to names that start with a dot. So open the Terminal again and goto the location where you created the file. There, type
      mv filename.sparsebundle .0019e56f322a.sparsebundle
      Of course using your values instead.
  3. Enable Time Machine for network volumes
    By default, Time Machine won’t let you choose volumes that are mounted over network. To enable it type the following in the terminal:
    defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
  4. Turn Time Machine on
    Make sure you have mounted the network share with the sparsebundle file in it (and it’s not in subfolders). Then open Time Machine preferences, click “change disk…” and choose the network share.
    Leave the settings window open to see if it worked. If so, it will start to backup. When it finishes, you will be able to use your old backups!
  1. lodger
    7. August 2008, 08:16 | #1

    Wow, finally exactly what i was looking for! I will try this out tomorrow with my airport extreme and my TrekStor 1TB USB HD. Will let you know how it went. Thanks!

  2. 11. August 2008, 20:25 | #2

    Lodger, nice to hear. I’m excited to hear from you!

    An update:
    Yesterday I tried the above on a clean network share. Unfortunately just copying the sparsebundle file to it didn’t work straigt away. What I needed to do first, was to start Time Machine using the network share as the backup volume and then canceling it. This made Time Machine write some necessary config files to the network share. After that I copied the sparsebundle file to it and then Time Machine was able use it.

  3. markus
    16. August 2008, 08:10 | #3

    hi Rolf,
    thank you very much for this howto! i spend months on searching the web to get my backups going.

    unfortunately i’m stuck in step 2.)

    my smb network share where I keep my backups is not listet in Disk Utility. Therefore I cannot find out my Disk Identifier.

    Any hints?

    thanks, markus

  4. 29. August 2008, 15:18 | #4

    that suck. buy an Time Cupsule :) …. no, great job :)

  5. Rolf Haynberg
    29. August 2008, 15:20 | #5

    I love you too my dear! ;)

  6. LH
    29. August 2008, 19:55 | #6

    This worked for me to transfer my local backup to a Leopard file server, with one exception. I set Time Machine to backup to the (blank) network drive as suggested in the comments, then cancelled and turned Time Machine off. This created a file on the network drive called “ComputerName_000000000000.sparsebundle” where ComputerName is the network name of my computer and 000… is the 12-digit string from step 2.1. I deleted this file, copied over my sparsebundle created in step 2.4 and renamed it to “ComputerName_000000000000.sparsebundle”. After re-enabling Time Machine, it was able to backup like nothing happened.

    I first tried this using the .000000000000 filename in these instructions, but my Mac promptly overwrote this file with a much smaller one as soon as I enabled Time Machine on the disk. Fortunately, I kept a copy of the sparsebundle elsewhere. Regardless of which method you use, my suggestion would be to maintain a backup of the sparsebundle until you’ve got Time Machine working correctly again!

  7. 1. September 2008, 10:01 | #7

    Hi, thanks for pointing out what I wrote above: “… always know where your backup files are!” :)
    You wrote that it was backuping but nothing happened. Do you mean TM was in “preparing”-mode? That is actually a good sign. It can take a long time the first time (needs to read the backup files). Give it an hour or so! It will be quicker after the first backup.
    Regards

  8. Carlo
    4. September 2008, 11:36 | #8

    I did not succeed. I hope someone can give any suggestion.
    Here is what I did:
    - from Terminal: defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
    - in Time Machine: I chose my MyBookWorld (connected in wifi) as backup drive and created the first backup (note that such drive does not appear in Disk Utility)
    - Time Machine created the sparsebundle file (I copied its name) then failed tha backup and deleted such file
    - I turned off Time Machine
    - in Disk Utility: I created on my desktop the new HFS+ journaled sparsebundle named as the one created by Time Machine
    - I copied the new sparsebundle to the backup network drive
    - in Time Machine: I tried to create a new backup
    - the operation failed (no backup could be created)

  9. 7. September 2008, 17:17 | #9

    Hi, Carlo,
    When you copy your newly created Sparsebundle to the network drive, make sure it starts with a dot and ends with .sparsebundle. Finder won’t let you rename files to start with a dot (they are hidden files), so you have to do it with Terminal.app.
    Hope this helps!

  10. Carlo
    7. September 2008, 18:53 | #10

    Thanks Rolf.
    Right now my Time Machine is making the first backup!
    Anyway, it was not an issue related to the . before the name of the sparsebundle file.
    I finally noticed that the file name I was using had a .tmp. in it (ComputerName_000000000000.tmp.sparsebundle). As I removed that .tmp. Time Macine finally started the backup.

  11. Carlo
    7. September 2008, 18:54 | #11

    I wanted to thank you for making me analysing the filename…

  12. 22. September 2008, 21:55 | #12

    thats it, brother

  13. 6. November 2008, 00:02 | #13

    In the article a huge thank you all for the cause, a lot of people are using

  14. Dirk
    10. November 2008, 13:01 | #14

    Hi, i have tried exactly as You said:
    1 started TM to do Backup on an external 100G USB Harddisk.
    In Terminal, mount says its /dev/disk2s1.
    ls-la gave me my MAC-Address, right as I expected.
    2 interupted TM, did a sudo umount -f /dev/disk2s1.
    3 did a :sudo hdiutil create -srcdevice /dev/disk2s1 -format UDSB -fs HFS+J -volname Backups -layout NONE /Volumes/gerlandplatte/Dirk/test.

    this produces :
    Gesamte Disk (Apple_HFS : 0) lesen …, then lots of dots (didn count them…),
    Dauer: 1m 4.217s
    Geschwindigkeit: 4.5M Byte/s
    Ersparnis: 99.7 %
    hdiutil: create failed – Der Vorgang wird nicht unterstützt.
    Console log tool says: “10.11.08 12:40:16 kernel disk2s1: ioctl(_IOW,’f',126,4) is unsupported. ”
    so i think its not the network disk thats causing problems, but my srcdevice !?!
    The directory /Volumes/gerlandplatte/Dirk/test is on an NTFS formatted drive (that i have to share with my flatmates). Write access is provided by a paragon driver, and so far, i had no severe problems writing to that disk.

    Any Ideas?

    Dirk(PB G4, 1GHz, 10.5.5)

  15. Dirk
    10. November 2008, 13:09 | #15

    Oh, I forgot to mention:
    step 3 produced an ever growing (to approx. 275M) file test.sparsebundle in the destdir for as long as step 3 continued drawing dots in the console window. after that the file disappeared completely. hope that helps.
    Dirk

  16. 12. November 2008, 19:51 | #16

    Hi Dirk,

    Sounds like your TM-Backup didn’t finish before you started the procedure describted here. It’s important that you have Backups already and then turn off Time Machine.

    If you want to start a fresh Backup over network you are wrong here. You might want to read Florian’s article http://www.flokru.org/2008/02/29/time-machine-backups-on-network-shares-in-leopard/
    But I don’t recommend doing the first backup over network because it takes forever!

    Hope this helps! If not, you can contact me anytime over my contact-form (see frontpage of this blog)

    Regards

  17. Andre
    1. Dezember 2008, 08:29 | #17

    Rolf, thanks for the detailed description. I am in the process of generating the sparsebundle file right now (380GB takes forever… ;) Anyway, you mentioned that the new network drive should NOT be formatted in HFS+ journaled? Why is that? And would it be a problem if it is formatted that way?
    (HFS is equivalent to Mac OS Extended, isn’t it?!?)

  18. 1. Dezember 2008, 13:52 | #18

    Andre,

    HFS+ becomes a problem when using it with Linux, because until now it is only fully supported in read-only mode. If you have your network drive attached to another mac, then this warning does not apply to you.

    Cheers

  19. Andre
    1. Dezember 2008, 16:25 | #19

    Thanks for the response! I am running Mac OS X 10.5.5 and the network drive will be attached to an AirPort Extreme Base Station which I intend to use for time machine backups. Would HFS+ journaled be a problem? Should I reformat the drive? If so, to what?
    (I am also a bit confused since so many other posts I found online state that HFS+ journaled (Mac OS Extended (Journaled)) would be the best option for a NAS drive for time machine. Any comments?)
    Thanks again!

  20. Andre
    1. Dezember 2008, 17:23 | #20

    Also, I had created the sparsebundle file directly on my backup drive which is formatted “Mac OS extended (Journaled)” (= HFS+ (Journaled)??). I attached it to the AirPort Extreme and it started backing up but is still in the “Preparing…” stages (I have heard that this can take quite a long time; how long do you think?).

    Anyway, it seems to work but I am not sure (since it is stuck in “Preparing…”, see above). Do you think this has to do with the fact that the drive is formatted “Mac OX extended (journaled)”? Would it be worth it to reformat the drive? (I still have the sparsebundle file, so that would not be a problem…)

    And if so, which format option shall I chose?

    Thanks again!

  21. 1. Dezember 2008, 17:31 | #21

    To your first comment: I cannot say much about it because I don’t own an Airport Extreme but if it discovered your harddisk before, you should be fine.
    To your second comment: Yes it takes about the same time it took for creating the bundle file. That’s why one of my first lines said that you will need time :)
    But all in all it sounds good so far. I hope the effort pays out for you! It’s a good idea to keep the bundle file for a few days in case something doesn’t work.

  22. Andre
    1. Dezember 2008, 17:39 | #22

    Ok, it is good to know that it can take that long for the “Preparing…” to finish. I will just go to work and it should be done by the time I get back (the creation of the bundle file took over 7 hours according to terminal for 360GB), although the initial creation was done via USB and now I have it attached to the network. Hopefully, it won’t be longer than 7 hours.

    Do you think I need to worry for my computer to go to sleep although it is working on the backup (“Preparing…”)? Should I set it to never go to sleep?

  23. 1. Dezember 2008, 18:12 | #23

    Good thinking. And, yes, I would do so because I wouldn’t want Time Machine stopping my computer from going to sleep and I expect Apple having thought the same.

  24. Andre
    2. Dezember 2008, 04:59 | #24

    Just wanted to let you know, that the initial “Preparing…” step lasted “only” 2 hours and after that, the backup took place every hour as expected!
    Thanks again for the detailed description!
    By the way, is it possible to use the sparsebundle file on a drive attached via USB (in case I ever want to switch back to wired backups)? Or would I need to do a similar procedure?

  25. Andre
    2. Dezember 2008, 07:20 | #25

    Sorry, me again…

    I read this article (http://www.flokru.org/2008/03/15/time-machine-backups-on-network-shares-2-possible-problems) and I am confused now: according to your instructions, I created a sparsebundle from old backups from a USB-attached harddrive to use wirelessly via AirPort Extreme. This sparsebundle on the network drive has a capacity of 465.4GB (I guess this is because my old hard drive was 500GB).

    My new hard drive (the one which has the sparsebundle on it and is attached to the AirPort Extreme) is 1TB. What is going to happen if my backups add up to the capacity of the sparsebundle? Is time machine expanding the capacity, up to the capacity of the drive? Or is it starting to delete old backups although there is 0.5TB still available on the drive? (The latter option scares me, especially after reading the above mentioned article…)

    Please help!

  26. 2. Dezember 2008, 09:41 | #26

    Thanks for a great tutorial!

    My 80GB drive took about two hours in the first “Preparing” mode, but subsequent backups took around 10 minutes (when there was no changed data on my hard disk). As Andre said, maybe it’s good idea to mention the long time it takes in preparing mode the first time the backup is initiated over wlan.

  27. 5. Dezember 2008, 21:23 | #27

    Andreas: Nice to hear that it worked for you!
    Andre: That’s an interesting point. Maybe you can find a way of resizing the partition?

  28. Andre
    5. Dezember 2008, 22:02 | #28

    In the end, it turned out to be easy to resize the sparsebundle. You can do this with Disk Utility. It took me a bit of playing around (I think the image must not be mounted for resizing) but in the end it worked.

  29. 17. Dezember 2008, 05:29 | #29

    This is a seriously cool solution, Rolf. Thanks for the write-up.

  30. Aaron
    22. Dezember 2008, 14:47 | #30

    Hi,

    Firstly, this is a great guide for getting this working! I am though, having a couple issues and wondered if anyone had any ideas to get it working!

    When I was creating the sparseimage file from my current backup location (straight onto the network share) it took ages then right at the end said it failed and it deleted the image.

    Then I thought I would go ahead and see if i could start a fresh time machine backup on the drive, after enabling unsupported drives with the terminal. Time machine can see the network drive, but when it tries to backup it says failed (doesn’t specify why). Also it asks for network credentials to mount the share when time machine starts.

    The file server is a windows server 2003 machine, which is on a domain – the credentials i enter when time machine asks are correct, as I can mount it myself and can read and write to it.

    After time machine has failed if i check my account in Active Directory i have been locked out – this happens every time time machine tries to backup there.

    Any help would be greatly appreciated.

    Thanks,
    Aaron

  31. 27. Dezember 2008, 11:56 | #31

    Hi Aaron,

    I can’t see why it doesn’t work for you. I can only give you a few ideas:
    Did you turn off TM before you started creating the sparsebundle?
    Have you tried to create the sparsebundle on a non-network disk and then copy it to the network location later?

    Hope you get it working,
    Rolf

  32. JusjongKull
    27. Dezember 2008, 23:41 | #32

    I’m hoping this can be the solution of my problem – sounds good. I have the same problem as Markus – I cannot find the Disk-ID for the SMB-shared folder/drive. I have shared the external HDD in WinXP and “connected to server” in Finder, but it isn’t recognized as a drive, just only a “Shared Folder” … What do I do? Thanks!

  33. George Kinal
    5. Januar 2009, 18:32 | #33

    Rolf, I believe there is a serious error in your instructions. This error explains why some people have been able to use the instructions and many, such as Dirk, have failed.

    In the hdiutil create command sequence, you have used -fs HFS+J.

    This works whenever the target volume can support HFS+J – thus, on the Mac desktop itself or with an Airport.

    But when the network volume is a WD MyBook (etc.), or a shared volume on a Windoze machine, the process goes OK until the very end, when a failure is reported and the large sparsebundle file is deleted (see Dirk, Aaron).

    Same thing happened to me.

    Did I not understand something in the hdiutil manual ?

    Comments please, thanks.

    George

  34. 6. Januar 2009, 19:26 | #34

    JusjongKull,
    In Step 2, you are looking for the disk ID of the USB drive on which your Backups reside at the moment.

  35. 6. Januar 2009, 19:31 | #35

    Hello George,
    Have you tried, to create the sparsebundle file somewhere else and to copy it to your SMB share afterwards?
    Also an alternative to try would be to create a NFS share on the windows machine.
    If you have any progress, we will surely be happy to hear from you. I personnaly can’t go into testing since I’m on the island right now.
    Regards

  36. George Kinal
    6. Januar 2009, 19:39 | #36

    Rolf,

    Thanks – have not tried this yet, namely to create the sparsebundle on the Mac itself, then copy it over. I also have other networked machines that have enough space for the sparsebundle.

    Regarding NFS: the WD Mybook NAS is not a Windows machine, but I believe the only shares it supports are SMB/CIFS (the embedded processor runs Linux, and some people have hacked it to provide greater flexibility).

    I will post any updated results – it seems that I have been getting the same bad results as many others with this approach.

    George

  37. Aaron
    17. Januar 2009, 17:59 | #37

    Hi,

    I have now got my network time machine backups working (yay! :D )

    http://www.kremalicious.com/2008/06/ubuntu-as-mac-file-server-and-time-machine-volume/

    This how to was also somewhat useful – although I did not use ubuntu, i have simply set up an AFP share on a FREENAS virtual machine at my file server. I just wanted to add a couple things to anybody having similar issues that I was…

    Firstly, creating the sparseimage directly on your file share does not work (god only knows why) – so you must create it locally and copy it over. The above link has info on how to create a blank sparseimage for starting fresh backups on your network share.

    Also, I changed the name of my mac when trying to get this working – before it was ‘Aaron Trout’s Mac Mini’ which I changed to ‘Aarons_Mac’ – shortly afterwards my backups started working – so if anyone is pulling their hair out wondering why on earth its not working for them – give this a go, although Im not entirely sure this is what did it for me even!

    Finally thanks to everyone who commented here – as all the info was useful on my quest to network time machine backups!

    Aaron

  38. 17. Januar 2009, 20:18 | #38

    Hi Rolf,

    Worked great! The last problem I have is that Time Machine doesn’t show past backups in the time machine browser on none of the macs that backup with time machine. I only see “today (now)”. That kinda sucks so does anybody have any suggestions that can help me solve the problem?

    Thanx very much!
    Daniel

  39. 27. Februar 2009, 13:00 | #39

    Gut!

  40. Anthony
    29. März 2009, 03:56 | #40

    Thanks for the article! I’m just running into a few problems, and was hoping someone could show me what I’d doing wrong. I’ve gotten all the way to creating the sparsebundle in Terminal, and that’s where I fell short. Instead of creating the sparsebundle within my external drive (which I call “The Stuff”), it created it on my local drive with the title “thestuff.sparsebundle. The article states that the process of creating it would take a while, so I waited and waited (almost three hours) until the system sent me an error that I was out of disk space. Apparently the sparsebundle was slowly growing and growing until it sucked all of my disk space. Obviously, I messed something up in telling it where to create the bundle, but I’m not sure what. I quite Terminal (as I thought that quitting it would stop the process that was sucking my disk space), but I distinctly remember telling it to create the bundle at /Volumes/The\ Stuff/. Any ideas or tips to make this work right?

    As a side note, I currently back up Time Machine from my PowerBook to a HFS+ formatted USB hard drive. I want to hook it up to my PowerMac G5 and wireless back up. Oh, and I’m not sure if anyone else has noticed, but TM now natively recognizes network volumes, because when I hooked the USB drive to the PowerMac and shared it with my PowerBook, the TM saw it, but because it wasn’t a sparsebundle it couldn’t back up to it.

    Thanks!

  41. 30. März 2009, 17:01 | #41

    Hello Anthony,
    It sounds like a typo somewhere to me. Just some ideas:
    Make sure you didn’t mix up source and destination drive. All spaces correct?
    To find the mistake, you can start creating the sparsebundle with the terminal and then immediately check where it is created with Finder. If it’s in the wrong location, you can cancel the creation process with CTRL+C. This way you can play around a little with the destination-path. For example, try if you can manage to create it on a different folder on your harddisk.
    Good luck!

  42. 15. April 2009, 00:35 | #42

    Thanks for the review!

  43. Tom Willis
    21. Mai 2010, 03:52 | #43

    Thankyou so much for posting this. Am creating the sparsebundle file at the moment and have high hopes. !t’s nice to see someone care enough not only to post a easy-to-follow solution (to what would otherwise be an impossible task for a newbie like me) but also provide feedback to those run into issues. You rock Rolf!

  44. aaron
    8. Oktober 2010, 17:03 | #44

    Ok I got my time machine backup done on my ubuntu machine, but when I tried to restore a file for testing, I could see all the files in time machine but it wouldn’t restore. This makes the whole idea useless. anything I possible could have missed?

  45. Alejandro
    17. Oktober 2010, 08:36 | #45

    @Daniel Peters
    I have the same problem. I coud set up the backup in the network drive but now the time machine only shows “today” but not all the past backups.
    Has anybody an idea in whicht direction to look for a solution?
    Tks!

  1. 18. August 2008, 04:24 | #1