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 com.apple.loginwindow 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:

2 comments:

illSouth said...

In second command instead of
(ii) sudo chmod x+ /usr/local/bin/login
should be:
(ii) sudo chmod +x /usr/local/bin/login

illSouth said...
This comment has been removed by the author.