The Butterfly Effect or why Time Machine is bound to FAIL
such that
Have you ever heard of the butterfly effect in regards to time travel? Well despite your best intentions to go back in time to remedy something about your current situation you are usually doomed to failure because of butterflies.
So I will officially declare butterflies as the cause of my recent spat of Time Machine backup failures. I’m destined to live in the present because the many months of successful Time Machine backups to my Synology have recently been tossed because Time Machine isn’t happy with butterflies.
Here’s the dreaded Time Machine FAIL message:
“Time Machine completed a verification of your backups. To improve reliability, Time Machine must create a new backup for you.” It goes on to say, “Click Start New Backup to create a new backup. This will remove your existing backup history. This could take several hours.”
So it is on that note that I have decided that we need 2 backup methods to our NAS. I’ll still try to troubleshoot Time Machine, but the incessant write, toss and rewrite for the last 3 weeks (it takes several days to completely do a backup) is going to eventually wear out the drives!
What to use for backups? I decided I need industrial strength, proven and reliable backup solutions that the big enterprise folks use. Turns out it is free and already installed on both Synology and my Mac!
If your goal is to simply have a backup boot drive then you may want to look at Carbon Copy Cloner (free/donation) which uses rsync under the hood, but is a clean UI driven design for making bootable backups of your Mac.
What is rsync? It is from the Unix open source code world and was an improvement over rcp (remote copy). rsync introduced the idea of only copying the files that have changed, so future backups only copy the changed files. rsync however does not easily archive multiple versions of a file like Time Machine does, or do them automatically. I’ve seen some scripts for doing this, but it is over my head for now.
Well if you want to read the early gruesome history on the Mac you can read it here. That said I think many of the issues have been resolved and it has been faster and more reliable than Time Machine for making sure my irreplaceable home movies and photos are backed up efficiently.
This post includes both the setup you need to do on the Synology side, and the Terminal actions you need to do on the Mac OS X side to initiate a rsync backup.
Setting up Synology to support rsync
Step 1: Log into the web interface of your Synology NAS.
You can use your Synology Assistant in your Mac’s Utilities folder if you are having problems connecting. Once logged into your Disk Station manager via the web interface you can choose the 3 block icon in the upper left corner and access control panel.
Step 2: Go to your control panel and choose “Network Backup”
Step 4 – Check the option to “Enable network backup service”
Do not turn on customized rsync configuration unless you are comfortable logging into your Synology via Telnet or SSH. See Synology’s DSM help on network backup for more details to do advanced rsync features.
Do not use the other 2 tabs: Shared Folder Sync (used for keeping 2 Synology Disk Stations in sync) or Synology’s Time Backup (not to be confused with Apple’s Time Machine). If someone is using Synology’s graphical Time Backup please feel free to comment. For now I’ve only explored Apple Time Machine and rsync backups of my Macs to my Synology Disk Station NAS.
Click Apply and close the control panel.
Step 5: Create a folder location for your Mac’s rsync backups.
From DSM 4’s desktop choose the 3 block icon in the upper left corner and open File Station.
Step 6: Create a new shared folder
Navigate to the volume and folder location you want your rsync backups to occur and choose the “create” button and select “Create New Shared Folder.”
Step 7: Fill in your shared folder’s details
The name of your folder can’t contain spaces.
Do not use encryption unless the data is super sensitive. Encryption slows down backups and if you lose you key you can’t restore your data.
Step 8: Setup which users can access your new rsync folder.
Use the add button to add users. It is a good idea to give different accounts to different computers. That way you can track which specific macs are access the server (unlike if you use 1 master account for all computers) in the Synology access logs.
Once you click ok your shared folder will be setup and ready to access from your Mac’s finder.
Step 9 – Add Mac File Services so your Mac can access
If you’ve already setup Time Machine to sync with your Synology then you’ve already done this step. If you can’t access your Synology NAS from the Mac finder then you need to add Mac File Services.
Go to DSM 4’s control panel and select “Win/Mac/NFS”
Click the apply button
Step 10 – Check to see if your Mac can access your rsync folder
Verify you can see the rsync folder on your Synology from the Mac’s Finder.
From the finder look for your Synology Disk Station listed in the left hand side bar. Login with your user account info and verify you can read and write to your rsync backups folder.
When I tried to login and create a new folder in my rsync folder I got the error message: “The operation can’t be completed. An unexpected error occurred (error code -8058)” If anyone can streamline these steps let me know and I’ll update them.
In the screenshot above I came to find out that servers listed in the Finder as Shared would not always work well. The Devices section was much more reliable (just click your user name to expand the list of connected servers).
If you are still struggling I did find that there are 10 ways to mount a server in this article that might be helpful.
If you run into this, then you should make sure your Synology is mounted correctly. I was able to mount the folder correctly by using the Finder to connect to the server. Here are the steps.
- Go to your Mac Finder
- From the Finder’s Menu Bar choose “Go” > “Connect to Server” or use the keyboard shortcut ⌘K
- Find the IP address for your Synology NAS unit. You can use the recent or browse button or get the IP address from Synology assistant, or URL in web browser.
- Type in the server address as: “afp://” followed by the IP address (in my case afp://10.0.1.17)
- It should now show up in your Finder’s sidebar under devices.
- You can also turn on desktop icons for servers by going to Finder, choosing “Finder” in the menu bar and choosing “Finder Preferences.” In the general tab choose to show connected servers on the desktop.
Steps to backup your Mac to your Synology using rsync:
Step 1: Launch Mac OS X Terminal Window
Go to your Utilities folder on your Mac and choose Terminal.
Using the Terminal on the Mac is a lot like DOS for Windows users. It may feel archaic or even intimidating, but don’t let that stop you from discovering one of the best built in backup tools that Macs and Synology Disk Stations have built in for handling backups.
Step 2: Type: “rsync -av “
Make sure you have a space after the -av . It should read, “rsync -av ” (without the quotes, but with the space).
DO NOT HIT RETURN YET. If you do you will get a screenful of text explaining how to use rsync and you’ll have to retype step 2.
details: rsync -v tells rsync to show each item as it copies in verbose mode, rsync-a tells your mac that we want to archive the following content path (step 4) to the destination path (step 6) while preserving time/date info and folder permissions. Together this makes rsync -av Now we just need to add what we want copied, and where.
The Terminal allows command line control over your mac. rsync is a built in utility that allows blazingly fast file transfers. It is the standard in the UNIX world for transferring data. The rsync command we are using is broken up into these 3 items: rsync [options] [target]
Step 3: Open your Mac’s Finder window that shows the volume or folder of what you want to back up.
For now try a simple test of a folder full of sample files. Later on it could be an entire disk drive.
Step 4: Drag the icon of the source volume or folder into the terminal window
Wait for a green circle + icon to show next to your mouse cursor and drop into the terminal window at the end of your rsync -av . You should see the path name to your contents show in the terminal window appended to rsync -av
In my case it displays as: Stephen-Inoues-Mac-Pro:~ MacProHome$ rsync -av /Volumes/Media/Photos\ and\ Video
Step 5: Connect to the Synology shared folder you are doing the rsync to
Go to your Finder and from the Go menu choose Connect to Server and correctly mount the Synology shared folder you want to use.
Log onto your Synology NAS and bring the finder view of the location you want to back up to. If you can’t see your backup volume you may need to follow the steps in my setting up Time Machine with Synology to configure it correctly.
Step 6: Drag the icon of the destination into the terminal window
Goto the Mac OS X Finder and from your Finder’s sidebar look for your Devices and see if your user name has access to the Synology NAS. Do not try to drag the Synology NAS from the list of shared items in the sidebar as that did not work for dropping a path name (no green circle with a plus).
You should get the same green circle with a plus icon in it when you go to drop the destination Synology folder into the Mac OS X Terminal window.
If you didn’t get the green circle with a + icon when you went to drop your dragged item then your Mac isn’t seeing the path to the server correctly. You can manually type the path, or make sure you are dragging the server from the desktop or the finder’s device section (not the finder’s shared section like in my screenshots).
My rsync backup of photos and videos now has this text: Stephen-Inoues-Mac-Pro:~ MacProHome$ rsync -av /Volumes/Media/Photos\ and\ Video /Volumes/rsync_backups
Step 7 – Hit RETURN in the Terminal Window
This is the fun part. Hit the return key and watch rsync in action.
FAIL?
You might get a few fails at first. Syntax is everything. Watch for spaces, / is a path, \ is a space.
Try a simple local copy of a single folder of items on your Mac’s desktop (source) to a new empty folder on your desktop (destination). If you get this working then try again with your Mac and Synology.
I have not figured out how to copy entire volumes without getting permission errors. I’m sure it can be done, but for now I live with my fail and just rsync folders.
Key things to remember:
rsync with the -a(archive) is CRITICAL to preserving your time/date stamp in your files, photos, etc. If you don’t do this your backed up files will show a modified date of today instead of their original date (a really big deal if you discover this after the fact).
I’m not a rsync expert, but have turned to it because it I needed a safe, fast and reliable method for backing up important documents, photos and videos that Time Machine was not reliably doing. If you have useful insights on how you use rsync to back up your Macs to your Synology NAS please share in the comments.
Doing a restore of a rsync backup was simply reversing the source and destination in the command line. I wouldn’t do this for the boot disc (use carbon copy cloner instead) but for photos, videos and important documents it has worked well for me.
Some Useful Links I came across in researching rsync:
Simon
June 28, 2012
You’re not alone. I had this problem on three different Synology boxes, in three different wired networks on at least five macs.
This seems to be related to a bug in netatalk, which got fixed in the latest version 2.2.3:
“UPD: afpd: Changed behaviour for TimeMachine volumes in case there’s a problem talking to the CNID daemons. Previously the volume was flagged read-only and an AFP message was sent to the client. As this might result in TimeMachine assuming the backup sparse bundle is damaged, we now just switch the CNID database to an in-memory tdb without the additional stuff.”
http://netatalk.sourceforge.net/2.2/ReleaseNotes2.2.3.html
I reported this issue to Synology a few days ago and they promised to look into the problem and implement 2.2.3 eventually.
Rsync is great but not really user friendly when restoring single files.
macsynology
June 28, 2012
Simon – Thanks for the detailed reason why butterflies are getting in the way of Time Machine. It was great you let Synology know about the fix. Let’s hope they can take roll in this update quickly because it is affecting a lot of us!
Simon
July 16, 2012
It looks like the latest 4.1 beta includes the fix to netatalk v2.2.3. Haven’t tested it yet but looks promising.
Adam
July 12, 2012
The beta of DSM 4.1 (available at http://www.synology.com/support/beta_program.php) has been upgraded to netatalk 2.2.3! Hopefully this fixes (or at least helps alleviate) this problem.
ray
June 29, 2012
As described this solution needs to be manually kicked off every time you want to do a backup. I suspect there are macro solutions to execute the Terminal commands which can be scheduled, but unfortunately that is a little beyond my experience level. Could you expand on this particular segment to get us to a behind the scenes scheduled backup that we only need to setup once and not worry about.
One more question/point, you didn’t mention if rsync does any cleanup. If we were to limit its diskspace via a dedicated volume is rsync smart enough to clean up the old to make room for the new or is that another manual task for the user to do?
Thanks for everything on the site and thanks in advance for your further help here.
macsynology
July 6, 2012
Hi Ray,
You are correct. The rsync how to is strictly manual. I use it to make sure I have backups of my photos in case Time Machine fails. Rsync does a great job of only updating the files that have changed. Subsequent rsyncs are very fast because only the new and updated files are copied over. It is important to remember that rsync doesn’t have a native concept of going back in time to multiple versions of a document like Time Machine does.
Using a dedicated volume or quota to limit a backup means that you would get an out of disk space message rather than any fancy deletion of older versions of the files like Time Machine does (probably the coolest feature of why Time Machine goes further than rsync in managing this for users).
As for scheduling… It is commonly used in the unix world and I have seen some tools for automating this on the Mac. Crontab is a built in utility accessible in Mac OS X terminal that allows you to schedule tasks like rsync. I’ve never used it, but it seems pretty standard in the Unix world to use this so this might be what you are looking for. http://www.macgasm.net/2011/03/15/terminal-tip-scheduling-rsync-backup-ssh-cron-job/
If you venture down this path of scheduling rsyncs let us know what you find!
Jeffrey Friedl
August 9, 2012
One word of caution with scheduled rsyncs (via cron or whatnot): make sure that you pick a large enough interval to avoid ever having two running at the same time…. you could end up with a bazillion rsyncs piled on top of each other. I’ve seen this happen and it’s not a pretty sight.
And on a side note, Stephen, it sounds like you’ve got backups of your photos well covered… on your main computer, and on the NAS in two different ways…. you’re well covered so long as there’s not a power spike or earthquake or house fire or thief that takes them all from you in one fell swoop. )-:
There are bunches of web-based backup solutions to consider.
CrashPlan is one I’m giving a try, and it can maintain backups to the NAS and to the web at the same time (as well as backups to another computer, or a friend’s computer across the globe if you have such generous friends). Price seems reasonable (~US$6/month for unlimited storage, if you pay in a four-year chunk, though I’m still on the free trial so my experience and investment are minimal at this point). FWIW.
[I don’t have any relationship with CrashPlan other than what I mentioned, but if the last paragraph feels too spammy, please feel free to remove it before you approve the comment.]
macsynology
October 26, 2012
Good advice! Thank you. Thanks for the tip on crashplan. It is a smart way to deal with natural disasters and theft. I also recommend buying an inexpensive external hard drive, backing up critical files (Mac File Vault 2 encryption) and then dropping off the drive at my sister’s house for safekeeping. Not as sexy as online backups, but no monthly fees! I’ve been using Phanfare for photo backups. Everpix just announced unlimited photobackup for $40 a year, but I haven’t seen a reliable restore from it yet.
Thanks for the tips!
Laurie Lewis
July 19, 2012
Hi guys, I have not had the Timemachine problems you talk of but I must admit I have never tested tha backups and I am not even sure how to do it. What I did was to create a directory on the NAS called timemachine, then created a user called Time. I then gave time sole access to the directory and limited the disk space available to Time. On my desktop machine I then configured timemachine to use Time as the user rather than me so as to limit the amount of disk space that could be used. In this way I could create multiple users (Time2 etc) to access the directory but limit their space for wife, daughter etc. I have never received any error messages from timemachine but perhaps I may have given the user too much space. Surely running out of space should not cause an issue such as you describe because you can obviously run out of space on a time capsule.
I have a program called Hazel sync my HomeDir on the desktop mac to my Home directory on the Synology. In effect duplicating my backup of my own data.
Last but probably the most important I have grabbed an old Synology NAS and have it on scheduled turn on using rysnc with cron jobs to connect to main NAS backup the files and then turn off. Found this more reliable than the built in features and you could also customise it more. Monday for music, tuesday for movies, important data daily etc etc etc. I even have it go and download some data from a remote server daily. I actually found this NAS does not have to have a ton of grunt, just enough storage. You could even use a couple of old single or dual drive ones with the schedule feature.
If you have enough disk space you could create a script that does a series of backups daily, weekly monthly over 3 months but it would take up a heap of space potentially.
I know how to create a script file in crontab on the Synology unit and I would image that you could do the same on the Mac or something fairly similar with automator (yet to look at it) to do those things for you.
macsynology
July 28, 2012
Very cool setup. I had never thought of doing different kinds of content on different days, but it would make troubleshooting a lot easier than one huge massive backup of everything and then left scratching your head as to the culprit when it fails.
I’ve been troubleshooting my Time Machine issues and think some of it is from corrupted files on the source drive. Time Machine ends up choking on it and getting blamed. I did an Apple Disk Utility verify disk on the drive I was backing up only to find issues.
I’m really basic with rsync scripts, but your scripting Synology in crontab with a different backup task each day is very cool. CronniX on the Mac had a GUI that might do the trick for less technical folks like myself who get the concept, but flub it on the syntax!
Thanks for the good info.
Alessio
August 30, 2012
In order to solve the Time Machine problem you mentioned, I’ve found this solution:
http://www.garth.org/archives/2011,08,27,169,fix-time-machine-sparsebundle-nas-based-backup-errors.html
Have you tested it yourself?
Cheers,
Alessio
Wavell
September 1, 2012
I also experienced the dreaded Time Machine “verification” message four times within the last 4 months with my new Synology DS212J. Each time, I had to start over creating a new backup (taking up to 2 days each time). After posting this issue to the Synology community site, I discovered that it is a widespread problem going back to 2010 and DSM 3.0 with no official response yet.
However, working with Synology technical support reviewing my debug logs, I discovered that it is not a Synology problem per se but it is linked to two things – slow wireless backup (unfortunately no choice with an ethernet-less MacBook Air) and OSX sleep settings. The combination of these two things apparently causes an interruption of the hourly backups, leading to verification and new backups.
My workaround to this – working successfully for a couple of weeks so far – is to (1) uncheck the “put hard disks to the sleep” in Energy Saver within System Preferences for OSX; (2) turn off Time Machine; (3) download and install the freeware TimeMachineEditor and set up its Calendar intervals for two or more backup times at specific times daily. As I schedule the computer to shut down at 9pm and start up at 7am, the TimeMachineEditor intervals are well within those times. So far, working like a charm for me. May be an option for you until Synology can figure out a more permanent solution for those who wants the original Time Machine hourly backups.
Thmartie
October 13, 2012
Hello, I have a thought that may help with some who are using a MacBook. Looking at the post above, perhaps my experience aligns well. I’m going to look into Wavell’s suggested workaround but below is where I’ve arrived so far.
I believe that Time Machine backup over wi-fi isn’t officially supported although with Apple’s own Time Capsule, it is. I’ve disabled Time Machine backups for my MacBook Pro while operating on battery power. When I have my MacBook plugged in, I leave the cover open and that’s relatively easy for all my family to remember.
It’s hard to get my family to look at whether Time Machine is backing up before closing the lid while operating on battery power. I’ve changed the power settings so that the MacBook keeps running and doesn’t go to sleep while charging. I think that perhaps that closing the lid while a backup is going may cause some problems with the wi-fi connection. The result of this change is fewer backups, of course but knowing that I generally charge it everyday, it accomplishes what I think is needed.
This is a recent change, so I don’t have results to offer that shows this is effective. The fact that there’s a large change in the number of backups means that if it occurs, it’ll likely take longer for me to discover it. I’ll watch it over the next couple months.
From a key learning perspective, I have also had the Connection Failed problem where, in Finder, it’s difficult after an initial connection to the Synology to maintain the connection. This one has been more frustrating for me, as when Time Machine has encountered a bad backup, it’s easy to just get it going again (I plug into Ethernet at this point and turn wi-fi off to speed it up).
Through painful troubleshooting, I finally changed the network name of the NAS from Synology to Synology2 and noticed that the icon beside the name in Finder changed to what looks to be a server icon rather than what I recall being a computer icon (?). I remember the server icon from the early days but can’t remember when it may have changed to a different icon. Anyway, that change was the key to having consistent connections in Finder. I’ll watch for this again and perhaps something went amiss in terms of the networking. But for a couple weeks now, the connection is solid. I changed the name back to Synology so my Time Machine backups would continue to work with their existing setup.
On another key learning topic (this one backup related), I’ve been using the Time Backup feature to back up to a USB drive (this is Synology’s Time Machine-esque interface). I’ve had it with using the default settings of hourly backups – it slows my 212j down too much, so I’ve moved it to once a day at 12:00am. Considering that my data doesn’t change on my NAS that much, I think this is sufficient. In terms of general usability, I’m more satisfied with where my Synology experience is. Now I just need to solve my issue with my iPhoto library storage and Picasa, and workflows – but that’s a different topic.