You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

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

Boot camp lost after upgrading to Yosemite from mountain lion

User uploaded file

I lost my windows7 boot camp after I upgrade to Yosemite from mountain lion. When I press ALT when rebooting there is no more alternative to boot for window anymore. I did read some thread about this but my case is different since when I tried to type 3 steps(diskutil.......etc) 😕 as LonerT user answers it did not work. The attached files here are what I faced with. Please help. I have a lot of important files in windows

User uploaded fileUser uploaded fileUser uploaded file

MacBook Pro, OS X Yosemite (10.10), macbook pro

Posted on Nov 10, 2014 1:38 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 10, 2014 2:14 PM

You have also caught the Yosemite bug.


1. Please post the output of sudo fdisk /dev/disk0

2. Text output of commands is a bit more helpful than screen images for calculations.

3. The gap between GPT#3 and GPT#4 is where your lost NTFS header lies.

4. Please download Testdisk and GPT Fdisk. Let me know if you have the links or you need them.

82 replies
Question marked as Top-ranking reply

Nov 10, 2014 2:14 PM in response to Naritoat

You have also caught the Yosemite bug.


1. Please post the output of sudo fdisk /dev/disk0

2. Text output of commands is a bit more helpful than screen images for calculations.

3. The gap between GPT#3 and GPT#4 is where your lost NTFS header lies.

4. Please download Testdisk and GPT Fdisk. Let me know if you have the links or you need them.

Nov 10, 2014 2:47 PM in response to Loner T

Last login: Mon Nov 10 23:35:27 on console

Naritoat:~ naritoat$ sudo fdisk /dev/disk0

Password:

Disk: /dev/disk0 geometry: 60801/255/63 [976773168 sectors]

Signature: 0xAA55

Starting Ending

#: id cyl hd sec - cyl hd sec [ start - size]

------------------------------------------------------------------------

1: EE 0 0 2 - 25 127 14 [ 1 - 409639] <Unknown ID>

2: AF 25 127 15 - 1023 254 63 [ 409640 - 781250000] HFS+

3: AB 1023 254 63 - 1023 254 63 [ 781659640 - 1269536] Darwin Boot

4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused

Naritoat:~ naritoat$


I have downloaded Testdisk and GPT Fdisk.

I did some correction according to your answers in "Bootcamp Windows 8.1 Missing after Yosemite Upgrade" post since it looks similar to my case but I am not sure if I did them all right to my condition 😟. My files in windows are very important to me. please help

Thank you very much for your response

Nov 10, 2014 3:17 PM in response to Naritoat

I have been using Yosemite Upgrade Broke Bootcamp as reference. Please take a look and see if it helps you get further.


