Apple Event: May 7th at 7 am PT

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

El Capitan has deleted my bootcamp windows partition

I upgraded to El Capitan and now my Windows 10 partition has disappeared. After googling the problem, it seems to be related to having resized my windows partition - which I did when I upgraded to Windows 10, after upgrading to Yosemite but before upgrading to El Capitan... I attach the following screen-shot which seems to be the first of the questions that gets asked:

User uploaded file

I also tried to install gdisk 1.0.0 but I get a warning message when I do. I tried ignoring the message and installing anyway, but it seems to fail to install.


Any help would be greatly appreciated as I don't think I can face having to reinstall everything from scratch.

iMac, OS X El Capitan (10.11), Windows 10 boot camp partition

Posted on Oct 12, 2015 2:12 PM

Reply
59 replies

Oct 13, 2015 1:49 AM in response to Biggles293

Install GPT Fdisk (aka gdisk). Leave your Testdisk display and start a new Terminal Window. You need to use the following steps. If you see any error messages during the following steps, please stop and post back here with the error message. The following steps have values from your Testdisk output (and you can verify) in Steps 7 and 8. Please notice the'+' sign in step 8 (this is called offset notation). The text in parentheses is for informational purpose to describe the action being taken. Gdisk has one-character commands except when entering numbers.


Rebuild GPT4 using start/end offsets


  1. Sudo gdisk /dev/rdisk0
  2. P (print the full list of parts)
  3. D (delete)
  4. 4 (part 4)
  5. N (new part)
  6. 4 (part 4)
  7. 509906944 ( - Start offset in sectors or the start point for Bootcamp part)
  8. +115234809 ( - Size offset, as opposed to End offset)
  9. 0700 (Windows part type)
  10. P (print list of all parts just to see what changes will be made)
  11. W (Write the new GPT)
  12. Y (Yes! really write the new GPT)

This will delete and re-write the GPT partition info for /dev/disk0s4.

Rebuild MBR to match the new GPT information thus resetting the Hybrid MBR. Use defaults for other questions (like partition codes). The only values that need modifications are the Boot flags and step 10. Accept all other defaults that Gdisk offers. Please see thesample Q&A as an example. These steps can be repeated if you make a mistake before you get to Step 12, otherwise start from Step 1 for these steps. Step 6 has numbers which are typed with a space between the numbers. Please see the sample Q&A before you execute these steps.

  1. Sudo gdisk /dev/rdisk0
  2. P (Print list of parts)
  3. R (Recover)
  4. O (print current Hybrid MBR)
  5. H (chooses Hybrid)
  6. Partitions numbers to be hybridized: 2 3 4
  7. Y (Good for GRUB question)
  8. N (part 2 boot flag)
  9. N (part 3 boot flag)
  10. Y (part 4 boot flag make NTFS bootable partition)
  11. O (print current Hybrid MBR)
  12. W (Write the new MBR)
  13. Y (Yes! write the new MBR)
  14. Reboot


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


Test 1 - Does Bootcamp Volume show up in Finder?

Test 2 - Can you see files in Bootcamp Volume?

Test 3 - Can you select Bootcamp in System Preferences -> Startup Disk?

Test 4 - If Test 3 is successful, select Bootcamp and Click Restart.

Oct 12, 2015 3:55 PM in response to Loner T

Sorry for being dumb but I want to get this right...


The start and size numbers being referred to. Are they the ones taken from the screen shot above?


i.e. in my case: start of 509906944 and size of +115234809


Or am I supposed to be using the figures from the BOOTCAMP line of this output?


User uploaded file


And also what is the windows part type? I'm running Windows 10, should I still type 0700?

Oct 12, 2015 4:43 PM in response to Loner T

You my friend, are a legend!!


You must get so fed up of the same stupid questions over and over again, but I really appreciate your time. Thank you so much.


Now I just have to work out how to tell the stupid thing that I am not using an apple mouse so it has additional buttons that can be used, and I'll be sorted. But I think I will leave that for another day...


