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

Bootcamp Partition not Accessible After Resize and iTunes Update

The bootcamp partition no longer boots, nor shows up in finder. It shows in Disk Utility as disk0s4.


I'm working on this for a buddy who has sensitive files he needs off the windows side for work so I don't want to jump in and attempt this off what I have read so I'm posting here.


I believe he resized mac partition down and went from around 40 gigs to a 250 gig.


After he did an update it went out.


Here is some of the information I have seen people posting for what is needed to fix this, let me know if there is more that is needed and thanks for the help!


I have gdisk and TestDisk installed.


Johns-MBP:~ JohnRNiles$ diskutil list /dev/disk0

/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 250.0 GB disk0s2

3: Apple_Boot Recovery HD 650.0 MB disk0s3

4: Microsoft Basic Data 51.2 GB disk0s4

Johns-MBP:~ JohnRNiles$ 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 488281248 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC

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

489960424 386720792

876681216 100091904 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

976773120 15

976773135 32 Sec GPT table

976773167 1 Sec GPT header

Johns-MBP:~ JohnRNiles$ 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 - 488281248] HFS+

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

4: 0C 1023 254 63 - 1023 254 63 [ 876681216 - 100091904] Win95 FAT32L

Johns-MBP:~ JohnRNiles$ Sudo gdisk /dev/rdisk0

GPT fdisk (gdisk) version 1.0.0


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): 000009F7-721F-0000-0B16-000091490000

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 386720813 sectors (184.4 GiB)


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

1 40 409639 200.0 MiB EF00 EFI system partition

2 409640 488690887 232.8 GiB AF00 Customer

3 488690888 489960423 619.9 MiB AB00 Recovery HD

4 876681216 976773119 47.7 GiB 0700 BOOTCAMP

User uploaded file

User uploaded file

User uploaded file


Thanks!

Posted on Jul 27, 2015 5:08 PM

Reply
11 replies

Jul 27, 2015 5:36 PM in response to kumakharma

Was EFI/GPT chosen as the disk partitioning scheme before Testdisk was run? Please do not switch now. Let me make sure I can build a reasonable partition table. Do not use left/right arrow/cursor keys anywhere in Testdisk.


1. Please scroll down to the second NTFS partition at 489961472 and use 'P' to list files. Then hit Escape (only once not more than once).

2. Scroll to the last NTFS entry, and use 'P' to list files. I expect this one to be damaged.


You are looking for a listing similar to


User uploaded file



This table is based on you last Testdisk screen shot.


GPT 3 StartGPT 3 SizeGPT 3 EndNTFS StartSector OffsetNTFS SizeNTFS EndSector Offset (MB)NTFS(Gb)
488690888126953648996042448996147210484868116489767731191232.1298828


Once you post the output of the 'P' command, we can proceed further.

Jul 27, 2015 5:52 PM in response to kumakharma

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 purposes 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. 489961472 ( - Start offset in sectors or the start point for Bootcamp part)
  8. +486811648 ( - 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.

  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.

Dec 22, 2015 7:35 PM in response to Loner T

Hi - I'm having this issue as well. In tying to rebuild my partition based on your instructions, I got to the end but when I went to write the changes I got this error: "Unable to open device '/dev/rdisk0' for writing! Errno is 1! Aborting write!" Can you tell me what I am doing wrong? Thanks very much!

Dec 23, 2015 6:09 AM in response to jpar5

You have El Capitan and need to disable ELC SIP.


1. Boot into Local Recovery (Command+R).

2. Start Utilities -> Terminal.

3. Type csrutil disable in Terminal and press Enter/Return.

4. Type csrutil status.

5. Boot normally, and type csrutil status to confirm that all individual entries are still disabled.

Dec 23, 2015 7:39 PM in response to Loner T

Figured that's what it was based on some research I did, but needed confirmation, so thanks. Your instructions worked great. It now boots directly into Windows whereas it used to boot directly into the Mac OS. Can I assume all I need to do is reset the boot flag using GDISK to the Mac partition if I want it to boot to the Mac directly, with access to Windows through holding down the Option key on boot? Thanks so much again - great instructions - saved my bacon!

Bootcamp Partition not Accessible After Resize and iTunes Update

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