Sunday 7 October 2012

How to Mount Windows Partition on Mac OSX?

Following the upgrade of my Macbook hard disk, OSX wouldn't mount Windows7 on start. I have found a way to do that. 

First use the Terminal command "Diskutil list" to find out your Windows7 partition details. In my case the Windows7 partition is located on /dev/disk0s4. You will find that in the "Volumes" folder, Windows7 should have been mounted, but it is not mounted. Now the following workaround will enable to mount the Windows7 partition on login.

Do the following commands in "Terminal" taken from the following webpage:

(i) sudo touch /usr/local/bin/login (To create a file named login)
(ii) sudo chmod x+ /usr/local/bin/login (To make the file named login executable)
(iii) sudo nano /usr/local/bin/login (To open the file named login in a text editor)

Once you open the file named login, you need to put the following text:
#! /bin/sh
#Create folder Windows7
cd /
cd Volumes
mkdir Windows7
#Mounting Windows7
sudo mount_ntfs /dev/disk0s4 /Volumes/Windows7

Save the file and then do the following command in "Terminal":
(i) sudo defaults write LoginHook /usr/local/bin/login

The above command will create a LoginHook which will enable the file named login to be executed at the login. So when you login, you will find Windows7 already mounted and ready for use.

The screenshot of the mounted Windows7 is presented below:

Saturday 6 October 2012

Upgrading Macbook hard disk and restoring its Partitions

When I bought my Macbook aluminum in late 2008, it came with a 250 GB hard disk and pre-loaded with Leopard. I later upgraded the OSX to Snow Leopard in 2009 and continued using it until a couple of months back when I needed to upgrade the hard disk due to it running low on disk space. During the three years, I partitioned the Macbook for using Windows 7 and Ubuntu (a linux variant) 11.10. My other post gives details on how to Triple boot a Macbook.

I decided to upgrade the original Macbook's hard disk to a 1TB one, which I reckon would give it a fresh lease of life and keep it running for atleast a few more years. For that, I chose Samsung Spinpoint M8 SATA II. Samsung has sold its HDD business to Seagate in 2011 and it is likely that this particular model might be in short supply.

Step 1. Things required for changing the Hard DiskThe actual process of changing out the hard disk is a fairly straight forward process. Page 41 of the  manual from Apple' website tells you how exactly to go about the business of changing out the hard disk. One however would need, (1) a TORX T6 screwdriver, (2) a Phillips screw driver and (3) an Antistatic wrist strap to do the business. It is also advisable to keep the removed hard disk in an external enclosure and use it for storage once you are sure that the upgrade process is complete. For a 2.5" USB 2.0 IDE HDD enclosure, I bought one produced by IOMAX from Amazon, which is cheap and reliable.

Step 2. Things to do before changing the Hard Disk
I would however advise against replacing the hard disk until a few things are sorted out. It is best to have an external hard disk of atleast 250 GB to store backups of the hard disk that is being replaced.

(i) For Mac OSX, download a software called Carbon Copy Cloner. A trial version (for one month) is available, which gives ample time to do the entire Mac partition cloning. The Mac OSX cloning is very straight forward and the interface resembles that of file transfer, wherein the files are simply copied from one disk to another. In my case I bought the software as I ran into numerous troubles, partly because of the update to OSX Mountain Lion.

(ii) For Windows, the advise online was to use Winclone, which I had no success, probably because one needs an external disk to store the image file and also the Windows partition should be a Bootcamp partition. I used Paragon backup and recovery 2012 free edition, which I found to be very user friendly.  You can register to get a free code for home use.

(iii) For Ubuntu, one could either use Paragon backup and recovery or dd utility in Ubuntu or Clonezilla. I used Paragon, but I needed to reinstall grub to make the partition bootable. To reinstall grub, one need to have an Ubuntu Live CD/DVD handy.

A screenshot of Paragon backup screen is as below (this is a screenshot of not my original hard disk but the new hard disk which I am backing up):

Step 3. Cloning Mac OSX
Next stage is to place the new hard disk into the HDD enclosure. Don't worry, once the disk is Partitioned and the Mac OSX cloned, we can go ahead with the next phase of restoring the Windows and Ubuntu partitions by installing the new hard disk in the Macbook.

Boot into OSX and connect the new hard disk in the enclosure to the USB port. OSX would immediately detect it and mount it. Go to Disk Utility and Partition the new hard disk. In my case, I partitioned into three partitions, (1) 400 GB for Mac, (2) 200 GB for Ubuntu and (3) 400 GB for Windows7.

