Redyoshi510

Q: I can't boot to Windows after resizing my Mac partition.

So, I recently decided to resize my bootcamp Win7 partition. This is something I have done successfully before, by:

 

1) Booting into Macintosh

 

2) Using Disk Utility to decrease the size of the Mac partition (20GB the first time)

 

3) Booting into Windows

 

4) Using Mini-Tool Partition Wizard (third-party) to allocate the free space to the Bootcamp partition.

 

There were a couple issues caused by this the first time around, mainly the fact that Macintosh didn’t recognize the fact that the free space had been taken, and had trouble reading from the Windows partition. However, I could live with that. I have since rebooted to both Mac and Windows several times without problem.

 

Recently, I decided I needed a bit more space, and so started to follow the above steps, shrinking the Mac partition an additional 15GB. Only when I went to reboot to reallocate the space, the Windows partition didn’t show up as a bootable option. Confused, I booted back to Mac, and the Bootcamp partition was still there, but renamed “disk0s4”, and unmounted. Reparing the disk failed (“Invalid BS_jmpBoot in boot block: 15921e”). The disk wouldn’t mount (not even sure if it was supposed to be mounted earlier, but that’s what it looks like). It also appears grayed-out in the list of drives to the left. It looks like I can create a dmg from the windows drive, although I haven’t done that yet (I will soon).

 

Any solutions for this? Although I will erase the drive if absolutely necessary, it would be preferred if that wasn’t the first option to try. I had no problems like this the first time I resized the disk.

 

(My mac partition is running Mavericks, if that is of any relevance)

MacBook, OS X Mavericks (10.9), Mid-2010 MC516

Posted on Aug 6, 2014 6:04 AM

Close

Q: I can't boot to Windows after resizing my Mac partition.

  • All replies
  • Helpful answers

