Upgrading the hard drive on old Macbook Pro (and upgrading to Lion)

My old 13″ Macbook Pro’s 250GB is at it’s limit. It’s full and slow, and it is running Snow Leopard. So it was time to change it all.

The old disk was a 250GB Hitachi HTS542525K9SA00 with a 5400RPM rotational speed, the new, a Seagate Momentus 750GB 7200RPM beast.

The Plan?

1. Get the new hard drive onto a usb case

2. Install Snow Leopard on it

3. Install Lion on the usb drive

4. Check if all the applications are ok

5. copy all the data from the old drive to the new one (*)

6. Install the new drive into the mack book

(*) why not use the migration tools? Simple. Sometimes we need a clean start, in order to make sure the new system is as untainted as possible.

The results:

This was the poor state of my old hard drive:

 

Blackmagic's DIskspeed test result: 25MB/s writes, 26MB/s reads

 

 

 

 

 

 

 

 

 

 

 

 

 

Then, the new hard drive, with Lion through the USB case:

The new hard drive, through the USB case, 27MB/s writes, 35 MB/reads.

 

And voila, even from a bottlenecked environment such as a USB case, the new drive starts to shine. It’s 10% faster on writes and 40% faster on reads. Although those are not valid for all work loads, it shows some improvement.

 

 

 

 

 

 

 

 

 

 

 

Next, the new hard drive already inside the Macbook, and connected by the almighty SATA ports:

 

The Seagate Momentus 7200 connected to the Macbook through the SATA port: 103MB/s writes and 107MB/s

 

Now those are results to write home about: 4.5 fold increase on both writes and reads. This is a brand new life on this laptop.

 

 

 

 

 

 

 

 

 

 

 

 

And finally, the new drive with Filevault active:

The new hard drive with Filevault active: 100MB/s writes 106MB/s reads

 

 

Contrary to some other tests: on Blackmagic’s speed test, Filevault doesn’t impact as much on performance, at most a couple of percentage points, which is less than the uncertainty of the tool.

 

 

 

 

 

 

 

 

 

 

 

 

In sum

After making sure that each computer has as much memory as possible, the next best upgrade is the hard drive. The hard drive, even for SSDs is the slowest component, and is frequently the most significantly bottleneck for almost all common work loads. In this specific case, the old drive as slow from the start, and after getting with little free space, got even slower, as the inner cylinders are far slower then the outer ones. When moving to a bigger, with more cache, faster hard drive, everything gets a fresh start: the raw performance is better, less cylinders are occupied, and maybe, even Lion gets it’s share of performance enhancement.

Problems of replicating Virtual Machine

One of the biggest advantages of VMs, is the capability of cloning and replicating them. This allows the creation of a number of similar systems, without having to replicate the configuration and installation time. Unfortunately , there are a small number of downsides:

  • The MAC addresses are also cloned. Remember to generate new MAC addresses on each new cloned VM.
  • Also, Ubunto caches this value, which will generate a typical error message on dmesg: “udev: renamed network interface eth0 to eth1″ . To avoid this problem, delete the the file /etc/udev/rules.d/70-persistent-net.rules and restart the system.

How to manage a small Virtual Machine infrastructure

Over the last months, I felt the need to start a small virtual machine infrastructure to manage every small need on a laboratory at work.

The set up infrastructure is the following:

1x Apple Macbook Pro 4.1 – for development of the appliances

2x HP DL360 with 8GB RAM running Ubuntu 10.4 – to run the VMs

Note that is this NOT a production environment. This only covers a LAB needs and requirements, so stuff like redundancy and fail safe will not be included.

 

Over the next few weeks, I’ll add some important notes.

 

Workflow

The workflow is quite strait forward:

  • set up the VM on the Macbook running Oracle Virtual Box;
  • Deploy the VM on the HP server running Linux KVM

To go from one step to the other, conversion between formats is required. We’ll cover that later.

Recover data from a non booting Macbook Air (OSX 10.6)

The Macbook Air is the best tool for someone whose main function is to attend to meetings. Although the new (2011) models all feature SSDs, the older models only offered those as an option. As such, even the best build machines are not free from hard drive failures, which remain as the component with highest failing component.

Regardless, in case you get stuck with a non booting Macbook Air,  here’s how to recover the data:

1. First, why does this even works? Simple. OSX uses a kind of file system called “Journaled“, which is far different from FAT or NTFS, but is quite similar to ReiserFS, XFS or most UNIX file systems around. The advantage? Consistency is (almost) allways assured, even in case of a power failure, or hard drive failure. So, even if a hard drive is having problems, it’s usually capable of giving up it’s data.

2. DON’T TRY TO BOOT. If OSX fails to boot 3 times, don’t try the forth. One of the most interesting feature of a UNIX system, is the ability to boot WITHOUT WRITING to the hard drive. This allows for a failing hard drive not to do even more damage to it’s contents. This is half the reason why on a Windows system, if a hard drive fails, it continues to loose data every time it tries to boot. In OSX, boot into single user mode, by pressing CMD + S on boot. This will make the system boot in single user mode, with a read-only file system. Neat :) .