Testdisk Deeper Search should be the first logical step (http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step#A_partition_is_still_missin g:_Deeper_Search).


Once you find the correct 'lost' header, than Gdisk (GPT Fdisk) is used to rebuild the MBR.

Nov 10, 2014 3:22 PM in response to Loner T

estDisk 7.0-WIP, Data Recovery Utility, October 2014

Christophe GRENIER <grenier@cgsecurity.org>

http://www.cgsecurity.org


Disk /dev/rdisk0 - 500 GB / 465 GiB - 976773168 sectors (RO)

Partition Start End Size in sectors

P EFI System 40 409639 409600 [EFI]

D Mac HFS 409640 780934439 780524800

D MS Data 589086728 782929920 193843193

D Mac HFS 781659640 782929175 1269536

D MS Data 782929920 976773112 193843193

>D MS Data 820525056 976773119 156248064

D Mac HFS 975503592 976773127 1269536






Structure: Ok. Use Up/Down Arrow keys to select partition.

Use Left/Right Arrow keys to CHANGE partition characteristics:

P=Primary D=Deleted

Keys A: add partition, L: load backup, T: change type, P: list files,

Enter: to continue

NTFS found using backup sector, blocksize=4096, 79 GB / 74 GiB



This is what I found from Testdisk I do not know what to do next.

Thanks again for your answer

Nov 10, 2014 4:47 PM in response to Loner T

MS Data 589086728 782929920 193843193




Can't open filesystem. Filesystem seems damaged.


MS Data 782929920 976773112 193843193

Directory /


>dr-xr-xr-x 0 0 0 31-Oct-2014 19:38 .

dr-xr-xr-x 0 0 0 31-Oct-2014 19:38 ..

dr-xr-xr-x 0 0 0 27-Jun-2013 02:02 $Recycle.Bin

dr-xr-xr-x 0 0 0 15-Aug-2014 12:40 AutoKMS

dr-xr-xr-x 0 0 0 22-Aug-2014 15:22 Autodesk

dr-xr-xr-x 0 0 0 27-Jun-2013 09:52 Boot

dr-xr-xr-x 0 0 0 31-Oct-2014 19:38 Config.Msi

dr-xr-xr-x 0 0 0 20-Aug-2014 15:03 Intel

dr-xr-xr-x 0 0 0 12-Aug-2014 21:39 MSOCache

dr-xr-xr-x 0 0 0 14-Jul-2009 05:20 PerfLogs

dr-xr-xr-x 0 0 0 1-Sep-2014 16:10 Program Files

dr-xr-xr-x 0 0 0 31-Oct-2014 19:27 Program Files (x86)

dr-xr-xr-x 0 0 0 31-Oct-2014 19:27 ProgramData

dr-xr-xr-x 0 0 0 27-Jun-2013 02:02 Recovery

Next

Use Right to change directory, h to hide Alternate Data Stream

q to quit, : to select the current file, a to select all files

C to copy the selected files, c to copy the current file



MS Data 820525056 976773119 156248064




Can't open filesystem. Filesystem seems damaged.


Nov 10, 2014 5:29 PM in response to Naritoat

If you look at the GAP between GPT3 and GPT4 it is start/size of 782929176/37595880 but the NTFS header starts at 782929920 according to your Testdisk output shown here.


MS Data 782929920 976773112 193843193


The difference is 782929920 - 782929176 = 744 bytes. You will need to delete the current GPT4 and recreate a new GPT4. Please stop if you see any error messages and post here.


1. Delete the old entry and create a new entry at GPT#4.


sudo gdisk /dev/disk0

p

d

4

n

4

782929920

976773112

0700

p

w

y


Here is an example of the delete/new...


Command (? for help): d

Partition number (1-4): 4


Command (? for help): n

Partition number (4-128, default 4): 4

First sector (34-1954210086, default = 1454210080) or {+-}size{KMGTP}: 1454211072

Last sector (1454211072-1954210086, default = 1954210086) or {+-}size{KMGTP}: 1954209791

Current type is 'Apple HFS/HFS+'

Hex code or GUID (L to show codes, Enter = AF00): 0700

Changed type of partition to 'Microsoft basic data'


Command (? for help): p

Disk /dev/disk0: 1954210120 sectors, 931.8 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): 6ED0C429-00D1-4759-B50E-04B6FB80D0E3

Partition table holds up to 128 entries

First usable sector is 34, last usable sector is 1954210086

Partitions will be aligned on 8-sector boundaries

Total free space is 1293 sectors (646.5 KiB)


Number Start (sector) End (sector) Size Code Name

1 40 409639 200.0 MiB EF00 EFI System Partition

2 409640 1452940543 692.6 GiB AF00 Customer

3 1452940544 1454210079 619.9 MiB AB00 Recovery HD

4 1454211072 1954209791 238.4 GiB 0700 Microsoft basic data

2. This is a tedious process and you want to check after the second 'p'rint command that it looks reasonable, before the 'w'rite and 'y'es to confirm.


3. You will need to reboot after the change, because the disk you are booted from is the one being modified. Reboot will rebuild disk0s4 using the start/end you entered.


