Tag Archives: Mac

Get A “New” Macbook Pro At A Fraction of The Cost

My Macbook Pro (13-inch, Mid 2009, 2.53 GHz Intel Core 2 Duo) was bought in December 2009. It is 6 years and 3 months old and counting. Lately, it was showing signs of slowness and hard disk failures more and more frequently. I thought it was time to get a new laptop.

But a new decent laptop cost more than a few thousand ringgits. I hesitated for a long time thinking whether it was a right choice to buy a new laptop (I am not rich).

Another concern was that what could I do with the old Macbook Pro if I decided to get a new computer? Throw it away? Give it to charity? Recycle it for free? After all, many of the parts are still fully functional.

Reusable parts:

  • CPU
  • RAM
  • Keyboard
  • Trackpad
  • Screen
  • CD player
  • Etc

CPU and RAM are actually the last parts to die among all parts out of the whole laptop. And Macbook Pro is built to last forever! It would be a huge waste to throw them away just because one or two of the parts are broken!

Based on reading from the Internet and from my personal experience, the most fragile and vulnerable parts are:

  • Hard drive
  • Battery
  • Cooling fan
  • Power supply
  • Etc

Since I can no longer access the Macintosh HD, the default hard disk of my Macbook Pro, I decided to replace it.

After reading articles and watching videos on the very promising performance of solid-state drive (SSD), I decided to give it a try.

I did my shopping online and found the Kingston V300 SSD. It got my attention because it is the cheapest.

Kingston V300 SSD 480Gb

Kingston V300 SSD 480Gb

The Kingston V300 SSD 480GB cost me RM 498 which translates to around RM1/GB. Dirt cheap. I bought it through Shopback from Lazada with discount.

By following installation guide from Youtube, I managed to change the hard drive all by myself.

Hard Disk (Before)

Hard Disk (Before)

Hard Disk (After)

Hard Disk (After)

After cloning the new SSD with the content of my USB drive from last incident, all was set to go.

The result exceeded my expectation. The Macbook Pro suddenly becomes so responsive like a brand new laptop. Booting it up and shutting it down takes just a few seconds!

The Kingston V300 SSD is able to run at the maximum speed that the MCP79 of my Mid 2009 Macbook Pro 13-inch is able to support, which is 3 Gigabit, despite the fact that some people can only get it to 1.5 Gigabit of negotiated link speed.

Kingston V300 SSD Negotiated Link Speed is 3 Gigabit

Kingston V300 SSD Negotiated Link Speed is 3 Gigabit

The OS that I cloned to the SSD was Yosemite 10.10.5. Now I upgraded it to El Capitan 10.11.4 and everything is still running smoothly if not better. It is running so silently and fast.

OS X El Capitan 10.11.4

OS X El Capitan 10.11.4

Final thought

I paid RM 498 instead of RM 4999 to get a “brand new” laptop. If I could get a new Macbook Pro at one tenth of the price, why not?

Price is what you pay, value is what you get. – Warren Buffett

At such a low price, it is hard to go terribly wrong.

The speed of SSD is incredible. I recommend it to everyone. It is worth the money because it is 10 times faster and lasts 10 times longer than a mechanical hard disk drive. It is fast and could last for a lifetime! It is such a good investment that you won’t regret it.

My next step is to replace the battery…

MacBook: When Disk Utility Can’t Repair Your Disk

Apple MacBook is idiot-proof. I proved this myself.

The incident happened on my unlucky Friday morning, 29 January 2016, where there were some updates available for my six-year-old MacBook Pro. I was supposed to upgrade from OS X Yosemite 10.10.5 to the new OS X El Capitan 10.11.3.

I clicked “upgrade” from the App Store and waited for the laptop to restart. I walked away for some drinks and came back. Everything seemed normal until this point where my stupidity changed the course of the event. When I saw the laptop was shut down (it was actually in the process of rebooting), I pressed the start button to turn the laptop on.

That was when the trouble began. The MacBook Pro was not able to boot correctly. It stuck at the boot screen with (approximately) 50 % in progress forever. I waited 6 hours before I tried to reboot after reading from the internet that Apple MacBook is smart enough to resume the update or upgrade anywhere it left off. So I tried again in the evening (by pressing the start button twice, first long press to shut down, then to boot) and let the laptop booting for the whole night.

The next morning, it was still stuck at 50 % in the startup process (after more than 12 hours of booting). I realized that my situation was different from the others who had the “same” problem. Mine was definitely a different case where something was corrupted (I suspected) because I pressed the start button exactly when the laptop was about to restart.

Recovery Mode

I searched online and found some useful short-cuts to get into different modes while booting a MacBook.

Note: From my experience, in order to enter the different modes successfully, you need to press and hold the key combinations after the white backlight lights up on the screen and you can release them after you see the Apple logo appears during the startup process.

I tried Command-Option-P-R to reset NVRAM: It did reset the NVRAM because I observed that something restarted after I pressed those keys. However, the booting process still hung at 50 %.

I tried Shift ⇧ to enter Safe Mode: I was not able to enter safe mode at all even after waiting for a long time.

I tried Command-S to enter single-user mode: I could enter this mode (with a bunch of texts on the screen), however, it stuck at the place where it needed access to “Macintosh HD”. So I never successfully try anything in this mode.

