mikgigs

Q: restore original gpt from broken mbr in bootcamp

Hello,

 

I have a very adventurous trouble with bootcamp that almost bricked my computer.

I have installed bootcamp with Windows 7 on my Mac, since I need Windows to demo some software on OpenGL.

The problems have started when I have splitted bootcamp drive in two using Windows administrative tools to make C and D drives

since my programs were hard-coded to work from C and D drives...

And then BAM!

the windows became always crashing. and I cannot access the Macintosh HD anymore.

Moreover, it seems that Windows Administrative partitioning tool destroys the boot record(probably some hybrid MBR/GUID).

Well, the obvious (not a ) solution is to erase everything and make clean install.

In my case I would like to restore back to OSX  on the installation as it was previous to bootcamp, since there are a lot of programs installed, settings and files that unfortunately need.

I do not need BootCamp Window partitions and information there.

 

So, is there a tool of system restore disk, that could repair GUID, repair/resize partitions such as gpt gptsync, and fdisk that could restore those.

None of those those been used yet.

Or maybe there is another one.

 

I will make a not that neither OSX or Windows is working.

What I could use in the moment is that I could go in AppleStore and ask for CD drive, or plug their network with restore Images.

Unfortunately, mac associates there do not support issues with bootcamp and this is my basis for repair.

Could help me with some advice or routine how to restore my mac,

 

Thank you.

Posted on Feb 1, 2015 7:06 AM

Close

Q: restore original gpt from broken mbr in bootcamp

  • All replies
  • Helpful answers