4. Run the dd command - sudo dd if=/dev/rdisk0s4 count=1 2>/dev/null | hexdump -C and check that the first line contains "R.NTFS".


5. Once you have a working GPT#4, a new hybrid MBR needs to be created which will overwrite what you see in your Fdisk output. This is also done using GPT Fdisk (Gdisk). Your numbers will look different than what are in the following example. In most cases, you will use the default except entry 4, which should have a 'y' for bootable flag.


sudo gdisk /dev/disk0

GPT fdisk (gdisk) version 0.8.10


Warning: Devices opened with shared lock will not have their

partition table automatically reloaded!

Partition table scan:

MBR: hybrid

BSD: not present

APM: not present

GPT: present


Found valid GPT with hybrid MBR; using GPT.


Command (? for help): p

Disk /dev/disk0: 490234752 sectors, 233.8 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): 59BDFEEB-1EB4-4529-94FE-3CBC2C3CD513

Partition table holds up to 128 entries

First usable sector is 34, last usable sector is 490234718

Partitions will be aligned on 8-sector boundaries

Total free space is 2604 sectors (1.3 MiB)


Number Start (sector) End (sector) Size Code Name

1 40 409639 200.0 MiB EF00 EF

2 409640 401060383 191.0 GiB AF05 Macintosh HD

3 401060384 402329919 619.9 MiB AB00 Re

4 402331648 490233848 41.9 GiB 0700 Microsoft basic data


Command (? for help): r


Recovery/transformation command (? for help): h


WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,

just hit the Enter key at the below prompt and your MBR partition table will

be untouched.


Type from one to three GPT partition numbers, separated by spaces, to be

added to the hybrid MBR, in sequence: 2 3 4

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): AF

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


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

Enter an MBR hex code (default AB): AB

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


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

Enter an MBR hex code (default 07): 07

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


Recovery/transformation command (? for help): w


Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING

PARTITIONS!!


Do you want to proceed? (Y/N): y

OK; writing new GUID partition table (GPT) to /dev/disk0.

Warning: Devices opened with shared lock will not have their

partition table automatically reloaded!

Warning: The kernel may continue to use old or deleted partitions.

You should reboot or remove the drive.

The operation has completed successfully.


6. a. Test 1 - Can you see your Bootcamp volume in Finder.

b. Test 2 - Can you files in the Bootcamp volume?

c. Test 3 - Can you see Bootcamp in your System Preferences -> Startup Disk.

d. Test 4 - If Test 1-3 are successful, select Bootcamp and click on Restart. You may need Windows startup repair, if you see a hanging underline cursor at the top left corner of your screen. In most cases, it is not required.



Here is an example...


Command (? for help): d

Partition number (1-4): 4


Command (? for help): n

Partition number (4-128, default 4): 4

First sector (34-1954210086, default = 1454210080) or {+-}size{KMGTP}: 1454211072

Last sector (1454211072-1954210086, default = 1954210086) or {+-}size{KMGTP}: 1954209791

Current type is 'Apple HFS/HFS+'

Hex code or GUID (L to show codes, Enter = AF00): 0700

Changed type of partition to 'Microsoft basic data'


Command (? for help): p

Disk /dev/disk0: 1954210120 sectors, 931.8 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): 6ED0C429-00D1-4759-B50E-04B6FB80D0E3

Partition table holds up to 128 entries

First usable sector is 34, last usable sector is 1954210086

Partitions will be aligned on 8-sector boundaries

Total free space is 1293 sectors (646.5 KiB)


Number Start (sector) End (sector) Size Code Name

1 40 409639 200.0 MiB EF00 EFI System Partition

2 409640 1452940543 692.6 GiB AF00 Customer

3 1452940544 1454210079 619.9 MiB AB00 Recovery HD

4 1454211072 1954209791 238.4 GiB 0700 Microsoft basic data

Jan 11, 2015 1:50 AM in response to Naritoat

