gytis90210

Q: Bootcamp partition is no longer visible and bootable

I decided to change size of my bootcamp (windows partition) by following steps in this thread:

how to resize my bootcamp partition without deleting  itit

 

I ended up with having bigger windows partition (which is what I was trying to achieve), that I was able to boot to, but my Windows disk was no longer seen in OS X. I reviewed the thread above once again and it was pointing to another thread where folks were discussing issue similar to mine:

Repairing Boot Camp after creating new partition

 

Bottom line - Unfortunately, after performing the suggested action plan, I am no longer able to boot to my windows partition nor to see it from OS X

(I am able to select Windows disk while hitting Alt/Option during the boot, but then I get the message 'A Disk Read Error Occured. Press CTRL+ALT+DEL to restart')

 

Please see the diagnostics below and please advise how this could be fixed - at minimum I would like to boot to Windows partition again, maximum - also to access it via OSX as well.

 

GycioMPB:~ gytis$ sudo gpt -r -vv show disk0

gpt show: disk0: mediasize=320072933376; sectorsize=512; blocks=625142448

gpt show: disk0: Suspicious MBR at sector 0

gpt show: disk0: Pri GPT at sector 1

gpt show: disk0: Sec GPT at sector 625142447

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

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

  533241672   27345080        

  560586752   64555008      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

  625141760        655        

  625142415         32         Sec GPT table

  625142447          1         Sec GPT header

 

 

GycioMPB:~ gytis$ sudo fdisk /dev/disk0

Disk: /dev/disk0 geometry: 38913/255/63 [625142448 sectors]

Signature: 0xAA55

         Starting       Ending

#: id  cyl  hd sec -  cyl  hd sec [     start -       size]

------------------------------------------------------------------------

1: EE    0   0   2 -   25 127  14 [         1 -     409639] <Unknown ID>

2: AF   25 127  15 - 1023 254  63 [    409640 -  531562496] HFS+       

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

*4: 07 1023 254  63 - 1023 254  63 [ 560586752 -   64555008] HPFS/QNX/AUX

 

GycioMPB:~ gytis$ sudo gdisk /dev/disk0

GPT fdisk (gdisk) version 0.8.10

 

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/disk0: 625142448 sectors, 298.1 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): 000066EB-7670-0000-C052-0000E7240000

Partition table holds up to 128 entries

First usable sector is 34, last usable sector is 625142414

Partitions will be aligned on 8-sector boundaries

Total free space is 27345741 sectors (13.0 GiB)

 

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

   1              40          409639   200.0 MiB   EF00  EFI system partition

   2          409640       531972135   253.5 GiB   AF00  Customer

   3       531972136       533241671   619.9 MiB   AB00  Recovery HD

   4       560586752       625141759   30.8 GiB    0700  Win HD

 

Command (? for help):

 

Thanks!

MacBook Pro (15-inch Mid 2010), OS X Mavericks (10.9.4)

Posted on Sep 13, 2014 2:39 AM

Close