Page 1 Next
  • by Loner T,

    Loner T Loner T Feb 1, 2015 8:56 AM in response to mikgigs
    Level 7 (23,970 points)
    Safari
    Feb 1, 2015 8:56 AM in response to mikgigs

    If you can boot into OS X, please download GPT Fdisk ( http://sourceforge.net/projects/gptfdisk/ ) and post the output of

     

    diskutil list

    sudo gpt -vv -r show /dev/disk0

     

    What year/mode is your Mac? Does it support Internet Recovery? Computers that can be upgraded to use OS X Internet Recovery - Apple Support and OS X: About OS X Recovery - Apple Support.

     

    You can also use Windows CLI diskpart to show equivalent information.

     

    If you hold Alt during power-up, what options do you get?

  • by mikgigs,

    mikgigs mikgigs Feb 1, 2015 9:45 AM in response to Loner T
    Level 1 (0 points)
    Feb 1, 2015 9:45 AM in response to Loner T

    Well, this is the problem. I can't boot in OSX.

    In AppleStore there is a network input, where I could load some system restore disk via network.

    But I am unsure whether I could install additional software.

    What I suppose is thet I could call gpt command(if i recalled properly, this probably is available).

    But I need to go and check what was the output.

     

    There is another thing. Is it possible in such situation to create a restore disk or installation disk that could boot fron USB some system restore environment where I could install and run gpt command?

  • by mikgigs,

    mikgigs mikgigs Feb 1, 2015 9:48 AM in response to mikgigs
    Level 1 (0 points)
    Feb 1, 2015 9:48 AM in response to mikgigs

    Just to add, my Windows is not working(does not run at all), no safe mode or whatever options are available.

    I could run diskpart from Windows Installation disk, but it requires a CD...

  • by Loner T,

    Loner T Loner T Feb 1, 2015 10:11 AM in response to mikgigs
    Level 7 (23,970 points)
    Safari
    Feb 1, 2015 10:11 AM in response to mikgigs

    You can use OS X: Installing OS X on an external volume - Apple Support to install on an external disk/USB (16GB or more) and boot from it. Install GPT Fdisk on this external disk.

  • by mikgigs,

    mikgigs mikgigs Feb 1, 2015 11:13 PM in response to Loner T
    Level 1 (0 points)
    Feb 1, 2015 11:13 PM in response to Loner T

    Finally I am in through USB drive.

    The  gpt command for drive0 gives the following output:

     

    gpt show: /dev/disk0: mediasize=500277790720; sectorsize=512; blocks=977105060

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

    gpt show: /dev/disk0: Bad CRC in GPT table at sector 2

          start       size  index  contents

              0          1         MBR

              1  488824831      1  MBR part 66

      488824832  385880064      2  MBR part 66

      874704896  102398116      3  MBR part 66

      977103012       2048

  • by mikgigs,

    mikgigs mikgigs Feb 1, 2015 11:15 PM in response to mikgigs
    Level 1 (0 points)
    Feb 1, 2015 11:15 PM in response to mikgigs

    Ah Yes, I have MacBook Pro Early 2013, 15 inches , Retina

  • by Loner T,

    Loner T Loner T Feb 2, 2015 4:54 AM in response to mikgigs
    Level 7 (23,970 points)
    Safari
    Feb 2, 2015 4:54 AM in response to mikgigs

    Can you post the output of diskutil list?

     

    The current disk0 is a MBR-only disk, and the Bad CRC message is not good either.

     

    Have you downloaded GPT Fdisk to your external OS X Boot disk? GPT Fdisk is better equipped to handle the bad CRC.

  • by mikgigs,

    mikgigs mikgigs Feb 2, 2015 7:45 AM in response to Loner T
    Level 1 (0 points)
    Feb 2, 2015 7:45 AM in response to Loner T

    Hello Mr. T,

     

    I have succeeded to get get info by distill . It gives the following output:

     

    Miks-MacBook-Pro:~ Mik$ diskutil /dev/disk0

    /dev/disk0

       #:                       TYPE NAME                    SIZE       IDENTIFIER

       0:     FDisk_partition_scheme                        *500.3 GB   disk0

       1:                Windows_LDM                         250.3 GB   disk0s1

       2:                Windows_LDM                         197.6 GB   disk0s2

       3:                Windows_LDM                         52.4 GB    disk0s3

    /dev/disk1

       #:                       TYPE NAME                    SIZE       IDENTIFIER

       0:      GUID_partition_scheme                        *15.5 GB    disk1

       1:                        EFI EFI                     209.7 MB   disk1s1

       2:                  Apple_HFS ins_usb                 14.6 GB    disk1s2

       3:                 Apple_Boot Recovery HD             650.0 MB   disk1s3

     

    I have downloaded gptfdisk from the link gave me above and I thought that "gpt" command is part of the package.

    How I could get drive info by fdisk? I have browsed options but no information tag have been found by me. Since it is dangerous program, I have decided not to experiment with output yet. It seems that it is important what to do and not to do.

  • by Loner T,

    Loner T Loner T Feb 2, 2015 7:57 AM in response to mikgigs
    Level 7 (23,970 points)
    Safari
    Feb 2, 2015 7:57 AM in response to mikgigs

    Your disk0 is a MBR only disk. The gpt command is part of Mac OS X, but GPT Fdisk (the command is gdisk) is installed and can be access from OS X Terminal.

     

    The Gdisk command is located in

    type gdisk

    gdisk is /usr/sbin/gdisk

  • by mikgigs,

    mikgigs mikgigs Feb 2, 2015 8:40 AM in response to Loner T
    Level 1 (0 points)
    Feb 2, 2015 8:40 AM in response to Loner T

    gdisk command gives the following

    GPT fdisk (gdisk) version 0.8.10

     

    Type device filename, or press <Enter> to exit: /dev/disk0

    Caution: invalid backup GPT header, but valid main header; regenerating

    backup header from main header.

     

    Caution! After loading partitions, the CRC doesn't check out!

    Warning! Main and backup partition tables differ! Use the 'c' and 'e' options

    on the recovery & transformation menu to examine the two tables.

     

    Warning! One or more CRCs don't match. You should repair the disk!

     

    Partition table scan:

      MBR: MBR only

      BSD: not present

      APM: not present

      GPT: damaged

     

    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

     

    Your answer: 2

    Warning! Main partition table overlaps the first partition by 34 blocks!

    You will need to delete this partition or resize it in another utility.

     

    Warning! Secondary partition table overlaps the last partition by

    4613656342287257470 blocks!

    You will need to delete this partition or resize it in another utility.

  • by mikgigs,

    mikgigs mikgigs Feb 2, 2015 8:42 AM in response to mikgigs
    Level 1 (0 points)
    Feb 2, 2015 8:42 AM in response to mikgigs

    and this is output for "p" option:

     

     

    Command (? for help): p

    Disk /dev/disk0: 977105060 sectors, 465.9 GiB

    Logical sector size: 512 bytes

     

    Disk identifier (GUID): BC41425F-6C0D-465E-ABD6-B1B8742829AE

    Partition table holds up to 128 entries

    First usable sector is 34, last usable sector is 977105026

    Partitions will be aligned on 8-sector boundaries

    Total free space is 1193 sectors (596.5 KiB)

     

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

       1              40          409639   200.0 MiB   EF00  EFI System Partition

       2          409640       487554239   232.3 GiB   AF00  Customer

       3       487554240       488823775   619.9 MiB   AB00  Recovery HD

       4       488824832       977104895   232.8 GiB   0700  BOOTCAMP

      17  18376656804508598272  4613656343264362496   2.0 ZiB     FFFF  愭㜹ⴵㄱ㑥愭㈰ⴸ㠲晣㥥㌱㠷敦

      19  4179340454199885824  4179340454210529341   5.1 GiB     FFFF  ࠀ

  • by mikgigs,

    mikgigs mikgigs Feb 2, 2015 8:46 AM in response to mikgigs
    Level 1 (0 points)
    Feb 2, 2015 8:46 AM in response to mikgigs

    for me the "p" command shows bootcamp partition before i have splitted it into 200 and 50 gb

  • by Loner T,Solvedanswer

    Loner T Loner T Feb 2, 2015 3:28 PM in response to mikgigs
    Level 7 (23,970 points)
    Safari
    Feb 2, 2015 3:28 PM in response to mikgigs

    There is 'b'(ackup) option in Gdisk that you should use as the first step. It will backup your GPT to a file of your choice, which should be copied to an external disk for safe-keeping. Once saved, delete the entries 17 and 19., and 'w'(rite) and 'y(es to confirm). This should also correct the GPT CRC.

     

    Go back into Gdisk and confirm that 17/19 have been deleted and diskutil list and sudo gpt -vv -r show /dev/disk0 show correct GPT.  Reboot and test.

     

    Resizing/re-partitioning is not allowed on a Mac after Bootcamp is installed. Please see Boot Camp 5.1: Frequently asked questions - Apple Support

     

    Can I resize the Windows partition after installing Windows?

    No. Back up your important files, then use Boot Camp Assistant to delete the old partition and create a new one.

  • by mikgigs,

    mikgigs mikgigs Feb 2, 2015 8:40 PM in response to Loner T
    Level 1 (0 points)
    Feb 2, 2015 8:40 PM in response to Loner T

    Mr. T,

    I would like to consider this case as closed, since my Mac has been restored smoothly after your consultation.

    I would like to ,y respect and thank you for your attention and spent time on my problems.

    BR,

    Mihail

Page 1 Next