Mavericks Destroyed Bootcamp Partition

Discussion in 'Windows, Linux & Others on the Mac' started by JanMueller, Oct 23, 2013.

  1. JanMueller macrumors newbie

    Joined:
    Oct 23, 2013
    #1
    Hey, I installed Mavericks over Mountain Lion (not a clean install) and it worked perfectly. However, my windows 7 bootcamp partition no longer shows up as a bootable option and under disk utility shows up as disk0s4. When I try to repair it this happens:

    Verify and Repair volume “disk0s4”Checking file system** /dev/disk0s4
    Invalid BS_jmpBoot in boot block: 010101
    Volume repair complete.Updating boot support partitions for the volume as required.Error: Disk Utility can’t repair this disk. Back up as many of your files as possible, reformat the disk, and restore your backed-up files.

    When I start boot camp-assistent it says something like "Before using this assistent, you must update the Boot ROM firmware to your computer."

    Any ideas how to fix this? Thank you!
     
  2. murphychris macrumors 6502a

    Joined:
    Mar 19, 2012
    #2
    OS X is so incredibly stupid sometimes. I think I know what's happened but you need to provide the output from these read-only commands:

    Code:
    sudo fdisk /dev/rdisk0
    sudo gpt -r -vv show /dev/rdisk0
    In particular, if the fdisk (MBR output) shows the 4th partition is 0C without an asterisk; and if the gpt output shows a large number of unallocated sectors between partition 3 and 4, you are really deep in the weeds. Hope is not lost, the data is OK, but recovering it is a really deep dark rabbit hole. There's no magic button to fix it. But let's see the output from those two commands.
     
  3. rgarjr macrumors 603

    rgarjr

    Joined:
    Apr 2, 2009
    Location:
    Southern Cal
    #3
    I have the same problem. Installed Mavericks over ML and when I hold the option key at boot up, the Windows Partition does not show up.
     
  4. murphychris macrumors 6502a

    Joined:
    Mar 19, 2012
    #4
    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."

    Anyone who goes to Disk Utility to resize their OS X partition to create free space, and then goes to Windows to resize the Windows volume using that newly created free space will find that Windows vanishes upon any major OS X upgrade. This happens with 10.7, 10.8 and 10.9.

    When doing the resize this way, the Windows utility only updates the MBR partition map, not the GPT. When the installer scripts find the GPT and MBR aren't in sync'd it wipes out the correct MBR and replaces it with the wrong GPT information, causing Windows to vanish.

    Because the necessary information to find Windows is only in the MBR, when resizing in this manner, once it's replaced during the OS X upgrade process the information is lost and it becomes a major data rescue operation to get it back.

    So if you want to prevent it, you need to fix the GPT before you start the OS X upgrade. There are no GUI tools to fix this. Apple's tools always defer to the GPT. It's much, much easier to fix this before starting the OS X upgrade.
     
  5. rgarjr macrumors 603

    rgarjr

    Joined:
    Apr 2, 2009
    Location:
    Southern Cal
    #5
    Unfortunately a lot of folks do the shrink dragging on Disk Utility, followed by a Windows utility to gain more disk space on their Windows partition.
     
  6. murphychris macrumors 6502a

    Joined:
    Mar 19, 2012
    #6
    Yes I know. Apparently Apple, after years of this, either hasn't figured it out, or they don't care. I think they don't care, because -sarcasm- why would people want to use Windows on a Mac anyway, and if they do, well it's Windows so problems are normal -sarcasm-.

    Disk Utility should disallow the user from making modifications to partition layout once the disk has been Bootcamp'd except for completely repartitioning the disk (destroying all data), after first confirming this is what the user wants and makes them type an admin password. The frustration that would be caused by being disallowed to use Disk Utility to resize for no apparent reason, is better than the ensuing data loss that occurs without warning and no apparent reason which is the way things have been since 10.7 came out.

    And there's another manifestation of this which is if the user creates an extra partition on a Bootcamp'd disk rather than just leaving it as free space. That also causes Windows to become unbootable. Without warning.
     
  7. Chamak macrumors newbie

    Joined:
    May 20, 2012
    #7
    Always have been a silent reader, so first time post here. I have a MBP (15" Late 2011) at home that me and my wife share (I use mac, while she uses windows 7 sp1).

    Now to the point. I had created three partitions (For 512gb drive) as below:
    step1: Created a bootcamp partition of 80GB
    step2: Shrinked OSX partition to 256 gb using disk utility
    step3: Created a 170gb partition using disk utility and formatted to exFat
    step4: Installed windows 7 on bootcamp partition

    Now, before I update to Maverick, I'm trying to make sure that the Bootcamp partition remains usable. After all, the wify uses it, and had it been crashed, it'll be kinda life risk! :D ;)
    So, I need the expert's advise for this, whether it is safe for me to update or not. For your clearer understanding here are the output of two commands mentioned above:

    sudo fdisk /dev/rdisk0

    Disk: /dev/rdisk0 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: 07 1023 254 63 - 1023 254 63 [ 488953856 - 331571200] HPFS/QNX/AUX
    *4: 07 1023 254 63 - 1023 254 63 [ 820525056 - 156248064] HPFS/QNX/AUX

    gpt -r -vv show /dev/rdisk0

    gpt show: /dev/rdisk0: mediasize=500107862016; sectorsize=512; blocks=976773168
    gpt show: /dev/rdisk0: Suspicious MBR at sector 0
    gpt show: /dev/rdisk0: Pri GPT at sector 1
    gpt show: /dev/rdisk0: 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 262968
    488953856 331571200 3 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
    820525056 156248064 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
    976773120 15
    976773135 32 Sec GPT table
    976773167 1 Sec GPT header

    Many many thanks for your time reading this. :)

    P.S. I'm not a computer noob :p, but new to this scene. So, don't want to take risks w/o pre-cautions. Thanks.
     
  8. murphychris macrumors 6502a

    Joined:
    Mar 19, 2012
    #8
    @Chamak
    Your situation is different than described. You haven't resized the Windows volume to use the free space created by resizing the OS X volume. You created a new exFAT volume. In a way you've lucked out because most people have a Recovery HD partition, which for some reason you don't have. If you had, you'd have experienced the loss of Windows immediately upon creating the extra partition.

    So the difficulty you're in now, is that I have one anecdotal case of upgrading to 10.9 and Recovery HD was added, bumping the total number of partitions to 5, and the hybrid MBR being replaced with a protective MBR: meaning the loss of Windows bootability, if this is reproducible.

    If it is reproducible the only way to avoid it is to remove the exFAT partition in advance of upgrading, and making sure the GPT and MBR are sync'd. Since I haven't tested your particular layout, and upgraded it to 10.9 myself, I can't tell you for sure what's going to happen.

    My recommendation is to make backups in any case.
     
  9. yjchua95 macrumors 604

    Joined:
    Apr 23, 2011
    Location:
    GVA, KUL, MEL (current), ZQN
    #9
    Well surprise, I upgraded from 10.8.5 to Mavericks on my Sandy Bridge MBP and my Boot Camp partition was still preserved.

    Not sure if enabling a firmware password makes a difference (I enabled it on mine).

    PS I only use Windows to play Need for Speed.
     
  10. Chamak macrumors newbie

    Joined:
    May 20, 2012
    #10
    I deliberately deleted the recovery partition since I had created recovery USB earlier.

    As for up-gradation if I have understood correctly, you suggest:

    1. Backup Mac Partition
    2. Backup exFat and windows partition
    3. Delete exFat partition and merge it with OSX partition using disk utility
    4. Update to maverick
    5. After update shrink OSX partition and create exFat partition again with disk utility
    6. restore backup of exFat partition

    am I correct?

    Next question, I need to know 'bout any s/w which:
    a. Can take an image backup with boot records of the full 512GB drive to an external drive
    b. Can use recovery CD/DVD to restore from the backup. It needs to restore the backup in such a way that the system won't even understand something happened! Boot, Partitions and Data to be kept exactly like it were during backup process
    c. Obviously better products don't come cheap, but a cost effective (read free!) solution is much more preferred!

    So many thanks for the heads up! Really appreciated.
     
  11. Chamak macrumors newbie

    Joined:
    May 20, 2012
    #11
    Well I finally did it! Steps and knowledge sharing for anyone interested out there.

    1. Backed up data from all three partitions [Main, maEva, BOOTCAMP]
    2. Removed maEva
    3. Expanded Main partition to fill-up blank space
    4. Updated to maverick
    =======================================
    At this point I have two partitions shown into diskutil
    a. Main
    b. Bootcamp
    Restarted and windows booted normally
    =======================================
    5. Booted into Mac, shrinked partition Main and created maEva again
    =======================================
    At this point I have three partitions shown into diskutil
    a. Main
    b. maEva
    c. Bootcamp
    Restarted and bam! No bootable disk error!
    =======================================
    6. Pressed option key to boot into Mac (alt doesn't even show windows to boot into)
    7. Figured out the problem [Yep! it's recovery disk created by the installer]
    8. Removed maEva partition
    9. Removed recovery disk via Terminal diskutil command and merged it with Main partition
    =======================================
    At this point I have two partitions shown into diskutil
    a. Main
    b. Bootcamp
    Restarted and again no luck! No bootable disk error!
    =======================================
    10. Booted back into mac [via option key]
    11. Shrinked Main partition and re-created maEva
    =======================================
    At this point I have three partitions shown into diskutil
    a. Main
    b. maEva
    c. Bootcamp
    =======================================
    Restarted, and back into normal like nothing happened !

    So that's it guys! My journey towards Maverick, he he :)

    Thanks once again for the help!
     
  12. me9980 macrumors newbie

    Joined:
    Nov 1, 2013
    #12
    @murphychris

    I seem to be having the same problem as the OP. It appears he never posted the results you asked for but here are mine:

    Code:
    sudo fdisk /dev/disk0
    
    Disk: /dev/disk0	geometry: 121601/255/63 [1953525168 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 -  976562504] HFS+        
     3: AB 1023 254  63 - 1023 254  63 [ 976972144 -    1269536] Darwin Boot 
     4: 0C 1023 254  63 - 1023 254  63 [1326073856 -  627449856] Win95 FAT32L
    
    Code:
    sudo gpt -r -vv show /dev/rdisk0
    
    gpt show: /dev/disk0: mediasize=1000204886016; sectorsize=512; blocks=1953525168
    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 1953525167
           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   976562504      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
       976972144     1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
       978241680   347832176         
      1326073856   627449856      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
      1953523712        1423         
      1953525135          32         Sec GPT table
      1953525167           1         Sec GPT header
    
    It would appear that I am, as you said "deep in the weeds". I have no problem diving into the command line, although I am definitely in the dark when it comes to MBR issues. If there is way to solve this I would definitely appreciate your help. Alternatively, I do have all of my files backed up and could simply reinstall windows, would that be a better/easier solution?
     
  13. sydcarton macrumors newbie

    Joined:
    Nov 3, 2013
    #13

    Hi, This is my first time post, thanks to mavericks. I

    sudo gpt -r -vv show disk0

    gpt show: disk0: mediasize=1000204886016; sectorsize=512; blocks=1953525168
    gpt show: disk0: PMBR at sector 0
    gpt show: disk0: Pri GPT at sector 1
    gpt show: disk0: Sec GPT at sector 1953525167
    start size index contents
    0 1 PMBR
    1 1 Pri GPT header
    2 32 Pri GPT table
    34 6
    40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
    409640 1260857528 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
    1261267168 1269544 3 GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
    1262536712 625311736 4 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
    1887848448 262144
    1888110592 65413120 5 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
    1953523712 1423
    1953525135 32 Sec GPT table
    1953525167 1 Sec GPT header

    _____
    Is there any hope in booting again from bootcamp? Please help!
     
  14. Mike Boreham macrumors 65816

    Joined:
    Aug 10, 2006
    Location:
    UK
    #14
    iPartition can create and resize partitions without spoiling the Windows Bootcamp.

    "Works with Boot Camp *

    You can use iPartition on drives that contain Boot Camp volumes; in fact, you can even resize your Windows partitions, and let iPartition take care of reconfiguring the Windows boot process for you."


    Disk Utility partition tab does not see the partitions created by iPartition, but this does not really matter as you would use iPartition for partition actions.

    Disk Utility main window still sees iPartition created partitions so you can format or repair etc with DU.
     
  15. rajivdeo macrumors newbie

    Joined:
    Nov 3, 2013
    Location:
    Pune, India
    #15
    Restored back destroyed Windows 8 partition after Mavericks OS update

    My MacBook Pro Early 2013 version had Windows 8 installed on it using BootCamp. After installing Windows 8, Windows & Mac Partition sizes were changed two times earlier without data loss.
    Last week I updated my Mountain Lion OS to Mavericks after reading somewhere that Mavericks natively supports (reading and) writing NTFS drives. I had no latest backup of my Windows 8 on the machine. After Mavericks got installed I found no signs of Windows 8 on my machine. Disk utility showed a BootCamp partition but of wrong size and position. Thanks to the discussion here, I decided to use gdisk to restore my original hybrid MBR partitions. I had no idea of what would be starting sector for my Windows 8 Bootcamp partition. I had no data backup either. I tried to recover the data using available disk sector recovery tools. You cannot remove the SSD from MacBook Pro as it is soldered on the motherboard. By trial & error, I arrived at BOOTCAMP partition start sector as 314722304. After reading and verifying the data from my NTFS drive, I used gdisk to first delete old BOOTCAMP partition 4 and then created new partition 4 with the correct starting sector.
    After rebooting the machine, Mavericks recognized original BOOTCAMP NTFS partition containing windows 8 but the partition was not getting recognized as bootable at the start of the machine on pressing option key. I then decided to use BOOTCAMP created USB drive which I had used to install Windows 8 earlier. After booting from USB, I selected - repair my windows installation - option in the advanced menu. After a few seconds, the machine rebooted and Windows bootable partition became visible on pressing OPTIONS key at the start. Windows 8 booted without any problem and entire OS with applications are now working as it was before Mavericks destroyed the installation.
    I am sharing my experience so people with similar problem can boldly update their partition tables and recover back Windows.
    This is definitely a Mavericks bug and Apple is not going to care about it for obvious reasons.
    By the way, I did not find native support for writing NTFS drives in Mavericks. If any of readers know about it please share.
    Enjoy your super fast Windows 8 on Apple hardware! All the Best,
    Rajiv Deo
     
  16. Mike Boreham macrumors 65816

    Joined:
    Aug 10, 2006
    Location:
    UK
    #16
    Congratulations, but might I suggest that backing up, especially using Winclone would avoid future drama.
     
  17. havitetty macrumors newbie

    Joined:
    Nov 6, 2013
    #17
    Would you mind sharing the necessary gdisk commands? My gpt output is as follows:

    Code:
    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  390625000      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
      391034640    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
      392304176   31640016         
      423944192   64452608      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
      488396800        335         
      488397135         32         Sec GPT table
      488397167          1         Sec GPT header
    showing I think the Bootcamp partition starts at sector 392304176 but my genius of a Mac thinks it starts at 423944192, thus creating the problem, if I got your post right. Would you be kind enough to help, I think many a people would benefit from this.

    Thanks in advance.
     
  18. nyeates1 macrumors newbie

    Joined:
    Nov 11, 2009
    #18
    I saw all kinds of promising leads in this thread, yet no one detailed attempted or successful solutions to the OP.

    gdisk seems to have promise, though rajivdeo did not give details. How did you use trial and error to come to that number? Did you use numbers from 'sudo gpt -r -vv show /dev/rdisk0' command?
     
  19. nyeates1 macrumors newbie

    Joined:
    Nov 11, 2009
    #19
    I have the same exact issue as posted by me9980, havitetty, and sydcarton

    Here are my conflicting MBR and GPT records:
    Code:
    $ sudo fdisk /dev/disk0
    Password:
    Disk: /dev/disk0	geometry: 60821/255/63 [977105060 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 -  822156848] HFS+        
     3: AB 1023 254  63 - 1023 254  63 [ 822566488 -    1269536] Darwin Boot 
     4: 0C 1023 254  63 - 1023 254  63 [ 918511616 -   58593280] Win95 FAT32L
    
    Code:
    $ sudo gpt -r -vv show /dev/rdisk0
    gpt show: /dev/rdisk0: mediasize=500277790720; sectorsize=512; blocks=977105060
    gpt show: /dev/rdisk0: Suspicious MBR at sector 0
    gpt show: /dev/rdisk0: Pri GPT at sector 1
    gpt show: /dev/rdisk0: Sec GPT at sector 977105059
          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  822156848      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
      822566488    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
      823836024   94675592         
      918511616   58593280      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
      977104896        131         
      977105027         32         Sec GPT table
      977105059          1         Sec GPT header
    
     
  20. blueroom macrumors 603

    blueroom

    Joined:
    Feb 15, 2009
    Location:
    Toronto, Canada
    #20
    In summary, any futzing or resizing OSX partitions will invariably screw up.

    Use bootcamp to delete the windows partition and use bootcamp to make a new one, anything else will generally cause grief.
     
  21. Quackers macrumors 6502a

    Joined:
    Sep 18, 2013
    Location:
    Manchester, UK
    #21
    nyeates1, it seems that at some time you have resized the Bootcamp partition. This is never advisable.
    You may be able to recover the old Bootcamp partition with testdisk (together with its start and end sectors) then, once recovered, you can create a new hybrid MBR with gdisk, changing the partition type code to 07 instead of 0C and making partition 4 bootable.
    This is a considerable amount of work and there is no guarantee of success.
    It may well be easier to remove the Windows installation through Bootcamp Assistant (if it will allow that) and start again. If Bootcamp Assistant will not allow this you may need to re-format the drive and re-install OSX first.
     
  22. nyeates1 macrumors newbie

    Joined:
    Nov 11, 2009
    #22

    Quackers, this helps, thanks. I had not heard of testdisk, and it looks a bit friendlier than gdisk. When you say to use testdisk to "recover" the old Bootcamp partition, what does this mean? Do you mean to backup the bootcamp partitions raw data to some other disk? Or do you mean to try to "restore" the partition on the existing disk?

    Also, what does "create a new hybrid MBR" mean?

    Agreed that this is a lot of work and no guarantee - but when you are talking about lost data, it often matters to people. That said, I have backed up my mac with time machine. Is there any other safety measures I should take before attempting these low-level solutions?
     
  23. Quackers macrumors 6502a

    Joined:
    Sep 18, 2013
    Location:
    Manchester, UK
    #23
    It's quite some time since I used testdisk.
    From memory I believe you would do a search for partitions (not a deep search, initially) and it is likely to find previous partition boundaries, giving start and end sectors.
    There could be more than one partition found. The one you want is probably the one which lists the "list files" option and whose files are readable.
    This gives you the option of backing up those files to another drive or recovering that partition and its start/end sector as a unit.
    If that works then the resizing you did will probably be undone.

    Obviously if you resized the partition a long time ago then data could have been over-written in the meantime and things might not go so well.

    If you choose to recover the partition you would then use those start/end sector data to create a new partition with the same sectors (with gdisk) and partition type 07.

    You can then create a new hybrid MBR with gdisk using the current partition details, making partition 4 bootable.

    Gdisk is not difficult to use - just scary, though care should be taken with it.
    Once in disk you can press ? and enter for a menu.
    There are people on here who could help too, if you have questions.
     
  24. nyeates1 macrumors newbie

    Joined:
    Nov 11, 2009
    #24
    Parted Magic

    Before I forget, I want to let this post know which linux emergency boot disk I am using. It is called 'Parted Magic' and it is well put together and worth the $5 it cost. It has gdisk, testdisk, gparted, and a number of other useful recovery utilities.
    http://partedmagic.com/

    I had a hard time booting it from USB stick on my mac. Solution for USB boot of Parted Magic was found here: http://forums.partedmagic.com/viewtopic.php?f=12&t=88#p562
     
  25. nyeates1, Mar 2, 2014
    Last edited: Mar 3, 2014

    nyeates1 macrumors newbie

    Joined:
    Nov 11, 2009
    #25
    testdisk, gdisk results

    For anyone wondering, you just type in 'testdisk' and hit enter. Same with 'gdisk'. There are command line options, but they give you nice menus if you just stick to the plain name.

    My results so far:
    testdisk results showed many options for possible starting points of my real resized partition, but none of them allow me to 'Show Files' for them. In fact, the one I suspect the most, gives a "Segmentation Fault" and immediately exits to the shell.

    gdisk shows me what I would expect, and I did not want to yet rearrange my partition start/end info. That is a last resort, and only after I have cloned that entire disk (back it up from a raw disk pov).
     

Share This Page