Do I need to do anything with csrutil in order to remove the disable I did earlier? Or will have defaulted back to safe again upon rebooting?


Thanks again 🙂

Oct 19, 2015 5:17 PM in response to Loner T

Hi Loner T

I followed all the steps but Bootcamp still missing.

this is exactly what I did please let me know which part wasn't correct.

Thank you for your time


Last login: Mon Oct 19 16:56:53 on console

Lauras-iMac:~ I-mac-lbds$ Sudo gdisk /dev/rdisk0

Password:

GPT fdisk (gdisk) version 1.0.1


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/rdisk0: 976773168 sectors, 465.8 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): 68FB0390-3648-4705-BF3D-715A7E00AE28

Partition table holds up to 128 entries

First usable sector is 34, last usable sector is 976773134

Partitions will be aligned on 8-sector boundaries

Total free space is 461 sectors (230.5 KiB)


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

1 40 409639 200.0 MiB EF00 EFI System Partition

2 409640 648847143 309.2 GiB AF00 Macintosh HD

3 648847144 650116679 619.9 MiB AB00 Recovery HD

4 650117120 976773119 155.8 GiB 0700 BOOTCAMP


Command (? for help): D

Partition number (1-4): 4


Command (? for help): N

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

First sector (34-976773134, default = 650116680) or {+-}size{KMGTP}: 650117200

Last sector (650117200-976773134, default = 976773134) or {+-}size{KMGTP}: +326656000

Last sector (650117200-976773134, default = 976773134) or {+-}size{KMGTP}: +326656300

Last sector (650117200-976773134, default = 976773134) or {+-}size{KMGTP}: +326655900

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/rdisk0: 976773168 sectors, 465.8 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): 68FB0390-3648-4705-BF3D-715A7E00AE28

Partition table holds up to 128 entries

First usable sector is 34, last usable sector is 976773134

Partitions will be aligned on 8-sector boundaries

Total free space is 561 sectors (280.5 KiB)


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

1 40 409639 200.0 MiB EF00 EFI System Partition

2 409640 648847143 309.2 GiB AF00 Macintosh HD

3 648847144 650116679 619.9 MiB AB00 Recovery HD

4 650117200 976773099 155.8 GiB 0700 Microsoft basic data


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/rdisk0.

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.

Lauras-iMac:~ I-mac-lbds$ Sudo gdisk /dev/rdisk0

Password:

Sorry, try again.

Password:

GPT fdisk (gdisk) version 1.0.1


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/rdisk0: 976773168 sectors, 465.8 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): 68FB0390-3648-4705-BF3D-715A7E00AE28

Partition table holds up to 128 entries

First usable sector is 34, last usable sector is 976773134

Partitions will be aligned on 8-sector boundaries

Total free space is 561 sectors (280.5 KiB)


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

1 40 409639 200.0 MiB EF00 EFI System Partition

2 409640 648847143 309.2 GiB AF00 Macintosh HD

3 648847144 650116679 619.9 MiB AB00 Recovery HD

4 650117200 976773099 155.8 GiB 0700 Microsoft basic data


Command (? for help): R


Recovery/transformation command (? for help): O


Disk size is 976773168 sectors (465.8 GiB)

MBR disk identifier: 0xC1CB4021

MBR partitions:


Number Boot Start Sector End Sector Status Code

1 1 409639 primary 0xEE

2 409640 648847143 primary 0xAF

3 648847144 650116679 primary 0xAB


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

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


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

Enter an MBR hex code (default AB):

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


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

Enter an MBR hex code (default 07):

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


Recovery/transformation command (? for help): O


Disk size is 976773168 sectors (465.8 GiB)

MBR disk identifier: 0xC1CB4021

MBR partitions:


Number Boot Start Sector End Sector Status Code

1 1 409639 primary 0xEE

2 409640 648847143 primary 0xAF

3 648847144 650116679 primary 0xAB

4 * 650117200 976773099 primary 0x07


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/rdisk0.

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.

Lauras-iMac:~ I-mac-lbds$

Oct 19, 2015 6:11 PM in response to Sean_fa

