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

Fixing missing Bootcamp partition after Mavericks rewrote wrong GPT

User uploaded filePreviously resized my boot camp partition (manually)


Installed Mavericks


Boot Camp disappeared


Disk0s4 is visible in Disk utility but reflects the OLD disk size (pre-resize) and additional space (available for OSX expansion) now appears in its place


[REDACTED] sudo gpt -r -vv show disk0


WARNING: Improper use of the sudo command could lead to data loss

or the deletion of important system files. Please double-check your

typing when using sudo. Type "man sudo" for more information.


To proceed, enter your password, or type Ctrl-C to abort.


Password:

gpt show: disk0: mediasize=240057409536; sectorsize=512; blocks=468862128

gpt show: disk0: Suspicious MBR at sector 0

gpt show: disk0: Pri GPT at sector 1

gpt show: disk0: Sec GPT at sector 468862127

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 312500000 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC

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

314179176 76558744

390737920 78123008 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

468860928 1167

468862095 32 Sec GPT table

468862127 1 Sec GPT header

[REDACTED] sudo fdisk /dev/disk0

Disk: /dev/disk0 geometry: 29185/255/63 [468862128 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 - 312500000] HFS+

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

4: 0C 1023 254 63 - 1023 254 63 [ 390737920 - 78123008] Win95 FAT32L

[REDACTED ]

MacBook, OS X Mavericks (10.9)

Posted on Nov 29, 2013 6:04 PM

Reply
59 replies

Nov 29, 2013 6:07 PM in response to taibanl

Nov 14, 2013


Re: Repairing Boot Camp after creating new partition


Well this thread has maybe half a dozen differently problems and solutions with the single manifestation of Windows not booting or being visible. So it's not really one problem even though it seems to be.


Yours is mostly described from page 52 onward I think. It's a case of resizing the OS X partition with Disk Utility to create free space, and then resizing Windows from within Windows to use that free space. So you'll need to install and go through all of the testdisk stuff and find out where the true start and end sectors values are for the NTFS (resized) volume, and then use gdisk to fix the GPT so it has correct information, and then create a new hybrid MBR also with gdisk.

Nov 29, 2013 6:09 PM in response to taibanl

Loner T



Testdisk seems to be guessing. Can you peek into one of the partitions and look at a listing of the files? I am not sure how you have managed to have two partitions end at 468860920 and 468860927? And the third one is at 468862087?


If you are willing to take a risk, what happens if you make partition #4 (in fdisk output) as bootable? (See page 54+ in this thread).

Nov 30, 2013 6:33 AM in response to taibanl

I will let Christopher comment on these before you take any action...


1. The first MS data partition can be deleted.

2. The third MS data partition can be deleted.

3. The Second MS data partition should be used for booting Windows using fdisk. (This is the one where you have files).


If you can get Windows to boot, I would backup any data that you need to an external drive. Delete the BOOTCAMP partitions, return your disk to a single OS X disk (it will still have recovery, EFI, etc.).


At this point, you should be able to start over again. I am not sure how painful it is for you to redo customization that you may have made to teh Windows side.

Dec 1, 2013 2:07 PM in response to taibanl

Use gdisk to delete partition 4, start sector value is 390737920. Create a new partition, which should default to 4, start value 369709056, end value 468860920, type code 0700. Then create a new hybrid MBR adding partitions 2 3 4; you do want EFI GPT in the first MBR entry; you only want partition 4 marked bootable, and for the type codes accept the default for all. Then write out the new partition table and reboot.

Dec 2, 2013 9:18 PM in response to taibanl

I could really use some help. I've tried numerous things to try and recover my bootcamp partition without any luck. Can someone tell me if anything specifically stands out from my the results shown below. I've ran gdisk, testdisk, fdisk and so on... I originally couldnt even get the BOOTCAMP drive to show up but after running testdisk it came back. However, I cant read the contents in that partition. I figured that my BOOTCAMP partition would not be touched when upgrading to Mavericks but I guess I was wrong and should have backed up my BOOTCAMP also.



Andress-iMac:~ andressosa$ sudo gpt -r -v show /dev/rdisk0

gpt show: /dev/rdisk0: mediasize=1000204886016; sectorsize=512; blocks=1953525168

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

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 586621080 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC

587030720 1269544 3 GPT part - 48465300-0000-11AA-AA11-00306543ECAC

588300264 1269536 4 GPT part - 48465300-0000-11AA-AA11-00306543ECAC

589569800 248

589570048 1363953664 5 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

1953523712 1423