I tried Command (⌘)-R to enter OS X Recovery mode: After successfully entered this mode, I was offered several options.

Mac Recovery Mode

Mac Recovery Mode

In recovery mode, you have the following options:

  • Restore From Time Machine Backup
  • Reinstall OS X
  • Get Help Online
  • Disk Utility

The first option “Restore From Time Machine Backup” was not useful because I didn’t have any backups from Time Machine.

The last option “Disk Utility” was where I spent the most of my time trying to rescue my old laptop.

Disk Utility

From the Disk Utility interface, I saw that the “Macintosh HD” was greyed out.

I tried almost all the combinations I could think off with the options offered by the Disk Utility to rescue “Macintosh HD”. At first, I thought to myself I needed to perserve my existing data. After trying many different combinations of “solutions” (mount “Macintosh HD” disk, verify and repair “Macintosh HD” disk, restore “Macintosh HD” disk to external drive, etc). All failed.

At some point, I came across this interesting article which states that by keep on repairing the disk N times (with N large enough), it could work. But it didn’t work for me.

I even tried with bash script: “for ((c=0;c<25;c++)) do diskutil repairVolume /dev/disk0s2; done;" Note: disk0s2 is the identifier for “Macintosh HD” drive. Run “diskutil list” on terminal to find out.

All the time I was getting:

“Error: -69845: File system verify or repair failed
Underlying error: 8: POSIX reports: Exec format error”

I was convinced that “Macintosh HD” was corrupted and dead.

Reinstall OS X

Since I was having no success trying to backup my data, I gave up doing it. The idea then was to reinstall OS X on “Macintosh HD” drive, hence potentially overwriting all my files. I was ready to erase and repartition “Macintosh HD”. This failed too. The disk was in really bad shape I thought to myself.

By consequence, the disk didn’t show up as an option when I tried to reinstall OS X. The whole day passed with no progress.

USB Drive to the rescue

The next day, I had no choice but to install the OS on external drive. I choose the cheapest option: USB drive (at least 15 GB of storage else OS X won’t install).

USB Drive 32 GB

USB Drive 32 GB

It took at least 6 hours to download the OS and install to the USB drive. At first boot, everything was so slow. The runtime experience was really bad. But I notice one thing when I opened System Preference > Startup Disk, I saw the following:

Macintosh HD is alive

Macintosh HD is alive

I saw something unbelievable: the “Macintosh HD” that I thought was dead is now available as a start up disk. Sure enough, after I selected it as the startup disk and rebooted, everything is working as normal again! My data is not lost.


USB drive that saved my MacBook

USB drive that saved my MacBook

Final thought

When Disk Utility can’t repair your disk, reinstall OS X on an external drive and see if your data is accessible again.

Visual Studio for Mac: Developing C# on OS X

If you only had a Mac with you and you need to work on a project which was written in Microsoft proprietary language (C#), what would you do? I did a quick search on Google and most of the results pointed me to the Mono solution.

Mono is a cross platform, open source .NET framework. It is being sponsored by Xamarin, a popular C# development platform for mobile (Android, iOS) apps, Mac and Windows. Without further ado, I quickly downloaded and installed the Mono solution.

To start using Mono, you will need to install 2 things:

  1. Mono MDK package (.pkg), an open source .NET framework, which will occupy around 600+ MB of space once installed.
  2. Xamarin Studio, MonoDevelop IDE (Integrated Development Environment), which will occupy around 300+ MB of space once installed. The IDE is free as long as you are not developing for iOS/Android projects.

After installing the Mono package and Xamarin Studio (the installation process was quick and painless), I started playing with the Xaramin Studio. To my surprise, the interface is very similar to Visual Studio. I can even say that Xamarin Studio is the Visual Studio for Mac. 🙂 This is good news for C# developers since they don’t have to go through the steep learning curve of picking up a new development tool.

Visual Studio for Mac

Xamarin Studio

Xamarin Studio

Xamarin Studio can open the solution file (.sln) of an existing C# project directly and build the solution without any additional configuration. This is very good. Another good thing is it also has the Nuget package manager integrated in the IDE. NuGet is helpful for finding useful open source packages like Selenium which I need for development.

NuGet in Xamarin Studio

NuGet in Xamarin Studio

Xamarin Studio has built-in Git and SVN version controls support. If your project is version controlled, it will auto-detect the setting and track your pending changes in the IDE. Cool.

It also has the powerful auto-complete feature which literally helps you write your program. The contextual menu has the common options as in Visual Studio like auto-resolve namespace if you are using a class from a non-referenced namespace, rename variable throughout the solution, refactor selected code, etc.

I haven’t tried the debugger fully due to the exception encountered during run-time for the library that I was using. It does have the step-over, step-into, step-out features.

The program that is built using Xamarin Studio can run on a Windows directly too (as long as you don’t use any Mono specific libraries according to this and vice versa where you don’t use any Microsoft/Windows specific libraries such as WPF, Workflow Foundation, COM+ etc in order for the program to build correctly using Mono). I tested the program on the Amazon Elastic Compute Cloud (Amazon EC2) service with Microsoft Windows Server 2012 Base 64-bit (which is free).

Well that’s it. Xamarin Studio, the Visual Studio for Mac.