Bill Morefield My thoughts, discoveries, and occasional rambiings.

June 19, 2013

Time Machine Backups to a Windows Server in Mountain Lion

Filed under: apple,osx — Tags: , , — Bill Morefield @ 9:54 am

Since I moved to a MacBook as my laptop a couple of years ago, I’ve had one continuing problem with backups.  In my mixed Windows/mac environment I’ve used an HP MediaSmart Windows Home Server as my file storage solution for both systems and mostly that’s worked well.

At first Time Machine backups from Snow Leopard to this server worked fine as the HP server included software that allowed it to function as a native Time Machine destination.  That stopped working with the changes that Apple made to Time Machine in Lion.  HP being HP, they never updated their tools to work with Lion.  Once I upgraded to Lion I found no good alternative so I changed to the use of an external USB drive to store my backups.  I never really liked this solution since it required me to remember to plug in the drive on a regular basis. It also ran slowly at times and I didn’t like that it put part of my backups in a different place than the rest of them.

I finally found a solution that is not perfect, but is as close I’ve gotten.  Recently I had to redo this when the disk that held the backups had some issues because of a bad hard drive on my server and thought it worth documenting. It’s been more than a year since I set this up so I can’t provide the links to the blog post that got me thinking this direction so unfortunately I can’t credit them.  Still this is how to create a pretty good TimeMachine backup destination for a Lion or Mountain Lion Mac to a Windows Server.  In fact it should work with any storage that is network accessible and doesn’t natively support updated Apple’s AFP protocol.

This works by creating an Apple disk image on a server share.  This is the same concept used by VMWare and Parallels to create disk images for virtual machines.  Here though we’ll set up a disk image that we can later mount from our Apple that works as a destination for our backups.

  1. Start the Apple Disk Utility.  Easiest way is to bring up Spotlight and start typing in Disk Utility.
  2. Make sure that you do not have a drive selected and click New Image…
  3. I had problems creating the disk image directly on the external storage. When I tried creating the image on the remote storage it would never mount correctly. Instead I created the disk image on a local drive and then moved it to the server share.  This would normally be a problem since we want our disk image to be large enough for our backups and therefore want it at least as large as our hard disk.  To work around this, and save storage space until it’s needed, we’ll create a sparse bundle disk image.  This type of disk only allocates space when it’s needed.  It will run slower than a preallocated image, but I’ve found the difference isn’t noticeable.
  4. Now give the image a name.  I used MacBook-Backup for mine.  You will need this name later, so make sure it’s easy to type.
  5. Next skip ahead in the dialog and change the Image Format to sparse bundle disk image. This lets us create a disk image that will grow over time so we do not need to allocate all the space at once. It also let’s me allocate a 1 TB backup disk and still create it on the 500 GB SSD in my MacBook.
  6. You’ll want to size the image based on how much you have to backup and how long you want to be able to go back to retrieve data. Since I’d been using a 1 TB USB drive I decided to create the image the same size and found that’s worked well for me. Under the Size dropdown select Custom… to enter any size that you’d like.
  7. For format the default Mac OS Extended (Journaled) works fine so leave it.
  8. Encryption is optional.  For an actual portable disk like the USB drive I’d consider encryption a necessity.  With a network stored file the question is how much you trust the other people who may have access to your server.  If you want to be safe, 128 bit encryption works well.  I’m using it on my backup.
  9. You can create the image anywhere on your computer.  I gave it the name MacBook-Backup.sparsebundle to make it clear what it was.  Again since it’s a sparse bundle it will only initially use a small amount of disk space regardless of the size of the disk image.
  10. Once Disk Utility finishes creating the image, unmount it, and move it to your remote storage.  In my case I created a new share on my server and gave my account read/write access to that share.  I then moved the file into the share.

With the image file now on my storage, I next had to tell my Mac where this file was and to use it as the Time  Machine destination.  If you try to do this through the GUI as normal you’ll see that only external drives and AFP supporting devices (generally either a Time Capsule, Airport Base Station, or NAS with the necessary support) show.  Instead we need to use the tmutil command to tell Lion where this image file is

To do this I found the easiest approach to first mount the image to your computer.  To do this connect to your external storage where you placed the file.  In my case this was a cifs share and I mounted it using the Go -> Connect to Server… option in Finder.  Once I did this it and I entered my login credentials I could see the disk image.  To mount the image double click on it.  If you created an encrypted image you will be asked for the password.  You can choose to store the password in your keychain so you will not need to enter it each time.  Once the image is mounted, you will see it in Finder under Devices much as you would an external drive.  The name will be the image name you entered in step 4 above.

If you want to move any existing Time Machine backup you can do so.  Apple provides instructions to do this at https://support.apple.com/kb/HT5096.  In this case the disk image functions just as an external drive would.  It takes time, but allows you to keep your existing backup data.

Next start Terminal.  At the prompt enter the following command to tell Apple where our Time Machine destination will reside:

