| « NAS: The downfall of desktop-class harddrives | OS X: Garmin Bobcat - latest beta released » |
OS X: Time Machine backup to Synology DS107+
Gadgets, MacBook / OS X, Synology, Hot Stuff Add commentsI finally got the single-bay, 1TB NAS:

It took a few hours to "make" OS X TimeMachine to accept the NAS and perform backups - the steps below will outline what is necessary.
Update 2009-05-14: With 10.5.7 Apple seems to have broken the sparse-band-size, resulting in the current sparsebundle to be unmountable. Apple has reduced the band-sizes of sparse-bundles to 128MB. You can convert your existing sparsebundle via the following command: hdiutil convert -format UDSB -imagekey sparse-band-size=262144 -o new.sparsebundle old.sparsebundle
Update 2009-02-11: I have received a number of reports that large sparse-bundles (in excess of 250 gigabytes) fail to backup properly. User joar on the Synology forum has the explanation for this: "Those sparsebundle images that Time Machine uses work like this: They basically consist of a few files and one folder with all the payload files (called "bands") in it. If the images are created automatically by Time Machine, the size of each "band" file is set to 8MB. If your backup is > 300GB you can do the math. Remember what I wrote? One folder with all the bands."
To solve this problem instead of creating 8MB bands we will create 128MB bands (262144 times 512 bytes). You are able to convert your existing sparse-bundles via (change the max-size from 70GB to whatever suits you):
hdiutil convert -format UDSB -tgtimagekey sparse-band-size=262144 -tgtimagekey size=70g -o tempfilename.sparsebundle machinename_macid.sparsebundle
I tried the conversion of the above and it took extremely long - I eventually wiped my old backups and started from fresh. You will notice as part of this exercise that your original sparse-bundle image will be larger (in my case increasing the band-size increased the initial sparsebundle from 80MB to 1.5 gigabytes)
The installation was straight forward, but you should consider a number of steps:
Follow up:
- To be absolutely sure, prepare/initialise your new hard-drive first. As I do not have a PC, I had to get a eSata (Vantec NexStar 3) enclosure, so that I could hook up the harddrive to my MacBook Air. Once the drive is connected via USB, OS X will prompt to initialise the drive and the preparation is complete.
- After fitting the drive back into the DS107+ case, power up the device and follow the setup-assistant. I assigned a static IP-address and named the NAS MuffinStation (well, my laptop is called MacMuffin - so there)
- Disable Time Machine in your System Preferences
- Open up a terminal session and enable NAS support for Time Machine:
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1 - Time Machine saves backups in a very specific format, and we will use a sparsebundle to get this done. The sparsebundle name consists of
your computer name_mac address.sparsebundle. In my case the sparsebundle is namedMagicDudeAir_001ec4b8f9b3.sparsebundle - Find the MAC address of the machine’s internal Ethernet port with
ifconfig en0 | grep ether | sed s/://g | sed s/ether//in Terminal. This will return one line of output, which is the MAC address for the Ethernet port, which will be a string of letters and numbers, for example, 00:1e:c4:b8:f9:b3. Even if the network backups will be done using a different port (e.g. AirPort: usually en1), the system will use the MAC address of en0 as part of the system identifier. Make a new “sparsebundle” on a local disk (NOT the Time Machine disk!). This sparsebundle is a virtual filesystem image which we’ll copy to the NAS, and Time Machine will then access it remotely (that way Time Machine’s not limited by the filesystem features of whatever NAS it’s using: all the funky stuff happens within the sparsebundle). By default sparsebundles can keep growing until they fill up the NAS, but in this scenario we keep other things on the NAS as well as backups, and we’re going to limit the sparsebundle size to 70 GB.
I could torture you now through Disk Utility, but there is an easier way via the command line:
sudo hdiutil create -size 70g -type SPARSEBUNDLE -nospotlight -volname "Backup of Gerd's MacBook Air" -fs "Case-sensitive Journaled HFS+" -verbose ./MagicDudeAir_001ec4b8f9b3.sparsebundle. This will create a 70GB sparse-bundle as a case-sensitive, journaled HFS+ without spotlight indexing. If your backups are large than 250 gigabytes, I suggest to use this command instead:sudo hdiutil create -size 70g -type SPARSEBUNDLE -nospotlight -volname "Backup of Gerd's MacBook Air" -fs "Case-sensitive Journaled HFS+" -imagekey sparse-band-size=262144 -verbose ./MagicDudeAir_001ec4b8f9b3.sparsebundleLog into your Synology Disk-Station and create a Shared Folder. I named mine "TimeMachine":
(Don't make the Shared folder hidden yet)
Create a user - I named mine "TimeMachine" and give the user R+W privileges. I also assigned my user a quota of 80GB (since this is the maximum hard-drive size on my MacBook Air):

- Optional: In another post I will show you how the Synology can broadcast your services via Bonjour, so that they immediately appear in the Finder. This is cool, since you do not have to mount your shares, but requires that your iTunes server is running on the disk-station.
- In Finder, select Go>Connect to Server. For the server address, type smb://timemachine@ip-address-of-nas/timemachine. Click Connect and when prompted, enter the password and save in your keychain. It is important that you give your NAS a static IP, or use the Bonjour tip instead. Although some people prefer to mount via AFP, I chose SMB instead. I initially tried AFP and during the backup noticed the errors "
Jul 15 12:37:09 afpd[7471]: bad function 4F" being logged on the DS107+. This did not give me a high level of comfort. There seems to be no speed difference either. Through the wireless-network (G/N) I get about 6MB/sec throughput. I did find however that changing from TKIP to AES wireless-security seems to have improved the speed by 20% - Now copy your locally created sparsebundle into the timemachine share.
- Delete the sparse-bundle on your local machine.
Go back to the DS107+ diskstation and verify that your quota usage has increased. My empty sparsebundle used up initially 80MB, the screenshot below shows you the quota usage:
(if your quota is still at 0, then you have logged in with the incorrect user or did not follow the instructions properly)
Almost there: Open up TimeMachine, select your "timemachine"-folder and the backup will start:

- For the first backup it is recommended to connect via LAN, as you will be able to get a throughput of 10-30MB/sec.
- Go back into DiskStation and hide the Shared Folder "timemachine"
If you ever need to restore your machine through the installation disk, open up Terminal once the DVD is booted and do the following:
$ mkdir /Volumes/TimeMachine
$ mount -t afp afp://TimeMachineUser:TimeMachinePwd@172.16.0.97/TimeMachineBackup /Volumes/TimeMachine
The above will mount the TimeMachine volume and once you return to the installation-manager will you be able to restore from the back.

The only "problem" I ran into, was the mixture of uppercase and lowercase characters in the name of the share and the user on the DS. I kept getting "unable to mount volume" messages, but once I changed both the sharename and username to lowercase only, everything worked perfectly. I'm not sure if the characters were acually the show-stoppers, but at least it seemed to be.
The initial backup took about 3 to 4 hours on a wireless connection. I'm now awaiting the second backup to see if everthing keeps working. Keep your fingers crossed ;-)
Best regards,
Thanks!
The steps you described here are absolutely suitable for
DS207+.
P.S.
To enable the support of network disks in Time Machine
I used the following application:
http://antonellomigliorelli.googlepages.com/tm
ifconfig en0 | grep ether | sed s/://g | sed s/ether//
Also, be clear about how to get the machine's name - `hostname` might return a fully qualified name different to the machine's own name.
(Please let me know the answer to that last point!!)
networksetup -getcomputername
Thanks to http://lists.apple.com/archives/macos-x-server/2004/Oct/msg00879.html
However, http://support.apple.com/kb/TS1760 says you have to take out certain characters from your computer name, including ' - this being a default...
- do you have to repeat this for every account on the macbook?
- can you still have normal activities (shared folders etc.) using your regular user name?
PS. I am also trying to get NFS wowrking on the Synology, could timemachine also work with NFS?
However: after sleep/standby or when logging out all users while a backup is in progress the backup fails and TM will not be able to connect to the backup volume anymore, a reboot is necessary
Is there a workaround this?
My problem: after my first few backups, it fails stating "The backup disk image could not be mounted." I am able to access the volume without problems in the finder.
Any ideas?
"The backup disk image could not be mounted."
and I am curious about (.10) autom-ounting? Probably my error is resolved than as well?
Peter.
I too am getting the "unable to mount disk error" but I actually want to use an external USB hard disk connected to the synology as my Time Machine backup.
The synology sees the disk and automatically names it "usbshare1", and I can access it via Finder however my probelm is that you can't seem to assign user quotas to external disks.
Can this be done?
Thanks again!
Can this be done?
I can also read and restore from this backup, however, subsequent incremental backups (over WLAN) don't seem to work and I get the "cannot mount disk image" error.
Could it be the MAC identifier i he file name being from en0 and i am trying to backup via en1???
Thanks for a very detailed instruction. I am new at mac - just ordered my new macbook.
I am going to use af NAS to backup with time machine.
I have one question regarding point 7 where you make the virtuale sparsebundle at 70 GB.
I was wondering, will this step you mention make a sparesfile of 70 GB from the right beginning? and there by taking up 70 GB of space on the NAS-server? Or should i understand this step as that the sparsebundle will keep growing but only up to 70 GB?
I am not interested in allocating 70 GB of NAS-space from the beginning, but willing to accept that it can use up to 70 GB as the file-folders i backup becomes bigger and bigger...
anyone that can help me with this issue?
samir
I´m stuck in nº12.
If I have to copy the .sparsebundle file ... where is it? How can I can copy it into the timemachine shared?
Thanks
Is the spasebundle a file? Where is located on my Mac to select it and then copy onto the share?
Thanks
I have one more question:
I modified the script to create a 250Gb sparsebundle, but have reconsidered and would like to allocate 400Gb of space to the TimeMachine backup.
Is it possible to change the size of the sparsebundle once you have started using it to backup to?
I have all my backups since I started using the NAS on the drive and can't start all over again.
Once again, thanks for your help on this.
I am having difficulties. if i leave the NAS, for go to work with my macbook and return, then TM will not connect to server.. or if it find it, then it return like that it could not open the folder.. what to do?
samir
The only solution seems to be to recopy the sparsebundle to the diskstation.
I am using SMB to mount the sparsebundle, possibly the AFP mount works better.
- Is your mount point AFP or SMB?
- Via which interface (LAN or WAN) did you initially create the sparsebundle?
- Via which interface does your backup fail?
- Are you able to manually mount the bundle?
I am puzzled by those incidents. It works on my 107+ rock-solid. I can stop backups half way through, shut down the DiskStation during backup, disconnect the network during backup and no corruption or mount issues.
Any thought on what I can do about this. Using the DS would be a great asset.
Thanks
---
09-01-11 15:15:27 /System/Library/CoreServices/backupd[3264] Mounted network destination using URL: smb://timemachine@ds/timemachine
09-01-11 15:15:27 /System/Library/CoreServices/backupd[3264] Backup destination mounted at path: /Volumes/timemachine
09-01-11 15:15:28 /System/Library/CoreServices/backupd[3264] Failed to mount disk image /Volumes/timemachine/._outsider.001ec200e58d.sparsebundle (DIHLDiskImageAttach returned: 107)
---
When bonjour is off, all correct work.
@Outsider - try to mount it via AFP - just replace smb:// with afp://
When I mount it through either smb or afp, the disc is there with a #recycle and the .sparsebundle file. Then when I go to the Time Machine and go for Choose Backup Disk, there is an empty window without any discs to choose from.
The IP address in the name is the one that I got from the terminal and the name is the one from the terminal as well... I use Mac OSX 10.5.6
And I have used the terminal and wrote "defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1". Is that wrong maybe?
Maybe some more information.
The volume shows up under "devices" and the info is
Kind: volume
Disk image: /Volumes/TimeMachine/Liesbeths-iMac_022329b1634.sparsebundle
Created: Sunday...
Format: Mac Os Extended (Case-sensitive, Journaled)
Capacity: 99.68 GB
Available: 64,99 GB
Used: 34,69 GB on disk.
Now this latter I do not understand. How can it have used almost 35 GB on the disk (I had set it to 100GB), I haven't been able to put anything in cause I cannot see it through the time machine.
Thanks for all your feedback.
Finally I got it working. The problem was in the name of the computer and therefore the file as well. Now the computer sees the mounted drive.
The problem of the free disk space on the mounted drive stays thought (a total of 100G is reduced to 65G free space..).
Any thoughts on that?
My system:
-Macbook Core 2 Duo 2 GHz, 2 GB ram
-Mac OsX Leopard 10.5.6 with all updates
- Synology DS 107 with WDC WD7500AACS-00ZJB0 (the greenline)
The first time machine backup I made via airport worked . However, incremential backups failed ("unable to mount backup device").
I noticed TM mounting a volume on my desktop (untitled) which is identical to the timemachine sparsebundle backup -> nothing new. The problem seems to be, after finishing the backup the volume is not unmounted - so the next backup fails. If I unmount the device the next backup will work.
How can I automatically unmount the device after each "time machine backup"?
Maybe someone with a similar problem can manually unmount the device so we are 100 % sure this is the cause.
Thank you very much...
iHauges:desktop shauge$ sudo hdiutil create -size 150g -type SPARSEBUNDLE -nospotlight -volname "Backup of Shauge MacBook" -fs ook"Case-sensitive Journaled HFS+" -verbose ./iHauges_002332d896da.sparsebundle
Initialiserer…
Opretter…
DIDiskImageCreatorProbe: interface 4, score -1000, CWOUDIFDiskImage
DIDiskImageCreatorProbe: interface 5, score -1000, CRawDiskImage
DIDiskImageCreatorProbe: interface 7, score -1000, CSparseDiskImage
DIDiskImageCreatorProbe: interface 8, score 1000, CSparseBundleDiskImage
DIDiskImageCreatorProbe: interface 9, score -1000, CCFPlugInDiskImage
DIDiskImageCreatorProbe: selecting CSparseBundleDiskImage
DIDiskImageCreateWithCFURL: CSparseBundleDiskImage
DIBackingStoreCreatorProbe: interface 0, score 100, CBSDBackingStore
DIBackingStoreCreatorProbe: interface 1, score 1000, CBundleBackingStore
DIBackingStoreCreatorProbe: interface 2, score 0, CRAMBackingStore
DIBackingStoreCreatorProbe: interface 3, score 100, CCarbonBackingStore
DIBackingStoreCreatorProbe: interface 5, score -100, CCURLBackingStore
DIBackingStoreCreatorProbe: selecting CBundleBackingStore
DIBackingStoreCreateWithCFURL: CBundleBackingStore
DIFileEncodingCreatorProbe: interface 2, score -1000, CEncryptedEncoding
DIFileEncodingCreatorProbe: nothing to select.
DIBackingStoreCreatorProbe: interface 0, score 100, CBSDBackingStore
DIBackingStoreCreatorProbe: interface 1, score -1000, CBundleBackingStore
DIBackingStoreCreatorProbe: interface 2, score 0, CRAMBackingStore
DIBackingStoreCreatorProbe: interface 3, score 100, CCarbonBackingStore
DIBackingStoreCreatorProbe: interface 5, score -100, CCURLBackingStore
DIBackingStoreCreatorProbe: selecting CBSDBackingStore
DIBackingStoreCreateWithCFURL: CBSDBackingStore
DIBackingStoreCreateWithCFURL: creator returned 0
DIBackingStoreCreateWithCFURL: creator returned 0
DIDiskImageCreateWithCFURL: creator returned 0
Afslutter...
DIHLDiskImageCreate() returned 22
hdiutil: create: returning 22
hdiutil: create failed - Ugyldigt argument
iHauges:desktop shauge$
in my opinion it should be:
sudo hdiutil create -size 150g -type SPARSEBUNDLE -nospotlight -volname "Backup of Shauge MacBook" -fs "Case-sensitive Journaled HFS+" -verbose ./iHauges_002332d896da.sparsebundle
Step 17 (remove the sparsebundle file from your local machine) should be done before doing the first TM backup. Otherwise the file will be backed up and waste a small amount of NAS space. So move step 17 to right after step 12: copy the newly-created sparsebundle over to the NAS volume, and then delete it from the local drive.
had trouble first time around with "unable to mount" error when using TM to back up directly to Synology. However, I was able to back up to an external drive connected via USB to Synology using same instructions (modifying destination to "usbshare1" with "timemachine" user. Now both my NAS and macbook are backed up to an external. Thanks for the instructions!
1. make separate shares for each MacBook on NAS
2. Use separate accounts for Backup logins.
Also to mention: I used in Step 7 the large file option, which seems to be unstable. I recreated this morning for the FIRST Laptop a spargeimage with standard size params, and he backs up a bit faster.
On a Linksys WRT54GL with Tomato, the DS108 makes "only" 2.8 mbit over air and 4.7 over wire. Is this normal?
OS X: Time Machine backup to Synology DS107+?great discovery..
By default I had Nutela's Macbook Pro as a computername, and in Terminal it would be nutelas-macbook-pro, made it nutelambpro et voila.
It works now.
"this backup is to big for the backup volume. for backup there is a need for 1095.1 GB, but there are only 69,6 GB"
but in fact my backup volume is totally empty, so i got 1,34 TB space. what's wrong here?
i used the second code for the terminal you wrote, because my backup will be 1,2 TB big. i set the timemachine user quota on synology to 1300 GB. i tried everything, please help.
thanks a lot,
FERDI
thank you for your very good blog. i got my TM up and running on my synology DS207+ by following your instructions.
however i have realized that i will soon run into the issue of the 70GB limit. Initially i did not think, that i woud need more than af 70 GB big sparesbundle file. But this is not the case.
So what are my options to increase the size of sparesbundle?
1. make a complete new sparesbundle file with a higher limit on the sparesbundle file. and then make a complete backup?
2. can i somehow change the limit without having to make a new backup...?
samir
TIA
One thing that has worked for me it to re-start the afp on the NAS (Synology 207+) on firmware 728 or greater.
YMMV
Merci beaucoup!!!!
So I read up this blog entry and created a new Sparsebundle file locally. My Quota for the TimeMachine space on the NAS is set at 800GB, so I adapted the sparsebundle file to be limited at 800GB ->
sudo hdiutil create -size 800g -type SPARSEBUNDLE -nospotlight -volname "Backup of MacBook Pro" -fs "Case-sensitive Journaled HFS+" -imagekey sparse-band-size=262144 -verbose ./MBPname_MACaddress.sparsebundle
I let the backup run overnight...and oh wonder!! it works!
I'm a happy person