Format the Mac Partition into HFS+ Journaled, Ubuntu into FAT32 and Windows into NTFS. In my original Macbook hard disk, I used Bootcamp to create the Windows Partition. However, as we don't intend to do a fresh installation, Bootcamp wouldn't be appropriate for use.

Use Carbon Copy Cloner downloaded, to start the process of copying. The screenshot below gives the Carbon Copy Cloner screen in operation. In the Select a source, select the Mac partition that we wish to copy and in the Select a destination, select the External hard disk location. Once you say clone, the process would start, which would take an hour or two depending the size of the partition.

Once the cloning part is completed, your Mac part of the hard disk is ready for use. If you install an application named rEFit, you can indeed boot using the external disk as well.

Step 4. Restoring Windows 7 and Ubuntu
As mentioned in Step2, you need to download Paragon Backup and Recovery 2012 to enable to restore Windows 7 and Ubuntu. For that you need to boot into the Windows7 and when you are ready to go,  connect the spare 250 GB external hard disk (formatted in NTFS) to able to Backup the complete partitions of Windows 7 and Ubuntu onto this drive. Paragon compresses the Archive file and stores them into a format that is easy to restore. At this point you have two options, (1) To create a Paragon boot disk, which will enable you to boot into Paragon Backup and Recovery Menu and thereafter go with the restore process or  (2) continue in Paragon Backup and Recovery application in Windows7 and do the process of restoring.  

Once the backup is done, start the restore process. For that you need to have both the New hard disk in an enclosure and the external hard disk connected. Select the location of the archive backup (on the external hard disk) and restore it to the partition created (on the New hard disk in enclosure). It is best to do them one by one (Windows 7 first and Ubuntu next), so that you don't get mixed up with the partitions. Once the restoring process is complete, you are technically ready to go. During the restore process using Paragon don't forget to choose the option of restoring to the complete partition. Or else you will end up with two partitions, one the same size as the original partition and the other an unallocated partition. This is likely to happen with the Windows7 partition, even though you select the option of filling the entire partition. You can boot into Windows7 and fix that, which is easy. Restore the Ubuntu partition as well, following the same steps as for Windows7.

Step 5. Replacing the hard disk
Now the moment of truth will arrive. You are ready to swap the hard disks. Take the one in the enclosure and place it in the Macbook. Follow Step 1 Page 41 of the Macbook manual and replace the hard disk. Place the old disk in the enclosure and keep it aside until you are sure that the entire process of Upgrading the hard disk is completed without any further hitches.

Step 6. Starting Windows 7
The only problem you could face is Windows7 wouldn't boot. For that pop in your original Windows 7 DVD and choose the Repair the Installation option and thereafter follow the instructions in my previous blog post of repairing the Windows7 MBR.

To expand the Windows 7 partition, download the Minitool Partition Wizard. That will leave with a small problem with the Mac GPT partition table and MBR partition table being out of sync. You can fix that later, if you find that to be disconcerting.

Step 7. Starting Ubuntu 
For Ubuntu, you might run into the problem of the Grub not being recognised. This part is a bit tricky. It would require you to pop in the Ubuntu Live CD and go into the Live CD mode. Then do the following instructions in Terminal:

(i) sudo fdisk -l

Note down the partition of your hard disk onto which the Ubuntu has been restored. It could be /dev/sda3

(ii) sudo grub-install /dev/sda3

Assuming Ubuntu partition is 3. This should work, but if you run into problems, you might have to use the chroot method.

When you use the chroot method, don't forget to update the installation.

Step 8. Syncing of GPT and MBR partition tables
For all practical purposes, do not disturb the MBR partition table. Just note the Windows7 Partition block size (start and the end sizes) in Minitool Partition Wizard. Boot into Mac and download iPartition. Unfortunately, iPartition is not a free application. However, it did what it need to do to the GPT partition table, which the Mac OSX uses and it completely saved my day and all the hard work I did on trying to sync the GPT and MBR partition tables. Here is a screenshot....

