Wednesday, 17 September 2014

Upgrading the primary HDD in a MacBook Pro

After 3 years of excellent service I've come to the realisation that the 256Gb HDD in my MacBook Pro is just not big enough any more, so after a little to-ing and fro-ing on crucial.com I acquired a new 1TB drive to act as a straight swap.

But here's the rub - how do I get all my data transferred over with the least amount of pain possible?

This got me thinking: OSX is basically UNIX, right? I have an iMac with a bunch of ports on it, and the laptop will boot into what Apple call Target Disk Mode, where the laptop is essentially an external hard drive to the iMac.

I thought I'd record how I did this in case I need to do it again, and indeed, in case someone else wants to know how to do this.

I would strongly recommend backing up your main drive, but as you can always put it back if anything goes too wrong I wouldn't stress about it too much.

Step 1: Connectivity

I have my laptop connected using a thunderbolt cable to my iMac. I have my new hard drive connected to a USB3 to eSATA converter, plugged into the USB3 drive on my iMac.

There are multiple ways of connecting things, but the laptop must be connected by firewire or thunderbolt to the iMac (or other laptop I suppose). The only adapter I could see for eSata was USB3, so that's what I've used.

When you connect the new hard drive to the USB3 you'll get a dialog inviting you to Initialize the disk, and this will bring up the Disk Utility.


You can see from this that I have selected the 1.02 TB ASMT 2105 Media, which is connected via USB. You can also see in the list a 251 GB APPLE SSD, which is the hard drive in my laptop. Bingo! We're connected!

Step 2: Preparing the target disk

We're going to use the Restore functionality of disk util to copy the data over in a minute, but before I can do that I need to prepare the partitions on the new disk. I actually have a bootcamp partition, so I'm going to do this twice. The old disk has a 60Gb BOOTCAMP partition for Windows (just so I can play Elite Dangerous when it comes out without waiting for the OSX version) and the rest is Mac OS. I'm going to partition the new drive as 900Gb for OSX and 100Gb for Bootcamp. 

Using Disk Utility select the new drive on the left, and set up your partitions. I have 2, one for Mac and one for Bootcamp, so my setup looks like this when I'm done:


Hit Apply and give it a few seconds to go, and you're done. On the left you should have two partitions named whatever you named them underneath the heading for the new drive.

Step 3: Copying the data

This is super easy, this bit! Select the TARGET partition on the left and select the Restore tab. This should have populated the Destination box with this target partition. Now drag the SOURCE partition from the left to the Source box. You should now have something in each of those boxes. Finally, hit Restore and confirm. You'll need to put your password in for this one. In my case the estimated time was about 45 minutes - that's SSD to SSD, both disks mounted on thunderbolt and USB3, so I'm thinking that's about as good as it gets for a 200Gb partition. 

The neat thing about doing it this way is it uses Apple's ASR tool under the hood, which does block copies, maintains volume information, and ignores blank space. It also performs a verification step once the copy is complete. As it happens I got an error in restore, not because there was a problem per se, but because of some odd "invalid argument" type error. This may be simply because the target size was not an exact multiple of the block size the tool was using for the copy or something. It would be nice if this could be ironed out in future releases of this tool, but it did perform the restore without error.

I should say that there are other ways of doing this, using tools like dd which can make a byte copy of the drive, and this works just fine, but requires some knowledge of how to execute command line tools to read special device file names and so on, and while I am completely happy using such tools you can't beat a good GUI. :-)

One final point worth mentioning is that I lost my system restore volume, which is installed by default on a mac disk. This is not the end of the world, as a restore image can be downloaded for free from Apple, and booted from a USB pen or other device, but you may want to reinstall this if it bothers you. I haven't tried that, so can't give any advice on that particular aspect.

Step 4: Testing the new drive

Select and "Unmount" the source and target drives in Disk Utility, power off the laptop, and disconnect the laptop and the new disk. Now refer to a guide such as this: https://www.ifixit.com/Guide/MacBook+Pro+17-Inch+Unibody+Hard+Drive+Replacement/3401 for replacing the drive. ifixit.com have guides for many different types of mac, so I'm sure you can find the right instructions!

While I was in there I upgraded the RAM to 16Gb, and there are guides for that on ifixit.com too but it's pretty obvious how to do that.

Then the moment of truth - powering on the Mac!

I pressed the power button, the CD whirred a bit - and then nothing...

So, I connected the power. This time it booted up but it did take a while. Be patient. You've just had the battery unplugged so that would have reset the power management and so on. When the machine came up it had reset the time, but that didn't last long when it connected to the internet.

I am finishing this post on the laptop, so that tells me all is well. One point I noticed is that I tried to verify the drive in Disk Utility and it had errors, so I shall investigate that further, but as far as I can tell the machine is just like the one I had about an hour ago, except now with a new, faster drive.

Good luck!


No comments:

Post a Comment