3. CHECK THE FILE SYSTEM. After booting in single user mode, the first thing to do is to check and fix the file system. Type the following after finishing boot:

fsck -yf
mount -uw /

This will allow us to check if the file system and the hard drive has any problems. If it does, it’s time to use a portable hard drive to recover the data

4. Mount the hard drive. This is the tricky part. On OSX, having USB support is not embedded on the kernel, and some services need to be up for the hard drive to be recognized so, plug the USB hard drive and use the following commands:

launchctl load /System/Library/LaunchDaemons/com.apple.notifyd.plist
launchctl load /System/Library/LaunchDaemons/com.apple.kextd.plist
launchctl load /System/Library/LaunchDaemons/com.apple.diskarbitrationd.plist
launchctl load /System/Library/LaunchDaemons/com.apple.configd.plist

and wait for the message “DSMOS has arrived”. If it doesn’t appear for 10 minutes, try plugging the USB hard drive prior to booting. Note, the USB drive MUST be formatted on HFS.

If it does, all that remaining is getting into the hard drive. First check the path to the hard drive. Type

ls /dev/disk*

and check for anything different from disk1s2, usually disk2s2.

5. Create the mount point:

makdir /Volumes/USBDrive

6. Mount the hard drive:

mount_hfs /dev/disk2s2 /Volumes/USBDrive

7. Copy the contents to the drive:

cp -R /users/* /Volumes/USBDrive

Hope this helps someone.

Check opened files by a process on OSX

Recently i’ve been fighting some performance issues with Spotlight on OSX 10.6. As sad as it may seem, the problem is not on Spotlight it selft, but on it’s reliance on third parties to search inside files. On my case, the issue is related to Office 2010 Exel files:

Jul 26 10:52:51 macbook-2 mdworker32[18995]: (Normal) Import: Spotlight giving up on importing file /Users/xxx/Library/Mail/Mailboxes/xxx/xxx.mbox/Attachments/156147/2/_excel_filename_.xlsx after 240 seconds, 235.697 seconds of which was spent in the Spotlight importer plugin.

Which makes Spotlight take DAYS for index all my files and emails. Regardless, the way to ckeck what Sportlight is actually doing is quite simple. On the console, type:

sudo opensnoop -n mdworker

In the meantime, I’ll try to get Spotlight out of Microsoft’s bugs…

How to build memory cards and USB sticks

This is more an ad than anything else, but even though is extremely visual.

Maybe it isn’t a bad idea to go some more in depth on this topic. Maybe in the future.

The most brutal game ever made

I don’t usually do this kind of posts, but the guys at arstechnica brought this to my attention.

The game is available here, and it is called “One Chance”. Before reading further, try it, it is free.

Now, as you’re already played, let me reminding as we’re approaching christmas, what are the most important things in live: people. People we love, people we work with, people we know, but people.

… so make sure that you have your priorities right.

Comments and registration now available!

Hi all,

I’m very sorry for the interruption on the continuous flow of posts I was managing up until September, but as everyone, when the workload increases, non-essential stuff start to get set aside. Regardless, this projects hasn’t ended, and the flow of new visitors has now got to a stable level. As such, registration for new users and comments are now open to all. Feel free to comment on anything you don’t agree or any other stuff you find relevant.

Intel confirms that POF is being studied for Light Peak

This is a simple update on the last post regarding POF and Light Peak.

In an interview to Tech-On, Jason Ziller, director of Optical I/O Planning/Marketing at Intel states:

Q: How long is the wavelength of optical signals used for Light Peak?

Ziller: It is 850nm. Optical signals are transmitted via optical fibers made of glass. The wavelength was decided in consideration of cost, durability, transmission range and so forth. However, it is possible that plastic optical fibers (POF) will be used in the future because its properties are drastically improving.

Now, I’m yet to understand how can multimode glass fiber support 10Gbps, even at 30m (unless OM3 cable is used), or can a company market a cable that can break, but the important is to take note that POF is indeed the probable future of this technology.

Plastic fiber as a use case for Intel’s Light Peak

For those who haven’t seen any keynote from Intel’s IDF for the last couple of years, Light Peak is the code name for a revolutionary technology that will allow cheap interconnects at 10Gbps, for domestic usage, based on optical technology.

Here’s a quick into on Light Peak:

Now, there’s a number of obvious limitations on using glass optical fiber. To start with, it’s brittle. No one is considering a consumer cable that cannot be bent! Nor can it have a maximum number of usages, nor having to be polished at each end. There’s simply no way glass optical fiber will make it’s way into a living room.

Intel promises 10Gbps next year at 30m, so it we take into account GI-POF (like this) which allows for 300Mhz/Km of bandwidth, one can assume that 10Gbps is also attainable, at least for distances of 20m+.

Let’s see what happens near the year’s end, when more info will come out from Intel.

Switch to our mobile site