However, to use iPartition, you need to boot into another installation of Mac OSX as it can't be used on the same hard disk as the one on which the application is located. For that you could use the Mac OSX installation in the external disk (the old installation). To boot into the external hard disk installation, you need to install rEFIt, as it is the only way you could detect the installation on reboot. Whilst using iPartition, take special care whilst sizing the Windows partition. Sometimes, it could overlap over the other partitions, like say Ubuntu. Once the resizing of the Partition is done using the data you noted from MiniTool, you are more or less done. Use Partition Inspector, which is installed as a part of rEFIt to check whether the GPT partition tables and MBR partition tables are synced. A sceenshot of Partition Inspector is provided below.

You can see that the Partition tables are completely synced. Don't worry that the MBR counts from 1, while GPT counts from 40. Everything is perfectly in order. Now you are ready to go.


As usual there are lessons learnt in everything you do for the first time. In this particular instance, the scenario was quite nightmarish because of my reluctance to really dive into OSX side of the Macbook that much. I tended to use Windows 7 and Ubuntu partitions for most of the time and wasn't really familiar with GPT partition and how it works and what problems one might face when doing partitions. I probably was trying to do too many things simultaneously. For the first instance, I tried to restore the Mac OSX partition first and then dived right into upgrading from Snow Leopard to Mountain Lion. As a result, there was a situation with Mountain Lion creating a Recovery HD partition, which messed up the boot partition tables and MBR wouldn't recognise Windows7 partition. Eventually the method suggested by Chris Murphy really worked.

I eventually botched the entire hard disk, whilst using Gparted to resize the partition of Windows7. I had to restart from Scratch, including re-downloading Mountain Lion. In the second instance, I didn't scale down the Mac partition by 700MB, as a result I couldn't get the Mountain Lion Recovery HD partition installed. In a way, it is ok, because I am backing up the Mac Partition using Carbon Copy Cloner, instead of using Time Machine. It is easy and I have a complete installation ready to use, unlike Time Machine. In one particular instance, I had the File Vault option turned on, as a result, Time Machine, didn't really backup my Home folder. Thank goodness that I kept the original hard drive in an external enclosure and that saved the day for me.

Following the restore of Windows7 partition, it now appears that Mac OSX wouldn't mount Windows7. I had to device a workaround for that, which I will cover in a new post.

Friday 14 September 2012

Has Apple shot itself in its foot with the iPhone 5?

Has Apple shot itself in the foot with the iPhone5? I bet they have. Come to think about it, it was the most anticipated release of a smartphone from Apple, atleast since the release of iPhone 4 couple of years back.

The Apple website for iPhone5 gives a whole list of improvements or changes made from the previous iteration of its flagship piece of technology, a smartphone.

On all counts, leaving aside the quality of the build and a new faster processor, this latest offering from Apple is a big FAIL. The reasons are:

(1) The display size of 4" is really tiny by today's smartphone standards. The reasons quoted for restricting the screen size and that of the width of the phone sounded quite hilarious. If larger screen sizes were a real concern for most people, none of the Android smartphones (from the noted manufacturers) would be selling at all. I personally think the folks in Cupertino have teeny weeny hands and find it a problem using a mobile phone with a single hand, if it were any wider than the one on offer.

Increasing the length of the phone and not its width makes the phone look really skewed in its dimensions. Try reading a book in the portrait mode and you will know the difference. It might look great for movies, but not for reading books.

(2) I understand Apple's problem with Google and its maps, but telling the world that they have built a navigation software, which gives turn-by-turn directions, sounded like Apple employees were living in a completely different world than the one we all live in. It appears that Apple are in their own regressive timewarp and are unable to phatom the nuances of today's technology on offer from the other manufacturers.

(3) With the Panoramic feature in the Camera, Apple are selling Sony's technology and trying to con people into thinking that they were the ones who have invented it. Not at all.

(4) The new dock connector is another jigsaw in the puzzle. Why don't Apple adopt the universal micro USB adapter and concentrate on doing better things. Just trying to preserve profit margins for themselves and their vendors by adopting something that is radically different, but does nothing to enhance the overall appeal of the product is not a good approach for someone who wants to be at the forefront of cutting edge technology.

(5) What is it with people in Apple wanting smart phones to be thinner? No one gives a damn about how thin their mobile is, the moment they buy it. They are more interested in the functionality of the mobile phone and its battery life. With all the changes in the world, if the battery life sucks, not many people would really want to abandon their year or two year old smartphone and buy a newer model.

(6) Changing the headphone jack from top to bottom is another change made for the sake of making one. Most people who use their headphones whilst on the move prefer it being on the top. The reason being you want the phone to be in the upright position when you use your headphones. I read somewhere that having the headphone jack at the bottom poses a problem with people using docks for resting their phone in cars. It appears for Apple world has literally turned upside down.

