Sunday, July 4, 2010

Time Machine Wireless backup using your own network drive

Last Friday My Macbook is broken again, this is the third time since this year, I don't know why I am so unlucky and I love my macbook so much! I really worried about my hard drive because the computer could not recognize the hard drive, and I never backup my hard drive data before! Finally the issue was resolved in the Apple Store, the problem is in the harddrive cable.
This time it gave me a lesson: I need to backup my hard drive ASAP.
But when I started to use the time machine for the first time, I got stuck: the Time Machine requires the Time Capusle and Apple airport, while I want to backup into my own NAS drive. To solve this issue, I spent  almost half a day on google and trying out back and forth. Finally I made it, I can use time machine to backup my harddrive into my own network drive.
Here I would like to share my experience about how I solve it. Basically I referred this blog, it is so great, I could not able to finish it without this article.

The Goal
Backup my mac hard drive into my own NAS via wireless network.

Environment
Computer: MacBook Pro
OS: Snow Leopard
Wireless Router: Netgear WNDR3700
Network drive: West Digit MyBook Essential

Steps
1. Setup network drive, create a network shared folder for time machine. For example, I called the folder "\mac".
2. Connect the NAS storage, for example in my netgeare wireless network, I type following in Finder:
    smb://readyshare/mac
3. Enable time machine to use your network drive, run following command in the terminal:

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

4. Find out your computer name and Ethernet ID.
   To get the computer name, go to "System Preferences" - "Sharing" , then you will see the computer name at the top, and you can change to any name without restarting the mac computer.
   For example, my computer name is: steve_zhang_mac.  The name contains space and other special characters should be fine, but I prefer to make it simple.
   For the Ether ID, go to "System Preferences" - "Network" - "Ethernet" - "Advanced" - "Ethernet". The ethernet ID in my computer is: d4:9a:20:04:65:34
   Or you can try to type following command in the terminal:
      ifconfig en0 | grep ether | sed s/://g | sed s/ether//
 Please remeber: it requires the computer's MAC address regardless if you use wireless or wired connection.
   If you use Wi-Fi, you will find another different ethernet ID under the  "Airport" configuration, don't use this value.
5. Create the disk image file
   Create the disk image file locally, the file name is like computername_MACaddrss.sparsebundle
   based on the information from step 4), run following in the terminal:
  
    DISK_IMAGE_NAME="steve_zhang_macbook_d49a20046534.sparsebundle"
    DISK_SIZE=200000
    hdiutil create -library SPUD -megabytes $DISK_SIZE -fs HFS+J -type SPARSEBUNDLE -volname "$DISK_IMAGE_NAME" "$DISK_IMAGE_NAME"
  

Copy the created image file into the NAS storage folder.
6.  Run Time Machine, choose your NAS box,  if everything is OK, then the time machine will start working.

Some Erorrs I met
- Error 45
  This is because the time machine could not create the .sparsebundle file, in your NAS storage folder, you might find a file name and folder called like coputerName_tmp.sparsebundle, please follow step 4 and 5,  copy the generated file into the specific shared folder.
  I met this issue twice, one is I did not create the image file, the other is since I use the wrong ehternet ID which I got from the "airport" configuration. After I used the correct ehternet ID,this error does not happened again.

- Error of" .....sparsebundle is already been used."
  The .spasebundle file is used by another process, please restart the computer to run the Time machine again, this issue will solved.

Other tricks
1. For the first time backup, it is better to use LAN instead of Wi-Fi, for example, it took me about 14 hours to backup 113G data using LAN mode.
2. How to check the connected NAS in terminal:
   All the harddrives are under folder /Volumes, so if you type cd /Volumes in terminal, you will see your hard drive and your network drive.
3. How to check the system log:
   System log is in /var/log/system.log
4. If you don't like the time machine to backup every hour, please try the Time Machine Editor, you can customize your own backup schedule with this free app.
5. If you use Parallels virtual machine, then it is better to turn off the backup for parallels virtual machine file,  go to Parallels Desktop - Virtual Machine - Configure... , choose "General" tab, check the "Do not back up with time machine." For example, before my computer needs about 120G, right now it only needs to backup 59G data.  Or you can open the Time Machine Preferences, choose options,  add exclude the Virtual machine file: it is in /Users/Shared/Parallels/Windows XP.pvm


References
1.  Getting Time Machine to work on an Unsupported NAS
2. Time Machine Wireless Backup without Time Capsule
3. Time Machine Editor

3 comments:

  1. Steve - thanks a million for this. I did not expect to find instructions this detailed when I Googled this.

    Works perfectly - Time Machine is now running its first backup.

    ReplyDelete
  2. Just curious.. Will I notice a difference in transfer rates, from and to the NAS if I use a router with a USB 3.0 connection.

    ReplyDelete
  3. Really Very Excellent Detail.....Thanks for sharing this information...
    Netgear Router Tehnical Support

    ReplyDelete