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.

disk0s4 after resizing bootcamp

So I ran out of space on bootcamp the other day and I increased the size of it using disk utility and a program in windows (I just realized now that i shouldn't have used DU). Right now in disk utility bootcamp is now disk0s4, cannot see the disk in OS X, and I cannot boot into it after pressing option/alt at startup.


Below is the sudo commands I used after searching in the community

diskutil list

diskutil cs list

sudo gpt -vv -r show /dev/disk0

sudo fdisk /dev/disk0


Adrians-MacBook-Pro:~ adrianpan$ diskutil list

/dev/disk0

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *251.0 GB disk0

1: EFI EFI 209.7 MB disk0s1

2: Apple_HFS Macintosh HD 182.6 GB disk0s2

3: Apple_Boot Recovery HD 650.0 MB disk0s3

4: Microsoft Basic Data 60.0 GB disk0s4


Adrians-MacBook-Pro:~ adrianpan$ diskutil cs list

No CoreStorage logical volume groups found


Adrians-MacBook-Pro:~ adrianpan$ sudo gpt -vv -r show /dev/disk0

gpt show: /dev/disk0: mediasize=251000193024; sectorsize=512; blocks=490234752

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 490234751

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

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

358405848 14641448

373047296 117186560 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

490233856 863

490234719 32 Sec GPT table

490234751 1 Sec GPT header


Adrians-MacBook-Pro:~ adrianpan$ sudo fdisk /dev/disk0

Disk: /dev/disk0 geometry: 30515/255/63 [490234752 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 - 356726672] HFS+

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

4: 0C 1023 254 63 - 1023 254 63 [ 373047296 - 117186560] Win95 FAT32L

Adrians-MacBook-Pro:~ adrianpan$


How can I boot into bootcamp again?

Any help is greatly appreciated

MacBook Pro (Retina, Mid 2012), OS X Yosemite (10.10.4), Windows 7 Professional

Posted on Jul 3, 2015 1:53 PM

Reply
Question marked as Best reply

Posted on Jul 3, 2015 2:11 PM

You have a lost NTFS header due to resizing. Can you use Windows 7 Vanished after Yosemite update... help? as a reference and download GPT Fdisk and Testdisk and get started with a Testdisk scan?


Here is an example of the initial screens of the Testdisk UI - http://imgur.com/a/PjmnK .

9 replies

Jul 3, 2015 4:01 PM in response to Astralary

Here is table used for verification purposes.


GPT 3 StartGPT 3 SizeGPT 3 EndNTFS StartSector OffsetNTFS SizeNTFS EndSector Offset (MB)NTFS(Gb)
3571363121269536358405848358406144296131827705490233848 0 62.86034822


Scroll down to the second MS Data and use 'P' to list files. Your screen should look similar to the following.


User uploaded file

Jul 3, 2015 4:19 PM in response to Loner T

This one?

User uploaded file

If yes, do i just follow the steps in Windows 7 Vanished after Yosemite update... help? ??


This one: (And I am assuming every step is exactly the same except step 7 and 8 where the values for me are 358406144 and +131827705 ?)

"

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

"

disk0s4 after resizing bootcamp

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