Can you start a new thread and post some of your Testdisk screens? Without seeing the context, it is hard to see what could be wrong. The obvious issue are the three different sizes tested?


Last sector (650117200-976773134, default = 976773134) or {+-}size{KMGTP}: +326656000

Last sector (650117200-976773134, default = 976773134) or {+-}size{KMGTP}: +326656300

Last sector (650117200-976773134, default = 976773134) or {+-}size{KMGTP}: +326655900

Oct 21, 2015 11:55 AM in response to Loner T

Thank you for your quick response, here is the result of some command I ran before those steps.

I am not sure about step 7 and 8!


Lauras-iMac:~ I-mac-lbds$ sudo gpt -r -vv show disk0

Password:

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

gpt show: disk0: Suspicious MBR at sector 0

gpt show: disk0: Pri GPT at sector 1

gpt show: 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 648437504 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC

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

650116680 440

650117120 326656000 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

976773120 15

976773135 32 Sec GPT table

976773167 1 Sec GPT header

Lauras-iMac:~ I-mac-lbds$ 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 - 648437504] HFS+

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

4: 0C 1023 254 63 - 1023 254 63 [ 650117120 - 326656000] Win95 FAT32L

Lauras-iMac:~ I-mac-lbds$ diskutil list

/dev/disk0 (internal, physical):

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *500.1 GB disk0

1: EFI EFI 209.7 MB disk0s1

2: Apple_HFS Macintosh HD 332.0 GB disk0s2

3: Apple_Boot Recovery HD 650.0 MB disk0s3

4: Microsoft Basic Data 167.2 GB disk0s4

Lauras-iMac:~ I-mac-lbds$


Oct 21, 2015 1:27 PM in response to Loner T

Here is the output:


Lauras-iMac:~ I-mac-lbds$ sudo dd if=/dev/rdisk0s4 count=1 2>/dev/null | hexdump -C

Password:

00000000 00 00 00 00 00 00 00 00 00 43 00 6c 00 65 00 61 |.........C.l.e.a|

00000010 00 6e 00 4e 00 49 00 43 00 61 00 63 00 68 00 65 |.n.N.I.C.a.c.h.e|

00000020 00 00 00 00 00 00 00 00 00 4e 00 67 00 65 00 6e |.........N.g.e.n|

00000030 00 55 00 70 00 64 00 61 00 74 00 65 00 48 00 69 |.U.p.d.a.t.e.H.i|

00000040 00 67 00 68 00 65 00 73 00 74 00 56 00 65 00 72 |.g.h.e.s.t.V.e.r|

00000050 00 73 00 69 00 6f 00 6e 00 00 00 00 00 00 00 00 |.s.i.o.n........|

00000060 00 43 00 68 00 65 00 63 00 6b 00 53 00 65 00 72 |.C.h.e.c.k.S.e.r|

00000070 00 76 00 69 00 63 00 65 00 00 00 00 00 00 00 00 |.v.i.c.e........|

00000080 00 00 00 00 00 00 00 00 00 43 00 61 00 6e 00 6e |.........C.a.n.n|

00000090 00 6f 00 74 00 20 00 6f 00 70 00 65 00 6e 00 20 |.o.t. .o.p.e.n. |

000000a0 00 53 00 65 00 72 00 76 00 69 00 63 00 65 00 20 |.S.e.r.v.i.c.e. |

000000b0 00 43 00 6f 00 6e 00 74 00 72 00 6f 00 6c 00 20 |.C.o.n.t.r.o.l. |

000000c0 00 4d 00 61 00 6e 00 61 00 67 00 65 00 72 00 2e |.M.a.n.a.g.e.r..|

000000d0 00 20 00 4f 00 70 00 65 00 6e 00 53 00 43 00 4d |. .O.p.e.n.S.C.M|

000000e0 00 61 00 6e 00 61 00 67 00 65 00 72 00 20 00 72 |.a.n.a.g.e.r. .r|

000000f0 00 65 00 74 00 75 00 72 00 6e 00 65 00 64 00 20 |.e.t.u.r.n.e.d. |

