2

I am using OS X 10.10.5 (Yosemite).

Ran out of room on ~60 GB Bootcamp NTFS partition of 250 GB SSD. Attempted to reduce Mac partition & increase Windows, but Win7 no longer boots. I'd rather not go through the multi-week headache of reinstalling software I don't have immediate access to following a recent move; plus I really need to work.

After searching and following several sets of directions, I've attempted fixing things but have only made them worse. I did manage to retrieve and backup files, but now only have read permission from OSX. It appears as if all the data still exists, but I don't have access. TestDisk reads, "Write access for this media is not available." Boot sector recovery & MFT repair via TestDisk aren't possible. Figured I should stop trying to write to the drive lest I make a bigger mess. Maybe it's not salvageable as it is, but I'm willing to try. Any help available out there?

Embarrassingly, I approached things haphazardly & tried somewhat randomly to fix w/o recording order of operations or thinking it through. Rough order is

  • Disk Utility to resize OS X partition
  • Restart / boot Win 7 & use MiniTool Partition 10 to extend Win 7 partition
  • Restart / boot Win 7 to finalize partition changes
  • Attempt to boot Win 7 fails after changes complete fails
  • DL, install & attempt to use EaseUS to fix fails
  • Backup files to external HD & Dropbox
  • Attempt to follow TestDisk step-by-step instructions fails
  • Muck about w/ TestDisk, including boot sector recovery & MFT repair (don't know what I'm doing, scans take so long I forget what I did & when)
  • Attempt to follow these instructions which results in 4 partitions
  • Muck about more with GPT fdisk
  • Post here after another TestDisk scan show a bigger mess

Below are outputs from gdisk, fdisk, diskutil, & testdisk.

sudo gpt -r -vv show disk0
Password:
gpt show: disk0: mediasize=251000193024; sectorsize=512; blocks=490234752
gpt show: disk0: Suspicious MBR at sector 0
gpt show: disk0: Pri GPT at sector 1
gpt show: 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  272774744      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
273184384    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
274453920   98593376         
373047296  117186560      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
490233856        863         
490234719         32         Sec GPT table
490234751          1         Sec GPT header