Page 1 of 4 last Next
  • by apple_power,

    apple_power apple_power Aug 6, 2014 6:32 AM in response to Redyoshi510
    Level 1 (55 points)
    Aug 6, 2014 6:32 AM in response to Redyoshi510

    Resizing Windows partitions is not a good idea anyway.

    Have you tried third party software? http://www.macpartitionmanager.com

     

    enjoy

  • by Loner T,Solvedanswer

    Loner T Loner T Aug 6, 2014 8:41 AM in response to Redyoshi510
    Level 7 (23,970 points)
    Safari
    Aug 6, 2014 8:41 AM in response to Redyoshi510

    Boot Camp 5.1: Frequently asked questions

    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.

    Please post the output of

    1. diskutil list

    2. sudo fdisk /dev/<BootcampDisk> (of the form disk0 as shown by 1.)

    3. sudo gpt -vv -r show /dev/<BootcampDisk> (of the form disk0 as shown by 1.)

    4. sudo dd if=/dev/<BootcampDiskSlice> count=1 2>/dev/null | hexdump -C (of the form disk0s4 as shown by 1.)

  • by Redyoshi510,

    Redyoshi510 Redyoshi510 Aug 8, 2014 9:21 AM in response to Loner T
    Level 1 (0 points)
    Aug 8, 2014 9:21 AM in response to Loner T

    Thanks for responding. Installing Windows took long enough the first time, and since others reported success with the method I used, I decided to go the easier path. It looks like I am now reaping the punishment for that.

     

    Screen Shot 2014-08-08 at 6.17.49 PM.png

  • by Loner T,Helpful

    Loner T Loner T Aug 8, 2014 9:35 AM in response to Redyoshi510
    Level 7 (23,970 points)
    Safari
    Aug 8, 2014 9:35 AM in response to Redyoshi510

    The gpt command has two 'v's, so it is '-vv' rather than a '-w'.

     

    1. Your NTFS partition is not intact.

    2. The MBR can be fixed, but it is likely that you will need Testdisk to search for lost partitions (http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step).

    3. Please post the output of the gpt command. This would help in determining the course of action.

    4. If you care to, please remove personal information from your posts on a public forum. Just for your own safety.

  • by Redyoshi510,

    Redyoshi510 Redyoshi510 Aug 8, 2014 7:04 PM in response to Loner T
    Level 1 (0 points)
    Aug 8, 2014 7:04 PM in response to Loner T

    Thanks for the continued help. Here is the updated gpt:

     

    Screen Shot 2014-08-09 at 3.55.21 AM.png

  • by Loner T,Helpful

    Loner T Loner T Aug 8, 2014 7:38 PM in response to Redyoshi510
    Level 7 (23,970 points)
    Safari
    Aug 8, 2014 7:38 PM in response to Redyoshi510

    These steps correct the Partition ID, and the boot ability of the MBR partition that has Windows on it.You can type '?' for help in the following steps where you set the fdisk prompt.

     

    To fix the MBR, in OSX Terminal

     

    sudo fdisk -e /dev/disk0

    setpid 4

    07

    flag 4

    p

    w

    y

    q

     

    Please ignore the i386 message that you see in the following. Here is the set of commands in the utility. The utility starts at partition id 1. If you see any other messages, please post back.

     

    sudo fdisk -e /dev/disk0

    fdisk: could not open MBR file /usr/standalone/i386/boot0: No such file or directory

    Enter 'help' for information

    fdisk: 1> ?

      help Command help list

      manual Show entire man page for fdisk

      reinit Re-initialize loaded MBR (to defaults)

      auto Auto-partition the disk with a partition style

      setpid Set the identifier of a given table entry

      disk Edit current drive stats

      edit Edit given table entry

      erase Erase current MBR

      flag Flag given table entry as bootable

      update Update machine code in loaded MBR

      select Select extended partition table entry MBR

      print Print loaded MBR partition table

      write Write loaded MBR to disk

      exit Exit edit of current MBR, without saving changes

      quit Quit edit of current MBR, saving current changes

      abort Abort program without saving current changes

    fdisk: 1>

  • by Redyoshi510,

    Redyoshi510 Redyoshi510 Aug 9, 2014 4:20 AM in response to Loner T
    Level 1 (0 points)
    Aug 9, 2014 4:20 AM in response to Loner T

    Ok. I followed those steps, and my Windows partition now shows up as a bootable option, but displays "missing operating system" when I try to boot to it. Disk utility still shows an unmounted "disk0s4" as the second drive partition. I have not yet run testdisk, should I do this?

     

    Thanks again for your help.

  • by Loner T,

    Loner T Loner T Aug 9, 2014 5:29 AM in response to Redyoshi510
    Level 7 (23,970 points)
    Safari
    Aug 9, 2014 5:29 AM in response to Redyoshi510

    Redyoshi510 wrote:

     

    I have not yet run testdisk, should I do this?

     

    Please do. If the NTFS header was intact, a Windows Startup Repair would suffice. Testdisk may report multiple start/end locations. In the wiki, there is an example of listing files within lost partitions.

     

    You may lose Recovery HD, so I suggest building an external Recovery HD. OS X: About Recovery Disk Assistant

  • by Redyoshi510,

    Redyoshi510 Redyoshi510 Aug 9, 2014 7:16 PM in response to Loner T
    Level 1 (0 points)
    Aug 9, 2014 7:16 PM in response to Loner T

    I ran testdisk in "analyze" mode, here are the last two screens in the sequence:

    Screen Shot 2014-08-09 at 2.27.52 PM.pngScreen Shot 2014-08-09 at 2.27.57 PM.png

    I have it idling on this screen now as I don't want to mess up anything further. Right now, it looks like it's going to remove the Windows partition? It won't allow both "MS Data" lines to be set to "P" (it says the structure is damaged when I set it that way). I thought I should probably ask for advice on how to continue before making any mistakes. Thanks again for all the help so far.

  • by Loner T,

    Loner T Loner T Aug 9, 2014 8:16 PM in response to Redyoshi510
    Level 7 (23,970 points)
    Safari
    Aug 9, 2014 8:16 PM in response to Redyoshi510

    1. If you notice, after the EFI 'partition', You have one HFS entry starting at 409640 (this is your OSX installation) and there are no other entries of size 166015624, so this partition was not manipulated.

     

    2. Then the next two entries are of the same size 1269544, but have two different start entries (the last entry is almost the same size 1269536 - less by 8 bytes). This indicates the two locations of Recovery HD. This happens when partitions are manipulated via Disk Utility. Recovery HD is moved, if necessary as part of resizing, even though it is not normally visible. The last entry is also your 'original' Recovery HD, and you can see how it moved.

     

    3. The next two entries are possibly your NTFS partitions. You want to position on the first one, using up/down arrow keys, but do not use the left/right arrow keys. This tries to change the partition, which is not what is needed.

     

    4.  The line which says 'Keys' has an entry called 'P: list files'. The goal is to list files within this partition to see if it looks like a familiar set of files. If it does, note down the start/end/size.

     

    If there is no familiar set of files, move on to the next MS Data entry in the list. It is possible that the partitioning may have over-written your NTFS data by putting some parts of recovery HD on it or vice-a-versa. This is a 'scavenging' operation to find a possible start/end, that can be used to run a Windows repair to bring up windows.

  • by Redyoshi510,

    Redyoshi510 Redyoshi510 Aug 10, 2014 10:08 AM in response to Loner T
    Level 1 (0 points)
    Aug 10, 2014 10:08 AM in response to Loner T

    The first MS Data partition has the familiar file-set. Is the Windows repair you mention the repair function that comes with the Windows install DVD, or a separate procedure?

  • by Loner T,

    Loner T Loner T Aug 10, 2014 10:28 AM in response to Redyoshi510
    Level 7 (23,970 points)
    Safari
    Aug 10, 2014 10:28 AM in response to Redyoshi510

    Please check the second MS Data partition as well.

     

    Because of the partition movement, the GPT may have to be updated as well as the MBR, if they are not synched. Such a change before any windows repair is attempted should also be tested for a valid NTFS header.

     

    Windows repair should be attempted only if the entire NTFS partition can be first resuscitated.

  • by Redyoshi510,

    Redyoshi510 Redyoshi510 Aug 10, 2014 11:24 AM in response to Loner T
    Level 1 (0 points)
    Aug 10, 2014 11:24 AM in response to Loner T

    The second MS Data partition listed no files and was "damaged".

  • by Loner T,

    Loner T Loner T Aug 10, 2014 3:40 PM in response to Redyoshi510
    Level 7 (23,970 points)
    Safari
    Aug 10, 2014 3:40 PM in response to Redyoshi510

    Please download GPT fdisk (gdisk) from http://sourceforge.net/projects/gptfdisk/.

     

    Partition #4 needs to be deleted and recreated with start = 196993024, size=488396792.

     

    GDisk can be executed with sudo gdisk /dev/disk0.

     

    Type 'p' to print the current configuration.

    Type 'd' to delete partition, then type 4 to remove it. Confirm with 'y', if necessary.

    Type 'n' to add a new partition, then type 4, to add it back again.

    Use the start and size as indicated.

    Type 'w' to write the entry and confirm with 'y', if necessary.

    Type 'p' to print the updated GPT.

     

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

    and look for 'R.NTFS' in the output. If this is correct, you may need to run Windows repair to fix the boot so it can seen and selected in System Preferences.

     

    Please post here if you see any errors.

Page 1 of 4 last Next