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:

3 comments:

Checo said...

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

Checo said...
This comment has been removed by the author.
Unknown said...


Just wish to say your article is as astounding. The clearness in your post is simply excellent and i can assume you're an expert on this subject. Fine with your permission allow me to grab your feed to keep updated with forthcoming post. Thanks a million and please continue the enjoyable work. outlook 365 email login