Upgrading a MacBook with an SSD

SSD Macbook

 

Having bought a new solid state drive (SSD), I needed somewhere to use it. Mountain Lion runs terribly slow on a 2009 MacBook Pro, so I decided to upgrade its hard drive to an SSD. I had originally planned to use it for a new desktop, but that isn’t going to happen anytime soon and it seemed like such a waste to leave a perfectly good SSD lying around.

The hard drive replacement was quite easy. Just unscrew everything and replace the drive. Some other websites should provide much better instructions. The main thing to note is that the hard drive support posts use a funny star shaped screw. I still have my friend’s toolkit from the last drive replacement so this wasn’t a problem.

Prior research had led me to the Recovery Disk Assistant, a bootable recovery USB stick. Plugging that in and starting the Mac starts a recovery utility. Start by adding a partition and formatting the disk using the disk utility.

Next, install the OS. The utility prompts for an AppleID. Use the account used to purchase Mountain Lion. The installer will now download the whole OS from the App Store. This requires an Internet connection, which can be configured from the recovery utility. Go do other stuff while it downloads and installs the OS.

At the end of the process, it will prompt for a location to restore user data from. One of the options is to use a hard drive. I plugged in the hard drive I had just replaced as an external USB drive. The installer automatically detected the applications and user data and offered the option of restoring it. I just let it do its thing and at the end of the process, the data recovery was complete without me having to manually dig up the application install disks or recreating the user accounts. It just worked!

The Mac now starts up in less than 10 seconds. Applications start much faster and Mountain Lion is finally acceptably quick.

I’m really amazed by the ease which I could reinstall the OS and restore the data after changing out the hard drive. The performance increase is very nice too. However, it’s a little disappointing that Mountain Lion needs an SSD to not feel sluggish.

 

Resizing VirtualBox Partitions

My Ubuntu VM was running out of space. The good thing about VMs is that the hard disk storage file can just be expanded. I followed the steps from this blog post.

First, expand the size of the disk. My host OS is Windows, so the following command is for the Windows version of VirtualBox. If the VirtualBox folder isn’t in the PATH variable, you will have to use the full path to VBoxManage.exe. For the command below to work, your working directory should be where the vdi file is. The final parameter is the new desired size of the partition.

VBoxManage.exe modifyhd mydisk.vdi --resize 20000

The partition must now be resized to make use of the expanded disk. Boot to a liveCD of Ubuntu to use the GParted partition editor. If you have an ISO file, it’s a pretty simple matter of assigning it to the virtual CD drive. Boot from the liveCD, select “Try Ubuntu” and start GParted.

If the Swap partition is in the way, right click on it, select Swapoff so that the partition can be moved. This is also necessary to do other stuff to the swap partition, like deleting it.

Swapoff

The swap partition was in the way, preventing me from expanding the primary partition, so I first had to move the extended partition all the way over. To do so first required deleting the swap partition. Right click on the swap partition to open the context menu and select delete.

Now click on the cyan border of the extended partition to select it, then right click and select Resize/Move. Adjust the sliders to move it to the end. This post here had the solution to the problem of moving the extended partition.

Recreate the swap partition in the extended partition. linux-swap is one of the options for the filesystem type.

Finally, extend the primary partition to take up the space. Remember to click on the green tick to apply the changes.

Shutdown the VM and remove the liveCD from the virtual CD drive. Reboot, and the available disk space has been increased!

Network Scan with Mac OS 10.8

Having already set up network scanning with little fuss on my Windows machine, I was expecting a simple task on Mac OS, but nooooo.

The shared folder method over Samba fails with a login error. Some googling suggests that it’s due to a change in the port number from NetBIOS (139) to TCP/IP (445). Naturally I couldn’t find an easy way to change that on the Mac.

Neither does the address book on the printer’s configuration page allow port 445. Only 139 and a range of 4 digit numbers are allowed.

Thus the alternative is FTP. To enable that, it is necessary to open a Terminal window and use the following command.

sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist

That enables FTP with authentication. Logging in with an FTP client with a user account will bring you to the user’s home folder. I created a subfolder there to keep scan output and configured that through the printer’s web interface.

Now it works :)

Setting up the Fuji Xerox DocuPrint M255z in Ubuntu 12

Open the Dash and type ‘print’. Click on ‘Printing’ and Add a printer.

Under Network Printer, the printer should show up after a while. It probably can’t find a suitable driver, and the one on the CD doesn’t seem to do anything. Let it search for a while then choose a driver from the database.

Just select a generic postscript driver and it should work, including duplex printing.