(7) In this day and age, real estate on the front side of a mobile phone is quite a premium. Having a giant size home button doesn't really cut the deal. Reducing the bezels on the top and the bottom, would have certainly added half an inch to the display length, thereby preventing Apple from increasing the length of the phone. They needed to increase the width a bit and there you have a phone with completely new dimensions that are more up-to-date with the technology on display. For the home button, Apple just needed to have a soft button on the centre of the bottom dock. It would have been just great to see and feel as well.

In iPhone 6, Apple need to concentrate on doing things that they do best, design and technology. Concentrating on the technology of the peripherals (read dock connectors, audio headphone jack and satellite navigation) doesn't take you much further than where you are at the moment. What is at the heart of the phone is more important. They got it right with the processor, design build and the display quality, but, they need to get it right with the screen size and the design of the front side.

Update (07/10/2012):

Here is a picture of the four mobile phones the members of my family use,

Picture order Left to Right - Xperia T, iPhone 4S, Xperia U and Orange Monte Carlo (ZTE Skate).

Xperia T and iPhone 4S are the high end Smartphones, while Xperia U and ZTE Skate are budget Smartphones. You can see that iPhone 4S has approximately the same dimensions as Xperia U, which is a £150 phone. I don't see iPhone 5 size being any closer to the high end Smartphones on offer in the market. I think Apple needs to learn a serious lesson from this and bump up the size of the iPhone or else their market share in the Smartphone industry will dwindle each day. I certainly don't buy into the argument that iPhone5 being narrow in width gives the user the ability to use it with one hand. If you notice the person in the ad has a very large hand and he probably will be able to use it, but most people who use the Smartphone would use two hands, if they find it difficult use it with one hand for texting. 

Sunday 15 January 2012

Hugin - Panorama Sticher

The great thing about Ubuntu (a Linux derivative, which is an Open Source Operating System) is it has got myriad of applications that are free and work exceptionally well. One of them is Hugin - Panorama Sticher. It is a great application which allows a person to create a panoramic view from a series of pictures taken in a panoramic sequence. Here is how the interface of the application looks like.

The interface is well laid out. It has got the Assistant window where one loads the images and thereafter creates a panaromic image in Tiff. It is easy to convert the Tiff file into Jpeg using another photo viewer application which I like very much, which is Shotwell.

There are other windows (like Images, Camera and Lens, Crop, Mask, Control Points, Optimiser, Exposure, Sticher, which allows a person to do specific changes to the output of the image file.

Here is a panoramic photograph I had taken today. Have a look at the quality of the image. This has been compressed from a Tiff file (70+ MB) to a Jpeg file (roughly 3.6 MB). You still wouldn't notice any loss of quality. The images were all taken using a iPhone 4S.

The link to the complete panoramic view with the original quality is here.

Welcome to the Open Source Community and Welcome to Ubuntu.

BTW, Hugin Panaromic Sticher is also available for Windows and Mac. However, the Windows version keeps crashing, which is not the case with the Ubuntu version. I will report the version on Mac shortly.

Thursday 12 January 2012

Would the RBI's move to deregulate interest rates on NRE/NRO deposits in RRBs really benefit the investors?

RBI has issued a notification on 19th December 2011 saying that the RRBs (Regional Rural Banks) can fix the interest rates for NRE/NRO term deposits exceeding one year. Would it really benefit the investors? I don't think so. My reasons are, (1) These interest rates of 7 to 8% which the banks like ICICI, HDFC, etc.. are offering are only for Rupee accounts and not on FCNR (Foreign Currency Non Resident) accounts, which are still at 3 to 4%. This would mean that with a falling Rupee rate, there is no real benefit for term deposits lasting a year. It appears that RBI has tacitly conceded that the Rupee rate will fall further by atleast 4 to 5% in the next 12 months. Thus, for those who want to invest in Rupee accounts for a year and want to repatriate the funds back to their country of origin, they would be no appreciation in the value of investment. (2) If the investors choose to use the funds in Indian markets or spend in India, the high rate of inflation which is hovering around 9% would mean that the money in a year's time would have approximately the same value as the day it was invested. Unless the conditions within the Indian Economy change for the better, which would strengthen the Rupee I don't think investing in the Rupee accounts for higher interest rates makes real sense at all.