Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Trying to recover Windows bootcamp and data within using instructions on this community

Hi there,


I had Windows bootcamp installed on my Macbook air and was working fine until I created a new partition to mount it on top of 25GB (i reckon) windows partition. I lost the Windows boot when I created this new partition from disk utility. On rebooting Windows option disappeared.

I followed below steps by "Loner T" to recover windows bootability:

sudo fdisk -e /dev/disk0

p

setpid 4

07

flag 4

p

write

y


Now Reboot and hold the ALT key and check if Windows shows up and is bootable.

Following above, I could now see the boot icon on Alt+Start but when trying Windows I got "Missing Operating System" To resolve this, I am trying to follow instructions via this post - BOOTCAMP Partition lost after some updates in Yosemite and other interlinking posts./threads [NOTE: I have not attempted Yosemite upgrade at all]

I have installed GPTF Disk and TestDisk and followed steps on http://imgur.com/a/PjmnK to do a quick search. Below is the output. Can you please suggest me next steps to recover bootcamp along with the data. Had quite a bit of data saved there and really hoping to get it all back safe. Please Help!!

User uploaded file

MacBook Air, OS X Mavericks (10.9.5)

Posted on Jul 6, 2015 5:52 AM

Reply
20 replies

Jul 6, 2015 10:06 AM in response to davesam00

You can abort the steps using a 'q' or Control+C and start again.


This is incorrect. See this part.


Here is sample Q&A for this section. Please notice the Press Enter/Return.


Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): Y


Creating entry for GPT partition #2 (MBR partition #2)

Enter an MBR hex code (default AF): Press Enter/Return

Set the bootable flag? (Y/N): N


Creating entry for GPT partition #3 (MBR partition #3)

Enter an MBR hex code (default AB): Press Enter/Return

Set the bootable flag? (Y/N): N


Creating entry for GPT partition #4 (MBR partition #4)

Enter an MBR hex code (default 07): Press Enter/Return

Set the bootable flag? (Y/N): Y

Jul 7, 2015 3:02 AM in response to Loner T

Thanks Loner T!!! You are a life saver! Recovered the boot camp with all data in partition including auto complete web forms! 😀 cheers mate!

One more wee help I seek to put my machine in good shape. Below is the snapshot of my Disk utility partition. You see there is a bit of space between Mac HD and Bootcamp partition -

Initially I wanted to mount this space on bootcamp but now I have reversed my thought and want to plug it back on to Mac HD. How do I do this?

Can I just pull the Mac HD down until the line? Will this mess up the boot camp again?

Thanks for you help in adv.!

Jul 7, 2015 4:34 AM in response to davesam00

davesam00 wrote:


Below is the snapshot of my Disk utility partition. You see there is a bit of space between Mac HD and Bootcamp partition -

Initially I wanted to mount this space on bootcamp but now I have reversed my thought and want to plug it back on to Mac HD. How do I do this?

Can I just pull the Mac HD down until the line? Will this mess up the boot camp again?


The gap that you are referring to is the sector offset in this table. It is ~8GB and is between the Recovery HD and the NTFS Windows partition.

GPT 3 Start GPT 3 Size GPT 3 End NTFS Start Sector Offset NTFS Size NTFS End Sector Offset (MB) NTFS(Gb)
129038008 1269536 130307544 148434944 18127400 88541177 236976120 8,851 42.21972322

Can you post a screen shot of Disk Management from the Windows side? It may be possible to add it to the NTFS side.


To add it to the OS X side, requires losing Recovery HD temporarily by absorbing it into OS X and then re-installing OS X which will rebuild Recovery HD without altering any of you OS X files. Please post the output of (this is now different then what you posted earlier in this discussion 😉 )


sudo gpt -vv -r show /dev/disk0

Jul 7, 2015 7:00 AM in response to Loner T

Hi there, sorry for delay in reply - got caught up with work - just managed to switch to windows.


Below is the snapshot of disk management from Windows:

User uploaded file

Also I realise I did not send you the snapshot from Mac Disk utility below -

User uploaded file


I'll add the command line output in a bit to this post. NOW - Below the output of "sudo gpt -vv -r show /dev/disk0"


User uploaded file

Thanks for your help LonerT.. much appreciated!

Jul 7, 2015 8:37 AM in response to davesam00

This is what I suggest you do.


1. Backup OSX - Time Machine or any other tool of your choice.

2. Backup Windows - Windows Backup/Restore or any other tool of your choice.

3. Install OSX on external volume - OS X: Installing OS X on an external volume - Apple Support (for safety and external boot if necessary). Please ensure that the external volume has Recovery HD which should be the same version as what you currently have.

4. Merge disk chunks. Please be very careful with these steps. Do not touch disk0s4 with any commands. Verify that the MBR for Windows is correct and points to the correct start/size as shown in the current GPT. The GPT index will change after merge.

a. Merge disk0s2, disk0s3 - diskutil mergePartitions disk0s2 disk0s3

b. Run Disk Utility and drag the bottom right to cover the ~8.6GB Free Space.

c. Use the external volume to boot and re-install OSX or use Internet Recovery (spinning globe is a must) and re-install OSX and

re-build Recovery HD.

5. Backup OSX again for future recovery baseline.

6. Stop if you see any errors.



Here is the help information for mergePartitions verb.

diskutil mergePartitions

Usage: diskutil mergePartitions [force] format name

DiskIdentifier|DeviceNode DiskIdentifier|DeviceNode


Merge two or more pre-existing partitions into one. The first disk parameter

is the starting partition; the second disk parameter is the ending partition;

this given range of two or more partitions will be merged into one.


All partitions in the range, except for the first one, must be unmountable.


All data on merged partitions other than the first will be lost; data on the

first partition will be lost as well if the "force" argument is given.


If "force" is not given, and the first partition has a resizable file system

(e.g. JHFS+), it will be grown in a data-preserving manner, even if a different

file system is specified (in fact, your file system and volume name parameters

are both ignored in this case). If "force" is not given, and the first

partition is not resizable, you will be prompted if you want to erase.


If "force" is given, the first partition is always formatted. You should

do this if you wish to reformat to a new file system type.


Merged partitions are required to be ordered sequentially on disk.

See diskutil list for the actual on-disk ordering; BSD slice identifiers

may in certain circumstances not always be in numerical order but the

top-to-bottom order given by diskutil list is always the on-disk order.


Ownership of the affected disk is required.


Example: diskutil mergePartitions JHFS+ NewName disk3s4 disk3s7

This example will merge all partitions *BETWEEN* disk3s4 and disk3s7,

preserving data on disk3s4 but destroying data on disk3s5, disk3s6,

disk3s7 and any invisible free space partitions between those disks;

disk3s4 will be grown to cover the full space if possible.

Trying to recover Windows bootcamp and data within using instructions on this community

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.