Don’t use the PCL drivers. While they will install just fine and you can send print jobs to the printer, it’ll just hang there and never get out of the processing stage. Cancelling doesn’t work either as it will forever stay in the cancelling stage until the printer is restarted by switching it off with the main switch.

Mass Delete Kindle Items

I have Instapaper setup to email my Kindle every week with the articles on my list. Over the year, I’ve gathered a huge number in the Kindle library.

While wondering how to clear them out today, I found a bookmarklet to mass destroy kindle items. This works very nicely. I can now mass delete all 15 items on a page at once instead of trying to do them one by one, which is ridiculous.

Ubuntu Wallpaper Slideshow

When you right click on Ubuntu 12.10′s desktop and select “Change Desktop Background”, there is one special entry in the list of wallpapers with a clock logo. When that entry is selected, your desktop wallpaper changes automatically throughout the day, showing you all the Ubuntu Community Wallpapers. This is really neat, but what if you want to use your own pictures?

The slideshow and its appearance in the dialog box is controlled by text files in 2 locations. One XML file defines the slideshow, and other tells Ubuntu where the slideshow file is. Let’s start with the slideshow file.

Slideshow XML File

The slideshow XML file is in /usr/share/backgrounds/contest

There’s a file named quantal.xml inside. If you upgraded from Ubuntu 12.04, precise.xml should be in there too. Copy this file and give it a meaningful name. Now open it in a text editor.

The interesting bits are the <static> and <transition> sections. The example below was taken from the precise.xml file.

  <static>
    <duration>1795.0</duration>
    <file>/usr/share/backgrounds/Twilight_Frost_by_Phil_Jackson.jpg</file>
  </static>
  <transition>
    <duration>5.0</duration>
    <from>/usr/share/backgrounds/Twilight_Frost_by_Phil_Jackson.jpg</from>
    <to>/usr/share/backgrounds/Precise_Pangolin_by_Vlad_Gerasimov.jpg</to>
  </transition>
  <static>
    <duration>1795.0</duration>
    <file>/usr/share/backgrounds/Precise_Pangolin_by_Vlad_Gerasimov.jpg</file>
  </static>
  <transition>
    <duration>5.0</duration>
    <from>/usr/share/backgrounds/Precise_Pangolin_by_Vlad_Gerasimov.jpg</from>
    <to>/usr/share/backgrounds/Twilight_Frost_by_Phil_Jackson.jpg</to>
   </transition>

The code is pretty self explanatory. Replace the file paths with full paths to pictures of your choice. At the transitions, put the file paths of the previous file and the next file. You can play with the duration values if you wish, but I haven’t tried them.

For the final transition, loop back to the first picture in the sequence.

Wallpaper XML File

Now you need to tell the Desktop Appearance dialog box where your slideshow file is. Navigate to /usr/share/gnome-background-properties

Create a new XML file in this directory and copy the code below into it.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd">
<wallpapers>
  <wallpaper deleted="false">
    <name>My Custom Slideshow</name>
    <filename>/usr/share/backgrounds/contest/my_slideshow.xml</filename>
    <options>zoom</options>
  </wallpaper>
</wallpapers>

Save the file and open the “Change Desktop Background” dialog. Your custom slideshow should appear in the selection pane. Select it and enjoy your own set of desktop wallpapers.

Reinstalling Mountain Lion

Upgrading from Snow Leopard to Mountain Lion has proven to be a lousy experience. The computer was much slower and the spinning wheel icon kept coming up. Endless frustration.

Before giving up on Mountain Lion, I decided to give it another chance by doing a fresh install. As with all fresh installs, start by backing up your stuff. I simply opened Finder and copied everything in each user’s Home folder over.

OS X has something called OS X recovery which allows recovery without any installation media. To access this, restart the Mac and hold down cmd + R until it boots into OS X utilities. From there, it is possible to erase the disk and select the option to install Mountain Lion.

The utility will ask for the Apple ID and password used to buy Mountain Lion, then proceed to download the whole thing before installing it. Just let it sit there and finish the whole process. It’s quite painless.

After Mountain Lion installed I copied the data back and reinstalled applications from their install discs. There was a bit of a problem with iPhoto at first when it refused to open the backed up libraries. It complained that the library was created with a newer version of iPhoto. Doing a software update solved the problem.

However, some old emails were lost. the ~/Library folder is hidden in Mountain Lion and thus was never copied when I first backed up the data. Mac OS stores mail somewhere in the Library folder in the user’s home directory. Oh well the perils of hiding “complicated” things from the user.