Q: Bootcamp partition is no longer visible and bootable

  • All replies
  • Helpful answers

  • by gytis90210,

    gytis90210 gytis90210 Sep 13, 2014 2:36 AM in response to gytis90210
    Level 1 (0 points)
    Sep 13, 2014 2:36 AM in response to gytis90210

    Additional information: before making changes mentioned in the second thread (while i was still able to boot to windows, but I could no longer access it via OS X) gpt looked like this (changes highlighted):

     

    GycioMPB:~ gytis$ sudo gpt -r -vv show disk0

    Password:

    gpt show: disk0: mediasize=320072933376; sectorsize=512; blocks=625142448

    gpt show: disk0: Suspicious MBR at sector 0

    gpt show: disk0: Pri GPT at sector 1

    gpt show: disk0: Sec GPT at sector 625142447

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

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

      533241672        184      

      533241856  27344896      4

      560586752  64555008      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

      625141760        655      

      625142415        32        Sec GPT table

      625142447          1        Sec GPT header

  • by Loner T,

    Loner T Loner T Sep 14, 2014 7:41 AM in response to gytis90210
    Level 7 (24,596 points)
    Safari
    Sep 14, 2014 7:41 AM in response to gytis90210

    Can you post the output of

     

    sudo dd if=/dev/rdisk0s4 count=1 2>/dev/null | hexdump -C

     

    to check if the NTFS header is intact.

     

    Resizing of Bootcamp with a Hybrid MBR is not allowed. See Bootcamp FAQ - Boot Camp 5.1: Frequently asked questions.

     

    More than likely, it may be 533241672 which is the location for it.

  • by gytis90210,

    gytis90210 gytis90210 Sep 14, 2014 10:12 AM in response to Loner T
    Level 1 (0 points)
    Sep 14, 2014 10:12 AM in response to Loner T

    Hi Loner,

    please see the output:

     

    00000000  eb 52 90 4e 54 46 53 20  20 20 20 00 02 08 00 00  |.R.NTFS    .....|

    00000010  00 00 00 00 00 f8 00 00  3f 00 ff 00 00 e0 69 21  |........?.....i!|

    00000020  00 00 00 00 80 00 80 00  f8 07 d9 03 00 00 00 00  |................|

    00000030  00 00 0c 00 00 00 00 00  02 00 00 00 00 00 00 00  |................|

    00000040  f6 00 00 00 01 00 00 00  99 bf 2f fc e2 2f fc d2  |........../../..|

    00000050  8c 92 fe 64 fa 33 c0 8e  d0 bc 00 7c fb 68 c0 07  |...d.3.....|.h..|

    00000060  1f 1e 68 66 00 cb 88 16  0e 00 66 81 3e 03 00 4e  |..hf......f.>..N|

    00000070  54 46 53 75 15 b4 41 bb  aa 55 cd 13 72 0c 81 fb  |TFSu..A..U..r...|

    00000080  55 aa 75 06 f7 c1 01 00  75 03 e9 dd 00 1e 83 ec  |U.u.....u.......|

    00000090  18 68 1a 00 b4 48 8a 16  0e 00 8b f4 16 1f cd 13  |.h...H..........|

    000000a0  9f 83 c4 18 9e 58 1f 72  e1 3b 06 0b 00 75 db a3  |.....X.r.;...u..|

    000000b0  0f 00 c1 2e 0f 00 04 1e  5a 33 db b9 00 20 2b c8  |........Z3... +.|

    000000c0  66 ff 06 11 00 03 16 0f  00 8e c2 ff 06 16 00 e8  |f...............|

    000000d0  4b 00 2b c8 77 ef b8 00  bb cd 1a 66 23 c0 75 2d  |K.+.w......f#.u-|

    000000e0  66 81 fb 54 43 50 41 75  24 81 f9 02 01 72 1e 16  |f..TCPAu$....r..|

    000000f0  68 07 bb 16 68 70 0e 16  68 09 00 66 53 66 53 66  |h...hp..h..fSfSf|

    00000100  55 16 16 16 68 b8 01 66  61 0e 07 cd 1a 33 c0 bf  |U...h..fa....3..|

    00000110  28 10 b9 d8 0f fc f3 aa  e9 5f 01 90 90 66 60 1e  |(........_...f`.|

    00000120  06 66 a1 11 00 66 03 06  1c 00 1e 66 68 00 00 00  |.f...f.....fh...|

    00000130  00 66 50 06 53 68 01 00  68 10 00 b4 42 8a 16 0e  |.fP.Sh..h...B...|

    00000140  00 16 1f 8b f4 cd 13 66  59 5b 5a 66 59 66 59 1f  |.......fY[ZfYfY.|

    00000150  0f 82 16 00 66 ff 06 11  00 03 16 0f 00 8e c2 ff  |....f...........|

    00000160  0e 16 00 75 bc 07 1f 66  61 c3 a0 f8 01 e8 09 00  |...u...fa.......|

    00000170  a0 fb 01 e8 03 00 f4 eb  fd b4 01 8b f0 ac 3c 00  |..............<.|

    00000180  74 09 b4 0e bb 07 00 cd  10 eb f2 c3 0d 0a 41 20  |t.............A |

    00000190  64 69 73 6b 20 72 65 61  64 20 65 72 72 6f 72 20  |disk read error |

    000001a0  6f 63 63 75 72 72 65 64  00 0d 0a 42 4f 4f 54 4d  |occurred...BOOTM|

    000001b0  47 52 20 69 73 20 6d 69  73 73 69 6e 67 00 0d 0a  |GR is missing...|

    000001c0  42 4f 4f 54 4d 47 52 20  69 73 20 63 6f 6d 70 72  |BOOTMGR is compr|

    000001d0  65 73 73 65 64 00 0d 0a  50 72 65 73 73 20 43 74  |essed...Press Ct|

    000001e0  72 6c 2b 41 6c 74 2b 44  65 6c 20 74 6f 20 72 65  |rl+Alt+Del to re|

    000001f0  73 74 61 72 74 0d 0a 00  8c a9 be d6 00 00 55 aa  |start.........U.|

    00000200

     

    So do you think there are there any chances of fixing it?

    Though it is sad that resizing of bootcamp is not supported natively (by Disk Utility?) as it seems a lot of people would like to have this.

     

  • by Loner T,Solvedanswer

    Loner T Loner T Sep 14, 2014 10:50 AM in response to gytis90210
    Level 7 (24,596 points)
    Safari
    Sep 14, 2014 10:50 AM in response to gytis90210

    1. Excellent that the NTFS header is intact. This should be fixable. I assume that you have a TM backup of OSX, if necessary.

     

    2. This an oversimplified explanation, but older Macs which do not implement the Intel UEFI specification (pre-EFI 2.0) and stay with EFI 1.1, that Macs have used till 2013, cannot use Windows UEFI installation properly. Windows 7 also has some issues with UEFI (mainly drivers) on Macs. Late 2013 Macs have UEFI support, so it is possible to install Windows 8+ via UEFI, which means your disk is a pure GPT disk (unlike the Bootcamp Hybrid MBR implementation). Disk Utility can then be used to resize GPT partitions, because Windows 8.1 (for example) uses a FAT Microsoft System Reserved partition in conjunction with the Microsoft Basic Data partition, which allows resizing. DU also understands MBRs, but should ensure that MBR and GPT stay in sync, which is not implemented. Windows can resize the MBRs, but fails to update the GPT (because it is unaware of such a Hybrid MBR), and then you have this issue.

     

    3. Using Gdisk...

     

       a. Delete GPT#4.

       b. Add GPT# 4 back, with the start at 533241856.

       c. Test 1 - Mount Bootcamp and verify that it will mount.

           Test 2 - Make sure you can see files.

           Test 3 - Make sure you can see Bootcamp in Startup Disk.

           Test 4 - Switch to Windows. This may also need Windows startup repair.

        d. Recreate Hybrid MBR, if necessary if Test 4 fails. These two should stay in sync.

        e. This can also be tested using Testdisk.

  • by Dr.Mac.,Helpful

    Dr.Mac. Dr.Mac. Sep 14, 2014 10:43 AM in response to gytis90210
    Level 3 (636 points)
    Sep 14, 2014 10:43 AM in response to gytis90210

    On NTFS volumes, the data enable Ntldr to find the master file table (MFT) during startup. The MFT is not located in a predefined sector, as on FAT32 volumes. For this reason, the MFT can be moved if there is a bad sector. However, if the data is corrupted, the MFT cannot be located, and Windows assumes that the volume has not been formatted. If the NTFS boot sector is damaged, data cannot be accessed. Windows will prompt The drive is not formatted, do you want to format it now? Linux mount will display wrong fs type, bad option, bad superblock

    The following illustrates the proper boot sector of an NTFS volume.  Bytes 0x00– 0x0A are the jump instruction and the OEM ID (shown in bold print).

    00000000: EB 52 90 4E 54 46 53 20 - 20 20 20 00 02 08 00 00 .R.NTFS .....

    Your NTFS header seems  intact.
    00000000  eb 52 90 4e 54 46 53 20  20 20 20 00 02 08 00 00  |.R.NTFS    .....|



  • by Loner T,

    Loner T Loner T Sep 14, 2014 10:51 AM in response to Dr.Mac.
    Level 7 (24,596 points)
    Safari
    Sep 14, 2014 10:51 AM in response to Dr.Mac.

    Much better and precise description , Dr.Mac. Thank you.

  • by gytis90210,

    gytis90210 gytis90210 Sep 14, 2014 12:05 PM in response to Loner T
    Level 1 (0 points)
    Sep 14, 2014 12:05 PM in response to Loner T

    Thanks Loner T for the quick response, and thanks Dr. Mac for detailed explanation.

     

    Regarding b. - gdisk suggests to use 625142414 as the last sector for partition #4 - should I use it, or should I use 625141759, (that was the last sector of deleted #4)?

     

    Last sector (533241856-625142414, default = 625142414) or {+-}size{KMGTP}:

  • by Loner T,

    Loner T Loner T Sep 14, 2014 12:15 PM in response to gytis90210
    Level 7 (24,596 points)
    Safari
    Sep 14, 2014 12:15 PM in response to gytis90210

    By default, since this the last GPT entry, it wants to set it to a byte before the secondary table. You can use it, because typically it is unused, but the MBR needs to be matched to it. I suggest using the MBR entry, but it is the size, not the end sector, you will need to calculate it. GDisk uses start/end, while MBR uses start/size.

     

    533241856 + 27344896 + 64555008 = 625141760

  • by gytis90210,

    gytis90210 gytis90210 Sep 14, 2014 12:55 PM in response to Loner T
    Level 1 (0 points)
    Sep 14, 2014 12:55 PM in response to Loner T

    After deleting and re-adding partition #4 I am no longer able to see Windows in the list of OS'es (when I hit Alt on booting)

     

    gdisk partitions are displayed like this:

     

    Disk /dev/disk0: 625142448 sectors, 298.1 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): 000066EB-7670-0000-C052-0000E7240000

    Partition table holds up to 128 entries

    First usable sector is 34, last usable sector is 625142414

    Partitions will be aligned on 8-sector boundaries

    Total free space is 844 sectors (422.0 KiB)

     

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

      1              40          409639  200.0 MiB  EF00  EFI system partition

      2          409640      531972135  253.5 GiB  AF00  Customer

      3      531972136      533241671  619.9 MiB  AB00  Recovery HD

      4      533241856      625141760  43.8 GiB    AF00  Apple HFS/HFS+

     

    fdisk /dev/disk0

     

    Disk: /dev/disk0 geometry: 38913/255/63 [625142448 sectors]

    Signature: 0xAA55

             Starting       Ending

    #: id  cyl  hd sec -  cyl  hd sec [     start -       size]

    ------------------------------------------------------------------------

    1: EE    0   0   2 -   25 127  14 [         1 -     409639] <Unknown ID>

    2: AF   25 127  15 - 1023 254  63 [    409640 -  531562496] HFS+       

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

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

     

     

    So I assume i should proceed with d. then? Should I do this with gdisk:

    r recovery and transformation options (experts only)

    g convert GPT into MBR and exit

    h make hybrid MBR

    w write table to disk and exit

  • by Loner T,Helpful

    Loner T Loner T Sep 14, 2014 1:04 PM in response to gytis90210
    Level 7 (24,596 points)
    Safari
    Sep 14, 2014 1:04 PM in response to gytis90210

    1. Change the partition type to 07 for partition 4 via Gdisk.

    2. Use the 'h' option and put 2 3 4 in the hybrid MBR, say yes to include EFI in MBR (the "good for grub" question).

    3. Make 4 bootable. Verify the MBR.

    4. Verify the Volume in Finder.

    5. Verify files in the Bootcamp volume.

    6. Test.

     

    The message where you said Windows was bootable not in startup disk, has 533241856.

     

    Testdisk can be used to get valid start/end locations, if necessary, but it is slow process. I have to step away for a couple of hours.

  • by gytis90210,

    gytis90210 gytis90210 Sep 14, 2014 1:32 PM in response to Loner T
    Level 1 (0 points)
    Sep 14, 2014 1:32 PM in response to Loner T

    Thanks, it is all good now - I am able to see my Windows disk in Finder, and I was able to successfully boot into Windows.

  • by Loner T,

    Loner T Loner T Sep 14, 2014 1:34 PM in response to gytis90210
    Level 7 (24,596 points)
    Safari
    Sep 14, 2014 1:34 PM in response to gytis90210

    Excellent.