1953525135 32 Sec GPT table

1953525167 1 Sec GPT header

Andress-iMac:~ andressosa$ sudo fdisk /dev/rdisk0

Disk: /dev/rdisk0 geometry: 121601/255/63 [1953525168 sectors]

Signature: 0xAA55

Starting Ending

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

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

1: EE 0 0 2 - 1023 254 63 [ 1 - 589570047] <Unknown ID>

*2: 07 1023 254 63 - 1023 254 63 [ 589570048 - 1363953664] HPFS/QNX/AUX

3: 00 0 0 0 - 0 0 0 [ 0 - 0] unused

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



gdisk results


Recovery/transformation command (? for help): o


Disk size is 1953525168 sectors (931.5 GiB)

MBR disk identifier: 0x24112411

MBR partitions:


Number Boot Start Sector End Sector Status Code

1 1 409639 primary 0xEE

2 409640 587030719 primary 0xAF

3 587030720 588300263 primary 0xAF

4 * 589570048 1953523711 primary 0x07



testdisk results



Disk /dev/rdisk0 - 1000 GB / 931 GiB - 1953525168 sectors

Partition Start End Size in sectors

P EFI System 40 409639 409600 [EFI]

P Mac HFS 409640 587030719 586621080

P Mac HFS 587030720 588300263 1269544

P Mac HFS 588300264 589569799 1269536

> MS Data 589570048 1953523711 1363953664 [BOOTCAMP]

Mac HFS 1952255592 1953525127 1269536



this is what I see when I view the contents in the BOOTCAMP partition-->


MS Data 589570048 1953523711 1363953664 [BOOTCAMP]

Directory /


>-rwxr-xr-x 0 0 4096 6-Jan-2013 18:12 ._.Trashes

drwxr-xr-x 0 0 0 6-Jan-2013 18:12 _RASHE~1.WWP

drwxr-xr-x 0 0 0 6-Jan-2013 18:12 .Trashes

drwxr-xr-x 0 0 0 2-Dec-2013 23:03 .fseventsd

drwxr-xr-x 0 0 0 6-Jan-2013 18:12 .Spotlight-V100

drwxr-xr-x 0 0 0 13-Jan-2013 08:55 .TemporaryItems

-rwxr-xr-x 0 0 4096 13-Jan-2013 08:55 ._.TemporaryItems

-rwxr-xr-x 0 0 294 13-Jan-2013 08:55 .apdisk

-rwxr-xr-x 0 0 4096 13-Jan-2013 08:55 ._.apdisk

drwxr-xr-x 0 0 0 3-Dec-2013 02:42 Temp

MS Data 589570048 1953523711 1363953664 [BOOTCAMP]


Dec 3, 2013 6:28 AM in response to andsosa

The GPT seems to be corrupted.


587030720 1269544 3 GPT part - 48465300-0000-11AA-AA11-00306543ECAC

588300264 1269536 4 GPT part - 48465300-0000-11AA-AA11-00306543ECAC


The partition sized 1269536 looks to be Recovery HD. The fdisk id should be '0xAB' not '0xAF'.


Christopher has mentioned steps for a GPT fix somewhere in the last couple of pages.


Mavericks installer tried very hard to create a recovery hd for you as shown here...


Mac HFS 1952255592 1953525127 1269536



Spotlight has written some indexing information to the bootcamp partition (like .spotlight-v100...).


Can you peek into these two partitions


P Mac HFS 587030720 588300263 1269544

P Mac HFS 588300264 589569799 1269536


Your OS X installation is here (testdisk directory listing can verify that)...


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


Dec 3, 2013 3:27 PM in response to Loner T

Thanks for the reply


The GPT seems to be corrupted.


587030720 1269544 3 GPT part - 48465300-0000-11AA-AA11-00306543ECAC

588300264 1269536 4 GPT part - 48465300-0000-11AA-AA11-00306543ECAC


The partition sized 1269536 looks to be Recovery HD. The fdisk id should be '0xAB' not '0xAF'.


Christopher has mentioned steps for a GPT fix somewhere in the last couple of pages.


Where? This is a 1 page thread... are you refering to another thread? Is this using gdisk?

I have a question regarding gdisk... if I run it on /dev/rdiskX


Found valid MBR and corrupt GPT. Which do you want to use? (Using the

GPT MAY permit recovery of GPT data.)

1 - MBR

2 - GPT

3 - Create blank GPT

If I run it on dev/diskX (without the r) I get this.

Andress-iMac:~ andressosa$ sudo gdisk /dev/disk0