sudo tmutil setdestination /Volumes/Mounted Image

Change Mounted Image to the name of the device in Finder after you mounted it.  In my case since I gave it the name MacBook Backup in step 4, my command is:

sudo tmutil setdestination /Volumes/MacBook-Backup

Try running a backup now by going to the TimeMachine icon and select Backup Now.  Depending on how much data you have on your Mac and the speed of your network it might take a while.  If you have a lot to backup the first time doing so with a network cable instead of wireless can speed it up significantly.  If you have an existing backup it may be faster to transfer it to the new image which will allow the backup to pick up from there.

After a few days this is working well.  I’m now getting regular backups instead of only when I remember to plug in the USB drive and have the time to let the backup run.  I’ve found the backups over my wireless to be much faster than over the USB 2 in my MacBook.  I also feel more confident my backup is up to date and will cover if something happens to my laptop or hard drive.

It’s not perfect though.  Since this is for all purposes an external drive it functions much as connecting a physical drive and not as a network destination.  To kick off the backup, you must manually attach to the server and mount the drive. I’ve also found that when networks other than my home, I get errors about not being able to connect to the storage when the Mac attempts to start the backup. I’ve generally just ignored these since there seems to be no problem other than the error message.

October 1, 2012

Apple Maps and What’s the Problem

Filed under: iPhone — Tags: , , , — Bill Morefield @ 10:09 pm

Every iPhone release seems to bring some kind of debacle varying from real to merely a search for clicks on the web by writers. The commentary usually starts with the normal “Apple is finally losing it” to “Apple can do no wrong” and then somewhat sane reality comes in. The iOS maps debacle, which is an iOS issue and not an iPhone issue, looks to be the most valid and worst of them. I’ve followed this one with some interest as I’ve planned to upgrade to the new iPhone.

The issue was driven home a bit to me over the weekend. I was in the northern part of the Cumberland Plateau in Middle Tennessee Sunday looking for two places. One was a place that I’d last visited in my college days and the other one I’d only read about. Along with me were some directions and notes. Neither was a spot you could just plug into a GPS and get directions which admittedly is my normal way of getting somewhere now.

The first spot I found with no problems between good directions and vague memories. It was in fact a more lovely location than I remembered. The second I never found though I drove within a few miles of it. The reason, my directions left out a single turn, a short trip of less than a quarter mile, that meant I never saw the road I was searching for. As a result eventually we gave up and had to abandon the quest for another day.

While driving back home I thought back to when several years ago I learned that at least one major GPS had a mistake on the addresses on the street where I live. The street is a circle, a short loop of about thirty homes. That brand of GPS, or more exactly the map provider they used, had the addresses backwards so that if you followed them you’d likely end up exactly on the opposite side of the circle from where you actually meant to go.

In the daytime this was a  minor issue since the address numbers on the home would tell you that you were in the wrong spot. At night where these numbers were invisible, it wasn’t so clear. More than once someone I’d provided directions to my house wound up knocking on the wrong door or realizing something didn’t look right and calling me while from the street. It’s how I learned there was a problem and for a while I always added the warning when someone visited the first time.

Both of these had the same basic issue. Bad data. The GPS data was beyond my control and I did the only thing I could do, warn visitors not to trust the address on their GPS. The never found place on Sunday was my largely my fault. I could have checked or verified the directions before I left or at least checked a map well enough to have realized something was off in time to get to the right spot. In both cases though the data I had failed me.

The first time I remember using a computer map system to find directions to a place I’d not visited before it told me to use a bridge that no longer existed to cross a river. On a trip in Kentucky a couple years ago a road under construction and not in my GPS caused it so much confusion my GPS actually crashed and had to be restarted. A construction project I drive through several times almost every day has shifted the entrance and exit patterns to a shopping center, college, and mall several times in less than a year and will do so several more before being complete where the pattern will be completely unrelated to the original one.

And that’s the problem Apple is facing with maps. Map data is often inaccurate. Even good data is often behind. It’s so much easier to travel now with GPS data and maps available on demand on your phone. I’ve learned the art of interpreting the GPS, trusting it enough to get me there, but also expecting it to be wrong at times and using common sense.

The bigger issue is that the overall accuracy of the data doesn’t matter. What matters is how the data is where I want to go. All I know is that one of the two sets of directions I used Sunday was wrong. It doesn’t matter if every other one on the site is perfect, I’ll remember the one that was wrong and never trust them the same way again. Right now that’s what people think about Apple’s maps

It doesn’t really matter where it might be wrong because it will always be a little wrong somewhere and each time I or someone I know gets wrong directions that will be reinforced. I’ll probably take a long time before I trust Apple’s maps to get me there which might be the biggest problem they face now. Apple has to make maps that work not as well as Google, but better and for long enough that everyone forgets how bad a start they got off to.

February 3, 2012

Adding Recovery Partition to Lion Install

Filed under: apple,osx — Tags: , , , — Bill Morefield @ 8:00 am