@Loner T

Hello Loner T


I am another one with the same problem 😟 I am not good in mac os usage and terminal gymnastics) but I'm ready to try and learn... will do anything to recover win7 boot back.

here is my log:

101:~ timonpumba$ sudo fdisk /dev/disk0

Disk: /dev/disk0 geometry: 60801/255/63 [976773168 sectors]

Signature: 0xAA55

Starting Ending

#: id cyl hd sec - cyl hd sec [ start - size]

------------------------------------------------------------------------

1: EE 1023 254 63 - 1023 254 63 [ 1 - 409639] <Unknown ID>

2: AF 1023 254 63 - 1023 254 63 [ 409640 - 720414904] HFS+

3: AB 1023 254 63 - 1023 254 63 [ 720824544 - 1269536] Darwin Boot

4: 0C 1023 254 63 - 1023 254 63 [ 722094080 - 254679040] Win95 FAT32L

101:~ timonpumba$ diskutil list

/dev/disk0

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *500.1 GB disk0

1: EFI EFI 209.7 MB disk0s1

2: Apple_HFS Macintosh HD 368.9 GB disk0s2

3: Apple_Boot Recovery HD 650.0 MB disk0s3

4: Microsoft Basic Data 130.4 GB disk0s4

101:~ timonpumba$ diskutil cs list

No CoreStorage logical volume groups found

101:~ timonpumba$ sudo gpt -vv -r show /dev/disk0

gpt show: /dev/disk0: mediasize=500107862016; sectorsize=512; blocks=976773168

gpt show: /dev/disk0: Suspicious MBR at sector 0

gpt show: /dev/disk0: Pri GPT at sector 1

gpt show: /dev/disk0: Sec GPT at sector 976773167

start size index contents

0 1 MBR

1 1 Pri GPT header

2 32 Pri GPT table

34 6

40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B

409640 720414904 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC

720824544 1269536 3 GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC

722094080 254679040 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

976773120 15

976773135 32 Sec GPT table

976773167 1 Sec GPT header

101:~ timonpumba$ sudo fdisk /dev/disk0

Disk: /dev/disk0 geometry: 60801/255/63 [976773168 sectors]

Signature: 0xAA55

Starting Ending

#: id cyl hd sec - cyl hd sec [ start - size]

------------------------------------------------------------------------

1: EE 1023 254 63 - 1023 254 63 [ 1 - 409639] <Unknown ID>

2: AF 1023 254 63 - 1023 254 63 [ 409640 - 720414904] HFS+

3: AB 1023 254 63 - 1023 254 63 [ 720824544 - 1269536] Darwin Boot

4: 0C 1023 254 63 - 1023 254 63 [ 722094080 - 254679040] Win95 FAT32L


Please help 😟

Jan 11, 2015 2:41 AM in response to Loner T

Here it is:

101:~ timonpumba$ sudo dd if=/dev/rdisk0s4 count=1 2>/dev/null | hexdump -C

Password:

00000000 8d 05 62 2f 00 00 4c 0f 44 c8 eb 07 4c 8d 0d 45 |..b/..L.D...L..E|