00000100 00 4e 00 55 00 4c 00 4c 00 2e 00 00 00 00 00 00 |.N.U.L.L........|

00000110 00 00 00 00 00 00 00 00 00 53 00 65 00 72 00 76 |.........S.e.r.v|

00000120 00 69 00 63 00 65 00 20 00 43 00 6f 00 6e 00 74 |.i.c.e. .C.o.n.t|

00000130 00 72 00 6f 00 6c 00 20 00 4d 00 61 00 6e 00 61 |.r.o.l. .M.a.n.a|

00000140 00 67 00 65 00 72 00 20 00 6f 00 70 00 65 00 6e |.g.e.r. .o.p.e.n|

00000150 00 65 00 64 00 20 00 6f 00 6b 00 00 00 00 00 00 |.e.d. .o.k......|

00000160 00 69 00 69 00 73 00 61 00 64 00 6d 00 69 00 6e |.i.i.s.a.d.m.i.n|

00000170 00 00 00 00 00 00 00 00 00 43 00 61 00 6e 00 6e |.........C.a.n.n|

00000180 00 6f 00 74 00 20 00 6f 00 70 00 65 00 6e 00 20 |.o.t. .o.p.e.n. |

00000190 00 73 00 65 00 72 00 76 00 69 00 63 00 65 00 20 |.s.e.r.v.i.c.e. |

000001a0 00 27 00 69 00 69 00 73 00 61 00 64 00 6d 00 69 |.'.i.i.s.a.d.m.i|

000001b0 00 6e 00 27 00 20 00 77 00 69 00 74 00 68 00 20 |.n.'. .w.i.t.h. |

000001c0 00 27 00 53 00 45 00 52 00 56 00 49 00 43 00 45 |.'.S.E.R.V.I.C.E|

000001d0 00 5f 00 41 00 4c 00 4c 00 5f 00 41 00 43 00 43 |._.A.L.L._.A.C.C|

000001e0 00 45 00 53 00 53 00 27 00 2e 00 20 00 4f 00 70 |.E.S.S.'... .O.p|

000001f0 00 65 00 6e 00 53 00 65 00 72 00 76 00 69 00 63 |.e.n.S.e.r.v.i.c|

00000200

Lauras-iMac:~ I-mac-lbds$


Oct 21, 2015 1:41 PM in response to Loner T

Lauras-iMac:~ I-mac-lbds$ sudo gpt -r -vv show disk0

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

gpt show: disk0: Suspicious MBR at sector 0

gpt show: disk0: Pri GPT at sector 1

gpt show: 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 648437504 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC

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

650116680 440

650117120 326656000 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

976773120 15

976773135 32 Sec GPT table

976773167 1 Sec GPT header

Lauras-iMac:~ I-mac-lbds$ 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 0 0 2 - 25 127 14 [ 1 - 409639] <Unknown ID>

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

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

*4: 07 1023 254 63 - 1023 254 63 [ 650117120 - 326656000] HPFS/QNX/AUX

Lauras-iMac:~ I-mac-lbds$ diskutil list

/dev/disk0 (internal, physical):

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *500.1 GB disk0

1: EFI EFI 209.7 MB disk0s1

2: Apple_HFS Macintosh HD 332.0 GB disk0s2

3: Apple_Boot Recovery HD 650.0 MB disk0s3

4: Microsoft Basic Data 167.2 GB disk0s4

Lauras-iMac:~ I-mac-lbds$

Oct 21, 2015 2:23 PM in response to Sean_fa

Sean_fa wrote:


Sorry I'm not sure how to run Testdisk Quick Search!

Was it what you asked for?

If you have not run Testdisk, you do not have valid values for steps 7 and 8 as marked in the solution.


Start on the first page of this discussion, which has the steps for downloading and running Testdisk.


You can also look at http://imgur.com/a/PjmnK , but stop at the ninth (9th) image and post a screen shot.


I suggest you start a new discussion to avoid confusion and use this thread as a reference only.

El Capitan has deleted my bootcamp windows partition

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