This is a slightly shortened version of an article I already wrote in German which is my native language so please forgive me possible mistakes.
Mac OS X features in its newest release Leopard (Mac OS X 10.5.2 while I am writing this) an automatic backup solution called Time Machine. It automatically creates backups, takes care of everything and even incorporates a very stylish interface to find and recover old files.
Unfortunately Time Machine has some limitations. So far it only works with external hard disks that are connected directly to the Mac. Apple now provides a solution for network backups called Time Capsule. However, using already existing drives for backup would be desirable.
You can find guides to make Time Machine at least accept network shares as backup drives in the web. Using the command (all in one line)
defaults write com.apple.systempreferences
TMShowUnsupportedNetworkVolumes 1
in Terminal is sufficient. But this only results in accepting the share. At least in my case creating the first backup failed with the error:
Time Machine Error - The backup disk image could not be created.
Pretty dissatisfactory. We gonna need new solutions. In my investigation I often found the statement that Time Machine simply would accept self made disk images on the network share. It doesn’t.
It rather helps to investigate the failed backup attempt more precisely. You will notice that Time Machine tries to create a sparse bundle disk image on the share. It remains Time Machine’s mystery why that fails.
On Apple’s support forums you’ll find further advice. It is proposed to copy the bundle image while creation and to copy it back after this fails. Did not work for me. Anyway, the solution is much simpler. During the backup attempt Time Machine creates the bundle image on the share. This is called <computer’s name>_<string>.sparsebundle (Update: by the way, string is the MAC address of the local en0 device without colons). You should keep the exact name in mind (e.g. by copy & paste or by looking in Console or by constructing it yourself from computer’s name and MAC address).
Afterwards you start Disk Utility and create another “sparse bundle disk image” on your local drive. Volume Size should be the designated maximum size (see update 2) of the Time Machine backup (don’t be afraid, only by using the image it will increase in size). Further parameters: Volume Format - Mac OS Extended (Journaled); Partitions - No partition map.
After this use the exact name Time Machine assigned to its bundle image to rename your newly created image (if not already done while creating your own image). Finally you copy the image on the share and manually start a backup via menu bar.
Voilà. Afterwards Time Machine should start the tedious initial backup.
Update: Giving it a try I am positively surprised. After the successful initial backup Time Machine tries to create new backups every hour. And doing so it behaves very ideally. If the network share is not accessible (e.g. host is turned off) the backup simply will not be performed (and the user won’t be bugged with error messages). Nevertheless Time Machine continues to try to access it hourly. If the host comes online again new backups will be created. The needed share and disk image will be mounted automatically.
If you want to access Time Machine to recover files the automatic mounting will work as well. At first (in my case) the Spotlight index was broken. I don’t know why this happened, but I have created an article how to repair this index (currently only available in German).
On the network host which provides the share I have created a special backup user whose home directory contains the image. Fortunately, Time Machine has no problem if a user connects to shares on the host with his own user data.
Let’s face the drawbacks. Once a backup is created or Time Machine is launched the image will indeed be mounted but will not always be unmounted afterwards. Thus, users will have the image on their desktops. The connection to the share itself will also be kept established (but it is only visible by entering mount in Terminal).
Both isn’t necessarily bad if the share keeps being available. However, this does not have to be the case. If you want to disconnect image and share correctly from your Mac you’ll first have to unmount the image itself. Sometimes the system requires an admin password to do so. The share can only be unmounted by calling umount in Terminal. Supposably it will become problematic if the host is shut down while a connection is established or even a backup is in progress.
And of course bandwidth is a major drawback. If (as in my case) the Mac is a MacBook primarily using 802.11g WLAN and accessing the share on a Windows machine via SMB you surely should not expect too much from this solution.
Update 2: Things you should know about the maximum size of the image and the free space on the network share.
thank you for your blog - your advice helped me set up time machine on a NAS drive
John
Thanks for this information. Do you know if it is possible to do the first big (when it copies EVERYTHING) backup to a disk image on the same/local machine. And then afterwards copy the .sparsebundle over to the networked machine? I tried, but I could not get a local image to show up in the choice of where to backup.
By the way, this in the .sparsebundle name is the MAC address of the network adapter en0. If you go to “Network Utility” and use the Hardware Address without any colons for the “Network Interface (en0)”, this is the string that goes after the computer name. (These may be different names under the German localization, but the “en0″ should be the same.)
@n[ate]vw: I don’t know if that is possible, but I doubt it. At least it won’t work that easily. What could work: Make a backup on a locally attached drive (which will go into the drive itself and not into an image). After that move all files of the drive (including hidden files/folders like .com.apple.timemachine.supported or .Spotlight-V100) into a sparsebundle image (using mv in Terminal should cause no space problems as files are deleted right away after they are copied onto the image). Finally copy the image to the network host.
I don’t know if it works and I doubt it will save time. You’d have to do a lot of work and copy the data over the network anyway. In my opinion the most convenient solution would be to just create the first backup over Ethernet and be patient.
Regarding the MAC address. I knew that already but I just forgot to mention that while translating the article. This information has been added to the article.
This is great work!
I’m impressed and I’ve got to say, I’m not so easily impressed.
Got it down in first read and now backup is up and running.
Waiting for the finish.
Thanks Flokru! My first TimeMachine network backup is under way.
My setup is a Synology DiskStationDS107e NAS appliance - essentially a Linux server supporting afp. My Mac is an iMac G5, obviously with 10.5.2. I don’t currently have a cable from my Mac to my router (though obviously the NAS appliance is cabled), so I am going to try the performance over 802.11g. It is slow as you pointed out, a Samba share has proved even slower.
I would make one comment about your instructions. You say “Volume Size should be the designated maximum size of the Time Machine backup (don’t be afraid, only by using the image it will increase in size)”. I want to back up about 200GB eventually, but I only had about 30GB free local space. Disks Utility did not allow me to create an image bigger than my free local space, even though the image file is initially MUCH smaller - about 50MB! Do you have any idea how I could create a 200GB disk image file please?
@AndrewD: I’m pretty sure I was able to create an image even bigger than the actual size of the drive on which I created it (it is an 80 GB MacBook and the image is about max 100 GB big).
Any way, I tried to reproduce your problem and I got the same error. At least in my case the solution was extremely simple: Select “sparse bundle disk image” before choosing the maximum size. Hope this helps.
However, I don’t understand how you were able to do your first backup on the NAS if creating the image wasn’t possible.
Wow! Thanks for the quick response, and such a simple solution it didn’t even occur to me to try! I was able to create a disk image with a max size of 1TB, but which only takes up 300MB of space when empty. Mounting it just showed the free space on the drive. Whether this is a sensible strategy only time will tell, but Apple’s documentation says Time Machine will keep backups until your drive is full, and certainly the sparsebundle it tried to create got bigger than 300MB before failing.
To ease your confusion, I got my first backup started using a 30GB image, by excluding everything except my users folder. I’ve cancelled that and started again!
I was having this same issue using 10.5.2. I followed the directions except since you said to use the “same exact” name I removed the “.dmg” that came up after the sparseimage was created. This lead to the same errors I was having. Once I renamed it back to .dmg restarted and tried again it worked. It is backing up now and if it doesn’t work then I will let you know.
Thanks for the tip.
Works great with windows share, Excellent!
Thanks for the tip! Time machine worked perfectly using either an AFP or SMB share on my debian 4.0 linux server.
thanks for the info! I got it working using the instructions above, but have hit a problem. After a period of time (hours, and gigabytes of data), the connection shuts down. Airport says I’m connected, but I can’t connect to the internet or my network shares. Have to reset the Airport to get connected again, and then my backup is incomplete.
@Corey: That’s strange. This never happened to me. Though I have to admit that I made the first backup over Ethernet to save some time. I don’t know the reason for your problem, but if you ask me it sounds like a general network problem and not a Time Machine problem in particular (although actually I really can’t tell).
I have a complete backup but as you said before, “At first (in my case) the Spotlight index was broken.” you only have the instruction German, do you think you can translate it to ENGLISH for US, English speaking people.
Thanks and really appreciate you for your work.
I can do that, but I won’t be able to do so very soon. You can try if you understand Google’s attempt to automatically translate it (but I doubt it, Google Translate just does not work very well yet).
In short: After deleting .Spotlight-V100 on the drive/image via
run
(both in Terminal with root privileges or via sudo). Hope this helps for now.
Thanks.
But when I was done, the problem still persist. I don’t think that was the problem. I started Backing up Three days ago but whenever I enter Time Machine, it still show _Today, Now_ there is no way to go backwards in time — Just the now. How does that happen?
I tried the same, after the backup failed on a
Thecus N4100. I get the error message “function
not supported” when I try to create a sparse image.
I have the feeling it’s an ext3 filesystem on
the Thecus N4100 (tried a 200 char filename: no
problems). But since someone reports that he got
his mac backed up to his linux box, even that should
work!?!?
Any other tips? THANKS alot
-Michael
Thanks for this information. I am very curious if somebody already tried restoring data from this because that’s what we’re all doing it for.
Also, part of this solution (with the TMShowUnsupportedNetworkVolumes 1) is going around the net for a while. I was about to use it a while ago but then run into several issues from people saying that it’s OK until the drive fills up and Time Machine cannot delete the old backups (as it should). E.g. see:
http://discussions.apple.com/thread.jspa?messageID=5918065#5918065
Anybody tested this?
Thanks,
John.
using steps above — but when I went to backup backups failed and I got a console message saying that it couldn’t create cookie .{mac address of machine}, I connected to my linux box switched to the timemachine directory touched the .{macaddress} file and chmoded it to 777 (might be over kill). Backup is running happily now.
@EKYM: That’s strange. So you don’t see any previously made backups in Time Machine at all? In this case it is definitely no problem with the Spotlight index but rather a problem with Time Machine itself. In my case when the index was broken I could see old backups but I couldn’t use Spotlight in Time Machine. If I searched for a file that definitely existed in a previous backup Time Machine just did find it. If I chose the backup manually (because I knew where the file was) I could see and restore the file.
@Michael J: Did you create the sparse image on your local drive or on the network share?
@John M: I already restored several files with Time Machine over the network (although I have to admit that I only restored files I created only for the purpose of testing Time Machine). After repairing the Spotlight index even the search works perfectly.
It is too late for me (around midnight here) to understand the problem in the thread you mentioned completely (I will look into it later). I have not yet experienced any problems with free space. Regarding my logs post-backup thinning (i.e. Time Machine deleting old unneeded backups) does work and frees up space in the sparse image.
However, I agree with this (from your link):
Time Machine over network is better than no backup at all. However, you should always be aware that it is not officially supported. Anyway, even a Time Machine backup on an external drive does not fulfill requirements of a really secure backup solution.
@John M: I have read the support thread you mentioned and I think I do now understand the problem. However, it is a little sophisticated so I wrote a separate article about it.
Hi, I notice that Apple has an update available titled “Time Machine and Airport Updates” version 1.0. Does anyone have experience of installing this, and does it affect behaviour for those of us using Time Machine on a (non Time Capsule) network share?
I have installed it myself on our MacBook. Backups are still working. And it seems to me (I have not looked into this in detail) that Mac OS X is smarter in starting backups. After a longer period without backups I have noticed OS X starting a backup just after the network share became available (the hourly backup was scheduled for a later time). I don’t know whether this has anything to do with the update though.
So I got it working…you’re right that it’s more of a network problem than a TM one; I tried it with SuperDuper and had the same problem. What finally worked was to do the initial TM “dump” using a wired connection. Now it’s working fine wirelesly!
Solution with disk utility doesn’t work in principle. I have 200G Macintosh HD - one partition. When I try to create “New Image” it gives error “Unable to create resource busy”, suggestions?
when i create the sparse image on my desktop and then move it to the SMB volume, when time machine starts a backup, leopard creates a disk image, mounts it ansd starts the backup.
should that be happening ?
why is it creating a disk image on my desktop ?
Just one note: The MAC address mentioned is (always!) the ETHERNET MAC address! No matter if you’re backing up via the Airport…
I suffered a logic board failure on my iMac G5, so I needed to do a full restore - for real! You’ll be pleased to hear that Migration Assistant running on a new Intel iMac (7,1 hardware) successfully read the time machine image from the network. One thing held me up for a while: I needed to mount the sparsebundle image manually first, so that Migration Assistant could find it.
After that, it was a breeze. Only thing was, I had to restore my old account using a new username (migration assistant gives this option), as I’d already created a user with the same name. Minor problem though, compared to getting all my files, folders and settings back.
time-machine funktioniert nach Ihrer Anleitung, kommt aber jetzt (seit ich den Leopard 10.5.3 Update installierte) mit einem Fehler: “the backup disk image could not be mounted”. Ich benutze eine Lacie Ethernet Disk Mini (250GH). Gibt es einen guten Rat?
Fantastic post! After lots of trouble with “Disk image could not be created” problems, this has got my system working brilliantly. Thanks for your time in writing this.
Hallo Flokru! Thanks to you, I now have TM backups working to a linux/netatalk server.
Un grand Merci!
Hi!
Thanks for this hint! It helped me a lot!
For me it was interesting how to use this with my existing backups, so I wrote it down here: http://rolf.haynberg.de/?p=83
Regards
Thank you so much for your detailed solution. I have a mac book pro and a the same brand of NAS storage.
I tried it and it did not work from the first time. after long time investigation I found that the file created by time machine add “tmp” to the sparse bundle file name which does not work if you just use it. you have to remove the “tmp” from the file name and then it will work.
the original file name which I used (since this is the name used by time machine) and did not work:
computerName_macAdress_tmp.sparseBundle
when I removed the “tmp” part from the file name and then follow up the rest of the procedure, it worked perfectly. The working file name:
computerName_macAdress.sparseBundle
thanks again. The solution works perfectly now.
Lets make this easier for the not so technical as i followed the instruction with no joy, and after hours had to work it out myself.
I am connecting to an airport for the USB
1. Format the drive as fat32
2. Connect the hard drive to the airport, this creates a share folder
3. Now connect the hard drive to the laptop via the usb cable
4. Create a spars bundle in the shared folder with following settings
Save As Name: Someone’s MacBook Pro_************ where ************* is the mac address of the laptop
Volume Name: Someone’s MacBook Pro_************
Volume Size: 500Gb
Volume Format: Mac OS Extended Journaled
Encryption: None
Partitions: No Partition Map
Image Format: Spars Bundle Disk Image
5. Connect the hard drive back to the airport
6. Connect to the drive with with finder
7. Change Time Machines to point to the drive and backup and like magic this worked with no command line fudges
You may want to consider using LBackup.
Thanks so much for sharing this solution. It appears to be working beautifully so far. (38MB of 87GB copied).
Macbook Pro -> Windows XP Desktop computer with NTFS drive over wireless.
The only problem I had is that it took me all evening to finally stumble upon this post.
Thank you for sharing this! I wasn’t using the correct MAC address at first (as you indicated, make sure it’s the ‘en0′ MAC address), but after correcting this, it seems to be backing up to my DroboShare now.
Remember to select right image format in Disk Utility when creating empty image for Time Machine. If you create “reade/write disk image” it will take all that volume size from your network HD - and creating it will be damn slow.
Instead select “sparse bundle disk image”. It’s 0byte file (or if not 0, it’s very small anyway) and fills up with time.
And btw, it doesn’t matter how much you have space to create an empty disk image - you can change a capacity of the disk image by this way:
From the terminal : hdiutil resize -size xx{m or g} /PATH/TO/DISKIMAGE.dmg
xx= the size you want the image to be.
Use either M for MG or G for GB
i.e. hdiutil resize -size 25g ~/Desktop/mystuff.dmg
(It’s copy’n'paste from somewhere internet…)
In terminal you get your current folder position by typing “pwd”.
There is also small handy tool to make netshares time machine accessible with just one button click: http://www.xiotios.com/itimemachine.html
This thread certainly helped me get Time Machine working properly on my SMB connected external disk (connected to a XP machine), but thought I’d point out another trap that I resolved after some late night experimentation;
** This may be obvious to some smart people, but it caught me out !
Creating the initial .sparsebundle needs to take place on a file system which understands user and group ID’s properly.
I spent a bunch of time trying to figure out why Disk Utility kept failing when I was attempting to create the empty sparse bundle image across the network on my remotely connected drive.
The answer turned out to be that the NTFS formatted remote disk (attached to the Win XP machine I was talking to via SMB) was not returning the ‘right’ answers when Disk Utility was setting permissions within the bundle.
I finally figured out that I needed to create the initial sparsebundle file on my desktop, *then* move it across the network to the desired location. All made sense after thinking about it for a while, and works well.
In summary;
1/. Use Disk Manager to create a Sparse Bundle image of the desired size *on your desktop* (which, given it’s empty to start with, will be only a few dozen megabytes)
2/. Copy the resulting .sparsebundle file to the desired location on the network
3/. Enable Network Volumes in Time Machine from Terminal by running the “defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1″ command
4/. Switch on Time Machine and target the backups to the network location you copied the Sparse Bundle to in step 2
5/. Go play ball / drink coffee / get some sleep (not necessarily in that order)
Thanks again for creating this thread and all the helpful assistance. Share & enjoy!
Thank you for the hint. It help me very much!
A Million thanks to you! You saved me!
Yeeeehaaaaw - it works!
I read through that confusing thread on the apple-forums. People were suggesting to interrupt the initial “preparing” process, copying or moving the created sparsebundle out of place etc… I tried all of those suggestions, didnt work for me (guess I made a mistake).
However, using the described method from this blog works like a charme. Thanks for sharing!
Thank you very much for posting this. It helped me to use the network drive for the purpose I bought it.
Thanks again for this brilliant post.
Thanks man !
After hours of trial and error I discovered that I had to unmount the SMB share and the sparse volume in finder, then suddenly time machine started to backup properly.
Gosh, Apple isn’t making life simpler, why the heck did I switch??!
Has anyone had their Time Machine backups to an network attached disk stop working after installing Snow Leopard ?
It appears that Snow Leopard treats sparse bundle permissions differently to Leopard and we’re in trouble again !
Rew.AU:
I hadn’t had the time to try this with my new MBP before I upgraded, but no matter how closely I follow the steps it doesn’t work with Snow Leopard for me either. DAMN IT!
I have not gotten this to work in SL either. When I try to backup to a network share it creates an image named [computer name].tmp.sparsebundle instead of [computer name]_[MAC address].sparsebundle. I tried creating a disk image named [computer name].tmp.sparsebundle, but time machine simply overwrote it and gave me the good ol’ error 45.
When I tried to backup to the share containing [computer name].tmp.sparsebundle Time Machine told me it was “making backup disk available” (or something, I’m not using the English OSX). While it was doing that the [computer name].tmp.sparsebundle folder grew from 0 MB to about 600 MB, before Time Machine gave me error 45 and deleted the disk image from the share.
Meanwhile, the [computer name]_[MAC address].sparsebundle folder was left untouched.
If anyone has any hints or tips to get this to work I’d be very happy to hear them!
Also looking for a way to get this to work on Snow Leopard.
Meh, guess I’ll have to just copy the files I need then. >.<
I have the same problem in 10.6 Snow Leopard - I used the workaround in 10.5, but now get error 45 after some time creating machinename.tmp.sparsebundle. Also tried manually creating a sparsebundle without the .tmp, as I had noticed that 10.5 also initially created a .tmp then renamed, but this did not help.
Just found this set of Snow Leopard=specific instructions - have not yet tried them, but thought you might be interested… good luck! http://www.insanelymac.com/forum/index.php?showtopic=184462
Has anyone got the Snow Leopard instructions to work?
No idea where i’m going worng
I’ve followed the procedure described here http://www.readynas.com/?p=253 and it works on my SL machines. Of course, I just have a network share drive, actually mounted through the Fonera 2n router. So now, my time machines run through 79Eur router on 90Eur USB disk. What a save compared to 500Eur time capsule
This seems to be working on a DNS-323 with a iMacG5. THANK YOU SO MUCH!!!
Thanks, this has worked a treat for me.
If anyone cares to know, this is using a Thecus N2200 NAS.
Please make it clear that these directions do not work for Snow Leopard and refer people to the above noted website, http://www.insanelymac.com/forum/index.php?showtopic=184462&st=0
However to save anyone else some time the Snow-leopard solution is simple;
with the file name TimeMachine attempts to create, use the above directions to create the sparsebundle
THEN create a file entitled “com.apple.TimeMachine.MachineID.plist” with the following text with the exception of this line
139A6879-CDA9-5721-A1BE-18EF49xxxxxxx which should reflect the UUID of your computer as per System Profiler:
com.apple.backupd.HostUUID
139A6879-CDA9-5721-A1BE-18EF49xxxxxxx
That’s It. OSX 10.6 fixed again.
Good luck,
Will
Regarding last comment please visit the website for more information because this site did not post my text correctly.
Will
Worked for me on snow leopard. I had to manually create the filename string. When time machine was trying and failing, it just kepy using “tmp” for the MAC portion. I also had to recreate the image once. The first time I did not choose sparse bundle form the drop down while creating it.