GPT fdisk (gdisk) version 0.8.8


Partition table scan:

MBR: hybrid

BSD: not present

APM: not present

GPT: present


Found valid GPT with hybrid MBR; using GPT.


Mavericks installer tried very hard to create a recovery hd for you as shown here...


Mac HFS 1952255592 1953525127 1269536



Spotlight has written some indexing information to the bootcamp partition (like .spotlight-v100...).


Do I need to do something with this? or are you just trying to describe what you see?


Can you peek into these two partitions


P Mac HFS 587030720 588300263 1269544

P Mac HFS 588300264 589569799 1269536


I dont think so. this is what I get in testdisk when I try and look in the partitions.--->

P Mac HFS 409640 587030719 586621080




Support for this filesystem hasn't been enable during compilation.






Your OS X installation is here (testdisk directory listing can verify that)...


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


Currently, my OS X partition works and have no issues with it... Thanks again for the help.

Dec 3, 2013 4:39 PM in response to andsosa

1. Apologies, I had two threads confused. Please take a look here - https://discussions.apple.com/thread/4144252?start=795&tstart=0


2. gdisk behaves the same (at least in my case) whether using /disk0 or /rdisk0. The warning you get is more than likely as I indicated due to GPT corruption.


sudo gdisk -l /dev/disk0

GPT fdisk (gdisk) version 0.8.8


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.

Disk /dev/disk0: 976773168 sectors, 465.8 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): 20AF5D01-E936-451D-91DD-A6BA43918D0B

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 653 sectors (326.5 KiB)


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

1 40 409639 200.0 MiB EF00 EFI System Partition

2 409640 725503591 345.8 GiB AF00 Customer

3 725503592 726773127 619.9 MiB AB00 Recovery HD

4 726773760 976773119 119.2 GiB 0700 BOOTCAMP


sudo gdisk -l /dev/rdisk0

Password:

GPT fdisk (gdisk) version 0.8.8


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.

Disk /dev/rdisk0: 976773168 sectors, 465.8 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): 20AF5D01-E936-451D-91DD-A6BA43918D0B

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 653 sectors (326.5 KiB)


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

1 40 409639 200.0 MiB EF00 EFI System Partition

2 409640 725503591 345.8 GiB AF00 Customer

3 725503592 726773127 619.9 MiB AB00 Recovery HD

4 726773760 976773119 119.2 GiB 0700 BOOTCAMP


3. Your Bootcamp partition seems to have your data.


4. The reason I am suspicious about your GPT entries is because GPT 2,3,4 have the same UUID. Here is what I have on my machine.


sudo gpt -r -v show /dev/rdisk0

Password:

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

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

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 725093952 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC

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

726773128 632

726773760 249999360 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

976773120 15

976773135 32 Sec GPT table

976773167 1 Sec GPT header


Hope that helps clarify.

Dec 3, 2013 4:46 PM in response to andsosa

I doubt the GPT is corrupt or we'd see some consistency in the warning. I've seen this behavior before, it's variably cropped up with different OS X releases and it seems to be a bogus message because when I use dd to extract the sector data with rdisk0 and disk0, they are the same even though on 10.8.5 I get a corruption warning when I use disk0 but not when I use rdisk0. Also, when I reboot linux and run gdisk there, I don't get such a warning (and there is no distinction between raw and character devices there).


The Test Disk partition starting LBA 589570048 and ending LBA 1953523711 is probably what's corrupt which is why it's seen as a bootcamp volume yet the file listing looks like it's previously an OS X HFS+ volume. There may be another option for test disk to do more scanning, which would take a while, to find other candidates (which may not be listed as bootcamp). You just have to try all the suggestions or write off the data as a loss.


Partitions 2, 3 and 4 all have the partitiontypeGUID consistent with a conventional HFS+ volume. So based on those partitiontypeGUIDs I don't expect them to be Recovery HDs. And I can't think of why their partition type GUID would be incorrect or why there are three of them, other than user error. By that I mean adding, subtracting, or resizing *any* partition on a disk that has been previously prepared with Boot Camp Assistant. Apple certainly has made this less than clear, and of course there are no warnings in Disk Utility either which makes this extra irritating.


http://support.apple.com/kb/HT5639


How can a Windows partition be resized after Windows is installed?

You need to delete the Windows partition using the Boot Camp Assistant, and start over to change the size of the Windows partition. Back up your important Windows files first.

Fixing missing Bootcamp partition after Mavericks rewrote wrong GPT

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