00000010 2f 00 00 48 89 54 24 60 ba 08 00 00 00 48 8d 84 |/..H.T$`.....H..|

00000020 24 b0 00 00 00 48 89 54 24 58 48 89 44 24 50 48 |$....H.T$XH.D$PH|

00000030 89 54 24 48 48 8d 84 24 a8 00 00 00 48 89 44 24 |.T$HH..$....H.D$|

00000040 40 48 89 54 24 38 48 8d 84 24 a0 00 00 00 48 89 |@H.T$8H..$....H.|

00000050 44 24 30 48 89 4c 24 28 4c 89 4c 24 20 45 0f b7 |D$0H.L$(L.L$ E..|

00000060 c8 4c 8d 05 e8 26 00 00 ba 2b 00 00 00 49 8b ca |.L...&...+...I..|

00000070 ff 15 aa aa 00 00 48 83 c4 70 5f c3 cc cc cc cc |......H..p_.....|

00000080 cc cc cc cc 48 89 5c 24 10 48 89 74 24 18 57 41 |....H.\$.H.t$.WA|

00000090 55 41 56 48 83 ec 40 48 8b f2 48 8b 12 45 33 c9 |UAVH..@H..H..E3.|

000000a0 49 8b d8 48 8b f9 e8 25 15 ff ff 4c 8d 1d 1e 65 |I..H...%...L...e|

000000b0 00 00 48 8d 05 57 65 00 00 4c 89 1f 48 89 47 58 |..H..We..L..H.GX|

000000c0 48 8b 0d 49 a4 00 00 4c 8d 2d 42 a4 00 00 4c 8d |H..I...L.-B...L.|

000000d0 35 7b 26 00 00 49 3b cd 74 3e 8b 81 ec 01 00 00 |5{&..I;.t>......|

000000e0 a8 10 74 34 0f ba e0 1f 73 2e 48 8b 46 18 4c 8b |..t4....s.H.F.L.|

000000f0 0e 48 8b 89 d8 01 00 00 48 89 5c 24 30 48 89 44 |.H......H.\$0H.D|

00000100 24 28 48 8b 46 08 ba 0a 00 00 00 4d 8b c6 48 89 |$(H.F......M..H.|

00000110 44 24 20 e8 a8 fe ff ff 48 83 67 60 00 48 83 67 |D$ .....H.g`.H.g|

00000120 68 00 48 83 a7 80 00 00 00 00 48 83 67 70 00 48 |h.H.......H.gp.H|

00000130 8b 46 10 8b 5f 10 48 89 87 88 00 00 00 48 8b 80 |.F.._.H......H..|

00000140 88 00 00 00 48 89 47 78 8b 46 20 89 87 90 00 00 |....H.Gx.F .....|

00000150 00 85 db 0f 88 96 01 00 00 48 83 3e 00 75 3c 48 |.........H.>.u<H|

00000160 8b 0d aa a3 00 00 49 3b cd 74 26 f6 81 ec 01 00 |......I;.t&.....|

00000170 00 01 74 1d 80 b9 e9 01 00 00 02 72 14 ba 0b 00 |..t........r....|

00000180 00 00 48 8b 89 d8 01 00 00 4d 8b c6 e8 9b 18 ff |..H......M......|

00000190 ff bb 0d 00 00 c0 e9 54 01 00 00 48 83 7e 08 00 |.......T...H.~..|

000001a0 75 25 48 8b 0d 67 a3 00 00 49 3b cd 74 e3 f6 81 |u%H..g...I;.t...|

000001b0 ec 01 00 00 01 74 da 80 b9 e9 01 00 00 02 72 d1 |.....t........r.|

000001c0 ba 0c 00 00 00 eb bb 48 8b 4f 78 48 8d 54 24 60 |.......H.OxH.T$`|

000001d0 45 33 c9 48 8b 01 48 89 54 24 20 45 33 c0 ba 00 |E3.H..H.T$ E3...|

000001e0 00 00 60 ff 50 30 8b d8 3d 23 00 00 c0 74 47 48 |..`.P0..=#...tGH|

000001f0 8b 0d 1a a3 00 00 49 3b cd 74 29 f6 81 ec 01 00 |......I;.t).....|

00000200

Thank you

Jan 15, 2015 4:37 AM in response to Eugeniu_K

Eugeniu_K wrote:


Did you had a chance to review the output above?

Apologies. Did not get a chance to look. The NTFS header is missing. If you can provide a brief set of events before you got into this situation, it may help suggest a path forward.


Testdisk (http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step) has proven very handy in the past, but a bit of forensics would be very illuminating.

Boot camp lost after upgrading to Yosemite from mountain lion

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