Skip navigation

Repairing Boot Camp after creating new partition

178856 Views 1,254 Replies Latest reply: Apr 18, 2014 12:22 PM by Loner T RSS
  • Christopher Murphy Level 2 Level 2 (470 points)
    Currently Being Moderated
    Jan 25, 2013 10:39 AM (in response to autnagrag)

    I'm assuming disk0 is NOT the USB powered drive. Is that correct?

  • autnagrag Level 1 Level 1 (45 points)

    I turned off Time Machine, whether it was involved or not, because it was mentioned in the log. I chose a different target, on FW800 bus, and I disconnected all USB devices. I think I have a backup now. disk0s5 must have behaved for long enough.

     

    myuser$ sudo dd if=/dev/rdisk0s5 of=/Volumes/SomeVolume/BOOTCAMP.iso bs=256k

    Password:

    173836+0 records in

    173836+0 records out

    45570064384 bytes transferred in 1096.566970 secs (41557028 bytes/sec)

    myuser$

     

    So now I guess I'm ready to try (disk1 is now the disk in question)

     

    $ diskutil mergePartitions JHFS+ "MtnLion1" disk1s2 disk1s3

     

    Then I'll reboot and see what that Bootcamp will do.


  • Christopher Murphy Level 2 Level 2 (470 points)
    Currently Being Moderated
    Jan 25, 2013 1:32 PM (in response to autnagrag)

    What I would do before you reboot, is do

    sudo gdisk -l /dev/disk1

    sudo fdisk /dev/disk1

     

    And post that. With four GPT partitions, if one of them is FAT32 I know that diskutil will create a hybrid MBR. Probably also for NTFS. But its worth looking at before you've rebooted in case you need to create a new hybrid MBR with gdisk.

  • autnagrag Level 1 Level 1 (45 points)

    myuser$ sudo gdisk -l /dev/disk1

    Password:

    GPT fdisk (gdisk) version 0.8.6

     

     

    Partition table scan:

      MBR: protective

      BSD: not present

      APM: not present

      GPT: present

     

     

    Found valid GPT with protective MBR; using GPT.

    Disk /dev/disk1: 976773168 sectors, 465.8 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): 8BA679D7-517C-470D-91B9-912CEB5EC9AC

    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 1984349 sectors (968.9 MiB)

     

     

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

       1              40          409639   200.0 MiB   EF00  EFI System Partition

       2          409640       805626287   384.0 GiB   AF00  Deltitnu

       3       805626288       807157967   747.9 MiB   AB00  Apple_HFS_Untitled_2

       4       807157968       885784759   37.5 GiB    AF00  Untitled

       5       887769088       976773119   42.4 GiB    0700  BOOTCAMP

    myuser$

     

    myuser$ sudo fdisk /dev/disk1

    Disk: /dev/disk1          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 -  976773167] <Unknown ID>

    2: 00    0   0   0 -    0   0   0 [         0 -          0] unused     

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

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

    myuser$

  • Christopher Murphy Level 2 Level 2 (470 points)
    Currently Being Moderated
    Jan 25, 2013 4:43 PM (in response to autnagrag)

    Weird. So the merge didn't work. Did you get an error? Because disk1s3 is stil there, and it's still the Recovery HD partition.

     

    It's easier to just leave it alone, and built a new hybrid MBR and add only partition 5 and make it bootable. Then add no more partitions. The consequence of this is that it's a.) non-standard, and might cause issues with upgrades down the road; b.) you can't read OS X files from within Windows, those volumes won't be visible in Windows. But that's it.

     

    The consequence for deleting the partition and for Windows to become the 4th partition instead of the 5th, is that it's possible (?) the BCD will no longer be valid and you'll have to run Windows Startup Repair to fix it. But if you're willing to risk that, you can use gdisk to delete the 3rd partition, then use p <enter> to see if the Windows partition is now 4, or if it's still 5. I think i'll still be 5. In which case, ? from the main menu will show a list of options and somewhere in there is a sort option, maybe it's s. If you do that, it will reorder the partitions 1-4. Confirm with p. Then go to the transformation menu, and use h to make a new hybrid mbr, and add  partitions 2, 3, 4, making 4 bootable. And then see if Windows boots, or if you get some boot loade error - in which case you'll need to use Windows Startup Repair.

     

    See! I tell people to just use VMs. Way easier! None of this stuff applies to VMs.

  • autnagrag Level 1 Level 1 (45 points)

    The merge may well have worked. I misunderstood and thought you wanted to see the output of those commands before I merged. I agree in principle with your comments about virtual machines. Heck, I use one. However, there are one or two feats I cannot accomplish without booting into Windows 7.

     

    Here see output from the merge, and the two other commands. I'm going to reboot.

     

    myuser$ diskutil mergePartitions JHFS+ “Trefoil_Metdale" disk1s2 disk1s3

    Merging partitions into a new partition

         Start partition: disk1s2 Trefoil_Metdale

         Finish partition: disk1s3 Recovery HD

    Started partitioning on disk1

    $<3>Merging partitions

    $<3>Waiting for the disks to reappear

    $<3>Growing disk

    $<3>Finished partitioning on disk1

    /dev/disk1

       #:                       TYPE NAME                    SIZE       IDENTIFIER

       0:      GUID_partition_scheme                        *500.1 GB   disk1

       1:                        EFI                         209.7 MB   disk1s1

       2:                  Apple_HFS Trefoil_Metdale         412.9 GB   disk1s2

       3:                  Apple_HFS Trefoil_Scandale        40.3 GB    disk1s4

       4:       Microsoft Basic Data POCTOBAM                45.6 GB    disk1s5

    myuser$

     

    myuser$ sudo gdisk -l /dev/disk1

    Password:

    GPT fdisk (gdisk) version 0.8.6

     

     

    Partition table scan:

      MBR: hybrid

      BSD: not present

      APM: not present

      GPT: present

     

     

    Found valid GPT with hybrid MBR; using GPT.

    Disk /dev/disk1: 976773168 sectors, 465.8 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): 8BA679D7-517C-470D-91B9-912CEB5EC9AC

    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 2246493 sectors (1.1 GiB)

     

     

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

       1              40          409639   200.0 MiB   EF00  EFI System Partition

       2          409640       806895823   384.6 GiB   AF00  Deltitnu

       3       807157968       885784759   37.5 GiB    AF00  Untitled

       4       887769088       976773119   42.4 GiB    0700  BOOTCAMP

    myuser$

     

     

     

    myuser$ sudo fdisk /dev/disk1

    Disk: /dev/disk1          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 -  806486184] HFS+       

    3: AF 1023 254  63 - 1023 254  63 [ 807157968 -   78626792] HFS+       

    4: 0C 1023 254  63 - 1023 254  63 [ 887769088 -   89004032] Win95 FAT32L

    myuser$

  • Christopher Murphy Level 2 Level 2 (470 points)
    Currently Being Moderated
    Jan 25, 2013 5:41 PM (in response to autnagrag)

    Wonky. That seems like a couple of bugs there.

     

    a.) the 4th partition in the MBR  is type 0C, although it should be 07. Probably not a big deal.

    b.) the 4th partition in the MBR doesn't have the active flag set. I don't think this is going to boot.

     

    Give it a shot. But I bet you need to come back to gdisk, create a new hybrid mbr, add partitions 2 3 4, make only 4 bootable, then write out the new partitions. Reboot.

  • autnagrag Level 1 Level 1 (45 points)

    The merge did work, but the Bootcamp partition won't boot, and can't be accessed via Startup Manager.

     

    The machine has no internal optical drive.

     

    I have a Win7 32b install CD or DVD, a .iso file of it, and a USB enclosure that contains the former internal optical drive of the machine. It is a powered USB enclosure. I might have made a Win7 "rescue" CD. I'll have to check when I get home.

     

    What do you suggest to recover bootability of my Bootcamp partition? I'm not sure I fully understand your last post to me, but it sounds to me like I should go home and get that external optical drive hooked up, and boot holding down the C key.

  • Christopher Murphy Level 2 Level 2 (470 points)
    Currently Being Moderated
    Jan 25, 2013 5:55 PM (in response to autnagrag)

    Use gdisk to make a new hybrid MBR first. Windows isn't going to boot because the 4th partition boot flag isn't set at all. So you need to do that regardless.

     

    It very well might be that it'll need additional repairs with the Windows install DVD, but at the moment the problem is the hybrid MBR is malformed and needs to be fixed.

  • Berend de Meyer Level 1 Level 1 (5 points)

    $ diskutil list

    /dev/disk0

       #:                       TYPE NAME                    SIZE       IDENTIFIER

       0:      GUID_partition_scheme                        *1.0 TB     disk0

       1:                        EFI                         209.7 MB   disk0s1

       2:                  Apple_HFS MAC_OSX_ML              499.0 GB   disk0s2

       3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

       4:       Microsoft Basic Data WIN8_PROx64             500.3 GB   disk0s4


    $ sudo gpt -r -vv show disk0

    Password:

    gpt show: disk0: mediasize=1000204886016; sectorsize=512; blocks=1953525168

    gpt show: disk0: Suspicious MBR 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         MBR

               1           1         Pri GPT header

               2          32         Pri GPT table

              34           6        

              40      409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B

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

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

       976288520        1272        

       976289792   977233920      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

      1953523712        1423        

      1953525135          32         Sec GPT table

      1953525167           1         Sec GPT header

     

    $ diskutil resizevolume /dev/disk0s2 limits

    For device disk0s2 MAC_OSX_ML:

            Current size:  499.0 GB (498999984128 Bytes)

            Minimum size:  499.0 GB (498999984128 Bytes)

            Maximum size:  499.0 GB (498999984128 Bytes)

     

    $ sudo gdisk /dev/disk0

    GPT fdisk (gdisk) version 0.8.5

     

    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/disk0: 1953525168 sectors, 931.5 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): DF74661F-A6DE-466B-B637-8D81F396CD3E

    Partition table holds up to 128 entries

    First usable sector is 34, last usable sector is 1953525134

    Partitions will be aligned on 8-sector boundaries

    Total free space is 2701 sectors (1.3 MiB)

     

     

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

       1              40          409639   200.0 MiB   EF00  EFI System Partition

       2          409640       975018983   464.7 GiB   AF00  Apple_HFS_Untitled_5

       3       975018984       976288519   619.9 MiB   AB00  Apple_HFS_Untitled_2

       4       976289792      1953523711   466.0 GiB   0700  BOOTCAMP

     

     

    Command (? for help): r

     

    Recovery/transformation command (? for help): o

     

    Disk size is 1953525168 sectors (931.5 GiB)

    MBR disk identifier: 0xEC1946A7

    MBR partitions:

     

     

    Number  Boot  Start Sector   End Sector   Status      Code

       1                     1       409639   primary     0xEE

       2                409640    975018983   primary     0xAF

       3             975018984    976288519   primary     0xAB

       4      *      976289792   1953523711   primary     0x07

     

    Recovery/transformation command (? for help):

    Mac Pro (Early 2008), OS X Mountain Lion (10.8.2), 2.8 GHz | Apple RAID5 | 14GB RAM
  • autnagrag Level 1 Level 1 (45 points)

    Good morning. I have white knuckles from expert menu use, but I think I am ready to go. New hybrid MBR in memory awaiting your approval. I think it is correct.

     

    myuser$ diskutil list

    /dev/disk1

       #:                       TYPE NAME                    SIZE       IDENTIFIER

       0:      GUID_partition_scheme                        *500.1 GB   disk1

       1:                        EFI                         209.7 MB   disk1s1

       2:                  Apple_HFS MtLion1         412.9 GB   disk1s2

       3:                  Apple_HFS SnoLeopard        40.3 GB    disk1s3

       4:       Microsoft Basic Data BOOTCAMP                45.6 GB    disk1s4

     

    myuser$ sudo gdisk /dev/disk1

    Password:

    GPT fdisk (gdisk) version 0.8.6

     

     

    Partition table scan:

      MBR: hybrid

      BSD: not present

      APM: not present

      GPT: present

     

     

    Found valid GPT with hybrid MBR; using GPT.

     

     

    Command (? for help): ?

    b          back up GPT data to a file

    c          change a partition's name

    d          delete a partition

    i          show detailed information on a partition

    l          list known partition types

    n          add a new partition

    o          create a new empty GUID partition table (GPT)

    p          print the partition table

    q          quit without saving changes

    r          recovery and transformation options (experts only)

    s          sort partitions

    t          change a partition's type code

    v          verify disk

    w          write table to disk and exit

    x          extra functionality (experts only)

    ?          print this menu

     

     

    Command (? for help): r

     

     

    Recovery/transformation command (? for help): ?

    b          use backup GPT header (rebuilding main)

    c          load backup partition table from disk (rebuilding main)

    d          use main GPT header (rebuilding backup)

    e          load main partition table from disk (rebuilding backup)

    f          load MBR and build fresh GPT from it

    g          convert GPT into MBR and exit

    h          make hybrid MBR

    i          show detailed information on a partition

    l          load partition data from a backup file

    m          return to main menu

    o          print protective MBR data

    p          print the partition table

    q          quit without saving changes

    t          transform BSD disklabel partition

    v          verify disk

    w          write table to disk and exit

    x          extra functionality (experts only)

    ?          print this menu

     

     

    Recovery/transformation command (? for help): h

     

     

    WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,

    just hit the Enter key at the below prompt and your MBR partition table will

    be untouched.

     

     

    Type from one to three GPT partition numbers, separated by spaces, to be

    added to the hybrid MBR, in sequence: 2 3 4

    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): AF

    Set the bootable flag? (Y/N): n

     

     

    Creating entry for GPT partition #3 (MBR partition #3)

    Enter an MBR hex code (default AF): AF

    Set the bootable flag? (Y/N): n

     

     

    Creating entry for GPT partition #4 (MBR partition #4)

    Enter an MBR hex code (default 07): 07

    Set the bootable flag? (Y/N): y

     

     

    Recovery/transformation command (? for help): p

    Disk /dev/disk1: 976773168 sectors, 465.8 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): 8BA679D7-517C-470D-91B9-912CEB5EC9AC

    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 2246493 sectors (1.1 GiB)

     

     

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

       1              40          409639   200.0 MiB   EF00  EFI System Partition

       2          409640       806895823   384.6 GiB   AF00  Deltitnu

       3       807157968       885784759   37.5 GiB    AF00  Untitled

       4       887769088       976773119   42.4 GiB    0700  BOOTCAMP

     

     

    Recovery/transformation command (? for help): o

     

     

    Disk size is 976773168 sectors (465.8 GiB)

    MBR disk identifier: 0xF65974E1

    MBR partitions:

     

     

    Number  Boot  Start Sector   End Sector   Status      Code

       1                     1       409639   primary     0xEE

       2                409640    806895823   primary     0xAF

       3             807157968    885784759   primary     0xAF

       4      *      887769088    976773119   primary     0x07

     

     

    Recovery/transformation command (? for help):

  • Berend de Meyer Level 1 Level 1 (5 points)
    Currently Being Moderated
    Jan 26, 2013 7:32 AM (in response to autnagrag)

    Are we in the same boat? GOODLUCK!

  • Christopher Murphy Level 2 Level 2 (470 points)
    Currently Being Moderated
    Jan 26, 2013 7:33 AM (in response to autnagrag)

    Looks good, write it out.

  • Christopher Murphy Level 2 Level 2 (470 points)

    Yes, there's your step by step.

  • autnagrag Level 1 Level 1 (45 points)

    After being instructed by the neurosurgeon on the radio, I have done the surgery on the arteries at the base of the brain of the patient. The patient is awake now and claims to feel just fine.

     

    Grateful am I for minimal sunspot activity and good radio reception. It has booted directly into Win7 32b via Startup Manager, and also via System Preferences>Startup Disk.

     

    Add this thread to your curriculum vitae.

     

    <celebratory utterance of choice!!>

1 ... 28 29 30 31 32 ... 85 Previous Next

Actions

More Like This

  • Retrieving data ...

Bookmarked By (21)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.