As I mentioned in an earlier Mac post, I upgraded my MacBook Pro with a larger 500 GB hard drive.  I made the move by cloning my existing hard drive to the new hard drive which I’d attached by USB.  This worked perfectly – until I went to encrypt the new drive.  It turns out my clone tool didn’t copy the hidden recovery partition.

I’m a big believer that any notebook or portable computer should be encrypted.  My previous PC was encrypted using Truecrypt which worked wonderfully.  When I moved to the Mac, I was happy to see Lion added support for real encryption.  I did that soon after upgrading to Lion with no problems.

I like encryption because I consider my data the most valuable things I have.  I don’t want to lose my hardware, but I really don’t want someone else able to flip through my data.  I try to keep the really important stuff off my laptop, but you never know what might slip onto it.  I like the thought that if my notebook is lost or stolen I can simply get my data back from the last backup while the thief can’t find anything.

When I went to encrypt the new hard drive, Mac OS informed me it couldn’t because the recovery partition was missing.  Some research led me to backing up my data to an external hard drive, and then doing an install and restore.  I did this, but apparently missed a step and still no recovery partition after almost a day of backup/install/restore.

I had some other tasks to work, on so I put this one off for a while.  I finally came back to this week.  My research led me to a blog post by Dmitry Dulepov that outlined a fairly straightforward process.  You install Lion to a USB drive, repartition your hard drive to create space for the recovery partition, and then copy the recovery partition from the USB drive to the hard drive.  I had a USB thumb drive that worked fine.  When I finished all went well until I looked for the recovery partition on the USB drive and didn’t see one.  Apparently this recovery partition is harder to create that I’d thought.

More reading showed me a couple more options.  First came trying to re-run the installer.  While that might have worked, I was a little wary given my track record with the installer not creating this partition.  So I did some more research which led me to this blog post on removing and rebuilding the recovery partition that referenced this entry.  I didn’t need to remove, but I did need to rebuild.  I skipped the removal of the partition in that first entry and followed the steps to rebuild it.  It worked.  I rebooted to find the recovery partition there and was immediately able to encrypt the drive.

February 1, 2012

Enable/Disable Root in Mac OSX

Filed under: apple — Tags: , — Bill Morefield @ 6:15 pm

Just to make it easier to find later. How to enable/disable root user in OS X Lion.

January 16, 2012

Six Months with a MacBook

Filed under: apple — Tags: , — Bill Morefield @ 10:58 pm

Back in July I started using a MacBook Pro as my laptop. A month later I’d become pleased enough with it to move over to it full time. Now that it’s nearly six month into the change I thought I’d add a few thoughts on the current state.

Not all was perfect. In fact I found that, as with most basic laptops, the included hardware didn’t last too long for my needs. Memory was my first problem and 4GB just wasn’t enough.  I’m surprised how much RAM the computer uses in just normal use with a few of my normal programs (Firefox, Outlook, etc.) running. I really wanted 16GB in the laptop, but the cost of that back in September was too prohibitive. I settled on upgrading to 8GB which works well most of the time. In fact even with 8GB I sometimes see the computer bog down when running a 3GB virtual Windows computer.  Memory prices on 8GB chips have finally dropped to the range I decided to buy that to put in.  The upgrade will be here in a few days so I’ll not later how it works.  That would also open up Photoshop, Lightroom, and Premiere among other apps I still have to rely on my desktop for.

I still need to run Windows applications on the go making VMware Fusion a necessity. I migrated my old laptop to a virtual machine which worked great, except that my old system was already slow and in desperate need of a reinstall. As always a virtual machine works slower than native hardware so the resulting VM was painful to use. I did a few test installations of Windows and finally found a decent sweet spot. It turns out a 3 GB VM running 32bit Windows 7 gave me enough to run Visual Studio 2011, my plugins, web servers, and other tools pretty snappily. I actually feel comfortable  

I also found hard drive space getting tight after a few months. So right before Christmas I took advantage of a good sale (especially surprising given the recent price increases) to upgrade to a 500GB drive. I chose one of the Seagate Momentus XT drives that includes a small amount of flash memory giving you a bit of a hybrid between the high speed SSD and high capacity storage. The speed jump is noticeable after a couple weeks usage. I would have liked to look at the larger (and faster) 750GB Momentus, but couldn’t justify the cost difference.

Overall I’m quite happy with the Mac hardware.  I’m still undecided if the price difference between it and a similarly configured PC is worth the change.  I still believe Windows 7 is  as good of an operating system as Mac OS.  The hardware is well designed and the upgrade of both the hard drive and memory were easier than in many PC laptops I’ve dealt with.  I also notice the reactions when you pull out a MacBook in a coffee shop are noticeably different than with a PC and mostly in a better way.  I’ve had people start a conversation with me about the MacBook while sitting and working.

One thing I’ve been less pleased about is the software situation on the Mac, but that’s another post.

Powered by WordPress