sudo fdisk /dev/disk0
Password:
Disk: /dev/disk0  geometry: 30515/255/63 [490234752 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: EE    0   0   2 - 1023 254  63 [         1 -  373047295] <Unknown ID>
*2: 07 1023 254  63 - 1023 254  63 [ 373047296 -  117186560] HPFS/QNX/AUX
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused


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        139.7 GB   disk0s2
   3:                 Apple_Boot Recovery HD         650.0 MB   disk0s3
   4:       Microsoft Basic Data BOOTCAMP             60.0 GB   disk0s4


TestDisk 7.1-WIP, Data Recovery Utility, October 2017
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/rdisk0 - 251 GB / 233 GiB - 490234752 sectors (RO)
Current partition structure:
     Partition                  Start        End    Size in sectors
 1 P EFI System                    40     409639     409600 [EFI system partition]
 2 P Mac HFS                   409640  273184383  272774744 [Customer]
 3 P Mac Boot               273184384  274453919    1269536 [Recovery HD]
Warning: number of heads/cylinder mismatches 255 (NTFS) != 1 (HD)
Warning: number of sectors per track mismatches 63 (NTFS) != 1 (HD)
 4 P MS Data                373047296  490233855  117186560 [BOOTCAMP] [BOOTCAMP]

The harddisk (251 GB / 233 GiB) seems too small! (< 1981 GB / 1845 GiB)
Check the harddisk size: HD jumper settings, BIOS detection...

The following partitions can't be recovered:
Partition     Start        End    Size in sectors
Mac HFS      439371214  628115151  188743938    HFS blocksize=16777216, 96 GB / 90 GiB
Mac HFS      448217086 3870769407 3422552322    HFS blocksize=67108864, 1752 GB / 1632 GiB
MS Data      490233848  706013168  215779321    NTFS, blocksize=4096, 110 GB / 102 GiB
MS Data      490233855  607420414  117186560    NTFS, blocksize=4096, 59 GB / 55 GiB
Mac HFS      490234708  491504243    1269536    HFS+ blocksize=4096, 650 MB / 619 MiB

     Partition     Start        End    Size in sectors
P EFI System          40     409639     409600 [EFI System Partition] [EFI]  FAT32, blocksize=512, 209 MB / 200 MiB
D Mac HFS         409640  273184383  272774744  HFS+ blocksize=4096 + Backup, 139 GB / 130 GiB
D MS Data      157267969  274454528  117186560  NTFS found using backup sector, blocksize=4096, 59 GB / 55 GiB
D Mac HFS      250627280  439371217  188743938  HFS found using backup sector!, 96 GB / 90 GiB
D Mac HFS      273184384  274453919    1269536  HFS+ blocksize=4096 + Backup, 650 MB / 619 MiB
D MS Data      274454528  391641087  117186560  NTFS, blocksize=4096, 59 GB / 55 GiB
D MS Data      274454528  490233848  215779321 [BOOTCAMP]  NTFS found using backup sector, blocksize=4096, 110 GB / 102 GiB
D MS Data      373047296  490233855  117186560 [BOOTCAMP]  NTFS found using backup sector, blocksize=4096, 59 GB / 55 GiB
D MS Data      392333427  392339600       6174  NTFS found using backup sector, blocksize=512, 3161 KB / 3087 KiB
D MS Data      392339600  392345773       6174 [Boot]  NTFS, blocksize=512, 3161 KB / 3087 KiB
D MS Data      392339619  392345792       6174  NTFS found using backup sector, blocksize=512, 3161 KB / 3087 KiB
D MS Data      392345792  392351965       6174 [Boot]  NTFS, blocksize=512, 3161 KB / 3087 KiB
D MS Data      392345811  392351984       6174  TFS found using backup sector, blocksize=512, 3161 KB / 3087 KiB
D MS Data      392351984  392358157       6174 [Boot]  NTFS, blocksize=512, 3161 KB / 3087 KiB
D EFI System   392358160  392361039       2880 [EFI System Partition] [EFISECTOR]  FAT12, blocksize=512, 1474 KB / 1440 KiB
D EFI System   392361040  392363919       2880 [EFI System Partition] [EFISECTOR]  FAT12, blocksize=512, 1474 KB / 1440 KiB
D MS Data      393466395  393472568       6174  NTFS found using backup sector, blocksize=512, 3161 KB / 3087 KiB
D MS Data      393472568  393478741       6174 [Boot]  NTFS, blocksize=512, 3161 KB / 3087 KiB
D MS Data      452438731  452441610       2880 [NO NAME]  FAT12, blocksize=512, 1474 KB / 1440 KiB
D MS Data      467629110  467646179      17070 [NO NAME]  FAT12, blocksize=4096, 8739 KB / 8535 KiB
D MS Data      482388228  482420294      32067 [NO NAME]  FAT12, blocksize=4096, 16 MB / 15 MiB
D Mac HFS      488965176  490234711    1269536  HFS+ found using backup sector!, 650 MB / 619 MiB
1

To correctly diagnose your problem would require more information on what you did to create the problem in the first place.

I believe the following statements are true.

  • Windows 7 can (should) only be installed using the BIOS boot method.
  • The Boot Camp Assistant would install Windows 7 into the 4th partition in both the GUID partition table (GPT) and the MBR partition table.

You appear to have Windows installed correctly in the 4th partition in the GPT, but incorrectly in the 2nd partition of the MBR partition table. There are 3 possible solutions.

  1. Edit the MBR partition table to remove the partitions and add the 4 partition shown in the GPT. Of course, the first of these would be a protective MBR partition. You could use either fdisk or gdisk to do this. The utility gdisk has a "make hybrid MBR" command which makes this fix relatively easy. An example is given below.

    Marlin:debug davidanderson$ sudo gdisk /dev/disk0
    Password:
    GPT fdisk (gdisk) version 1.0.0
    
    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): r
    
    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 AB): ab
    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): w
    
    Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
    PARTITIONS!!
    
    Do you want to proceed? (Y/N): y
    OK; writing new GUID partition table (GPT) to /dev/disk0.
    Warning: Devices opened with shared lock will not have their
    partition table automatically reloaded!
    Warning: The kernel may continue to use old or deleted partitions.
    You should reboot or remove the drive.
    The operation has completed successfully.
    

    If successful, sudo fdisk /dev/disk0 should report output similar to what is shown below. Note: your actual cyl, hd and sec values may differ, but this is OK, since these values are ignored. The important values are #, id, start and size.

    Disk: /dev/disk0        geometry: 30515/255/63 [490234752 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 -  272774744] HFS+
     3: AB 1023 254  63 - 1023 254  63 [ 273184384 -    1269536] Darwin Boot
    *4: 07 1023 254  63 - 1023 254  63 [ 373047296 -  117186560] HPFS/QNX/AUX
    
  2. Boot from the Windows 7 installation DVD, reinstall the boot code and rebuild the BCD. Warning: if successful, you will not have access to the OS X (macOs) partition from Windows.

  3. You need to implement Solution 1, followed by Solution 2. In this case, the OS X (macOS) partition should be accessible from Windows.

  • 1
    Thank you so much for your assistance. I meant to include the version - 10.10.5 – perman00b Nov 7 '17 at 5:43
  • I added info to the initial post. At some point, I did use the "make hybrid MBR" command, but obviously did so incorrectly. How do you advise I go about implementing Solution 1? I'm reading through all the gdisk documentation to educate myself. – perman00b Nov 7 '17 at 16:55
  • A final comment: You should consider upgrading to Windows 10. I believe this upgrade is still free. – David Anderson Nov 8 '17 at 10:35
  • David Anderson is a gentleman, scholar, & saint. It took less than 10 minutes to fix. That points points out how good he is, how stupid I am, or both. – perman00b Nov 9 '17 at 18:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .