MLDalglish

Q: After system image restore, disk contents don't match up

I feel like every time I think I've got this darn computer fixed, another problem pops up...


Okay, so after much headache, I was able to restore Boot Camp from a VHD image... however... what OSX sees as the contents of the BOOTCAMP disk, and what BOOTCAMP sees of itself are completely different.

According to OSX, here's the contents:

Kenz$~:   cd /Volumes/BOOTCAMP/

Kenz$~:   ls

$Recycle.Bin/              Program Files/             Users/

BOOTSECT.BAK*              Program Files (x86)/       Windows/

Boot/                      ProgramData/               WindowsImageBackup/

DRIVERS/                   RHDSetup.log*              bootmgr*

Documents and Settings/    Recovery/                  hiberfil.sys*

Intel/                     Recovery.txt*              pagefile.sys*

PerfLogs/                  System Volume Information/

This is how the drive looked before System Restore, yet OSX still thinks this is what is on the disk...

Here's the contents as seen from Windows, for comparison:

Directory of C:\

 

10/06/2015  02:45 PM                58 AppleBcInstaller.log

04/19/2016  09:08 AM             4,528 app_updater.log

02/02/2015  10:19 AM    <DIR>          Autodesk

01/03/2015  07:41 PM    <DIR>          Intel

07/13/2009  10:20 PM    <DIR>          PerfLogs

11/12/2015  03:02 PM    <DIR>          PhSp_CS2_UE_Ret

07/11/2016  05:44 PM    <DIR>          Program Files

07/15/2016  03:37 PM    <DIR>          Program Files (x86)

07/15/2016  11:58 AM    <DIR>          RegBackup

10/15/2015  07:13 PM             2,058 RHDSetup.log

01/04/2015  06:47 PM    <DIR>          Sandbox

01/03/2015  05:13 PM    <DIR>          Users

07/22/2016  03:48 PM    <DIR>          Windows

               3 File(s)          6,644 bytes

              10 Dir(s)  66,776,281,088 bytes free

I feel this is an OSX problem, like I need to reset its memory of the BOOTCAMP volume or something.

I have unmounted than re-mounted the disk, reset NVRAM/PRAM and disabled Tuxera NTFS... but it still shows this as the contents.

 

Any ideas on how to fix this? While I could leave it alone since both OSX and Windows function and boot properly, I would like to create a WinClone image of Boot Camp, and in this situation it would probably create an image of the wrong thing, so I'd like OSX to see the disk correctly. The driving factor here is I'd like to take advantage of the free Windows 10 upgrade, but I want to be able to roll back to where I was in the worst-case scenario.

MacBook Pro with Retina display, OS X Mavericks (10.9), Windows 7 Boot Camp

Posted on Jul 22, 2016 3:02 PM

Close

Q: After system image restore, disk contents don't match up

  • All replies
  • Helpful answers

first Previous Page 3 of 4 last Next
  • by MLDalglish,

    MLDalglish MLDalglish Jul 30, 2016 8:22 AM in response to Loner T
    Level 1 (4 points)
    Windows Software
    Jul 30, 2016 8:22 AM in response to Loner T

    Kenz$~:  sudo gdisk /dev/disk0

    Password:

    GPT fdisk (gdisk) version 1.0.1

     

    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: 977105060 sectors, 465.9 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): 59108FE8-4E95-48FE-80F7-0CC34F53DF88

    Partition table holds up to 128 entries

    First usable sector is 34, last usable sector is 977105026

    Partitions will be aligned on 8-sector boundaries

    Total free space is 1737 sectors (868.5 KiB)

     

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

       1              40          409639   200.0 MiB   EF00  EFI System Partition

       2          409640       591069855   281.6 GiB   AF00  Customer

       3       591069856       592339391   619.9 MiB   AB00  Recovery HD

       4       592340992       977104895   183.5 GiB   0700  BOOTCAMP

  • by Loner T,

    Loner T Loner T Jul 30, 2016 8:53 AM in response to MLDalglish
    Level 7 (23,828 points)
    Safari
    Jul 30, 2016 8:53 AM in response to MLDalglish

    Your GPT is (this lists start and end)

    MLDalglish wrote:

     

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

       1              40          409639   200.0 MiB   EF00  EFI System Partition

       2          409640       591069855   281.6 GiB   AF00  Customer

       3       591069856       592339391   619.9 MiB   AB00  Recovery HD

       4       592340992       977104895   183.5 GiB   0700  BOOTCAMP

     

    Your MBR is (this lists start and size)

     

    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    0   0   2 -   25 127  14 [         1 -     409639] <Unknown ID>

    2: 07   25 127  15 - 1023 254  63 [    409640 -  664698912] HPFS/QNX/AUX

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

    *4: 07 1023 254  63 - 1023 254  63 [ 666378240 -  310726656] HPFS/QNX/AUX

     

    You can see where the issues are, as shown in this table....

     

    MLDalglish-GPTvsMBR.png

    Do OSX and Windows work correctly?

  • by MLDalglish,

    MLDalglish MLDalglish Jul 30, 2016 9:18 AM in response to Loner T
    Level 1 (4 points)
    Windows Software
    Jul 30, 2016 9:18 AM in response to Loner T

    Yes, they both seem to boot and run fine. I think OS X has been a little slow as of recent, but otherwise pretty normal.

     

    So there is a difference of 35. I'm not sure I really understand what that means because I don't know a whole lot about GPT and MBR, but is there a way to resolve the difference?

  • by Loner T,

    Loner T Loner T Jul 30, 2016 12:26 PM in response to MLDalglish
    Level 7 (23,828 points)
    Safari
    Jul 30, 2016 12:26 PM in response to MLDalglish

    The difference is 35GB. One more check, since your Recovery HD is 'located' in two places, can you check if Command+R boots you into Local Recovery? If it does, then OSX and Recovery HD will need to be derived from the GPT and Windows will have to come from the MBR.

     

    The current windows size indicated by the MBR is 310726656 512-byte sectors, which is about 155/148GB. This would also match with your System Restore image.

     

    The gap of 35GB can be absorbed into Windows (only - due to it's location) via GPARTed Live CD. We can tackle this later after we correct the GPT. My recommendation is that we re-create the GPT and MBR using the suggested method.

  • by MLDalglish,

    MLDalglish MLDalglish Jul 30, 2016 7:48 PM in response to Loner T
    Level 1 (4 points)
    Windows Software
    Jul 30, 2016 7:48 PM in response to Loner T

    Yes, Command+R boots into local recovery.

     

    What is the suggested method you're talking about?

  • by Loner T,

    Loner T Loner T Jul 31, 2016 3:49 AM in response to MLDalglish
    Level 7 (23,828 points)
    Safari
    Jul 31, 2016 3:49 AM in response to MLDalglish

    We should recreate the GPT (and the MBR using the corrected GPT) to ensure a 1-to-1 mapping and match using the same values for start/size/end to avoid future data corruption. Given the two sets of information, we need the GPT to look like (start-end values in 512-byte sectors).

     

    MLDalglish-newGPT.png

     

    The last usable sector is 977105026, which leaves a trailing gap of 131 sectors, which is alignment.

  • by MLDalglish,

    MLDalglish MLDalglish Jul 31, 2016 5:56 PM in response to Loner T
    Level 1 (4 points)
    Windows Software
    Jul 31, 2016 5:56 PM in response to Loner T

    Right... Sorry to sound stupid, but how do I actually go about recreating the GPT and MBR?

  • by Loner T,

    Loner T Loner T Jul 31, 2016 6:21 PM in response to MLDalglish
    Level 7 (23,828 points)
    Safari
    Jul 31, 2016 6:21 PM in response to MLDalglish

    I suggest creating a backup of OS X first.

     

    After the backup, as a safety procedure, you should install OS X on an external disk and upgrade, if necessary, to match the current version on the internal disk. If your local Recovery HD works, it should offer to re-install the same version. Using your internal disk's local recovery, you can install the same version on an external disk. If Local Recovery does not offer the same version, then it is not valid either. In such a case - How to install OS X on an external drive connected to your Mac - Apple Support - and upgrade to match your internal disk version. Please take a look at About OS X Recovery - Apple Support as well.

     

    Using GPT Fdisk is the quickest, to rebuild your GPT and MBR. We can do it on a live disk, but after reboot, if there is an error on the GPT, then you will need to boot from an external disk, or Internet Recovery.

     

    Please choose which path you want to follow, and I can provide GPT Fdisk commands.

  • by MLDalglish,

    MLDalglish MLDalglish Jul 31, 2016 7:03 PM in response to Loner T
    Level 1 (4 points)
    Windows Software
    Jul 31, 2016 7:03 PM in response to Loner T

    Okay, I've made a backup of the OS X partition. My version of OS X is the same version I've had since buying the laptop, so do I still need to make a copy installation?

  • by Loner T,

    Loner T Loner T Jul 31, 2016 7:23 PM in response to MLDalglish
    Level 7 (23,828 points)
    Safari
    Jul 31, 2016 7:23 PM in response to MLDalglish

    As long as Internet Recovery offers the same version as the one currently installed, it should work.

     

    Using Gdisk to recreate the GPT first (do not type text in parentheses which is informational only).

     

    sudo gdisk /dev/disk0

    p (print)

    o (Create a new GPT)

    w (write)

    y (Confirm write)

    x (Experts menu)

    l (lower case L, set sector alignment)

    1 (one sector)

    n (New)

    1 (GPT 1)

    40 (Start)

    409639 (End)

    EF00 (EFI)

    n (New)

    2 (GPT 2)

    409640 (Start)

    591069855 (End)

    AF00 (OSX)

    n (New)

    3 (GPT 3)

    591069856 (Start)

    592339391 (End)

    AB00 (Recovery HD)

    n (New)

    4 (GPT 4)

    666378240 (Start)

    977104895 (End)

    0700 (Microsoft Basic Data)

    p

    w

    y

     

    Please verify all numbers for any errors. If they are clean and you do not get any errors, reboot and test OS X and Local Recovery and verify that both work correctly. If they do then post back, and the MBR can be recreated as the next set of Gdisk steps.

  • by MLDalglish,

    MLDalglish MLDalglish Jul 31, 2016 7:47 PM in response to Loner T
    Level 1 (4 points)
    Windows Software
    Jul 31, 2016 7:47 PM in response to Loner T

    Okay, when I try these commands

     

    sudo gdisk /dev/disk0

    p (print)

    o (Create a new GPT)

    w (write)

    y (Confirm write)

    x (Experts menu)

    l (lower case L, set sector alignment)

    1 (one sector)

    n (New)

     

    they all appear to work. But starting with

     

    1 (GPT 1)

    40 (Start)

    409639 (End)

    they return with a menu.

    Also, the AF00 command reports no partitions.

     

    I did not type the parentheses or the text inside them.

     

    Here is an part of what I see:

     

    Kenz$~:   sudo gdisk /dev/disk0

    Password:

    GPT fdisk (gdisk) version 1.0.1

     

    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: 977105060 sectors, 465.9 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): 59108FE8-4E95-48FE-80F7-0CC34F53DF88

    Partition table holds up to 128 entries

    First usable sector is 34, last usable sector is 977105026

    Partitions will be aligned on 8-sector boundaries

    Total free space is 1737 sectors (868.5 KiB)

     

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

       1              40          409639   200.0 MiB   EF00  EFI System Partition

       2          409640       591069855   281.6 GiB   AF00  Customer

       3       591069856       592339391   619.9 MiB   AB00  Recovery HD

       4       592340992       977104895   183.5 GiB   0700  BOOTCAMP

     

    Command (? for help): o

    This option deletes all partitions and creates a new protective MBR.

    Proceed? (Y/N): y

     

    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.

    Kenz$~:   x

    -bash: x: command not found

    Kenz$~:   sudo gdisk /dev/disk0

    GPT fdisk (gdisk) version 1.0.1

     

    Warning: Devices opened with shared lock will not have their

    partition table automatically reloaded!

    Partition table scan:

      MBR: protective

      BSD: not present

      APM: not present

      GPT: present

     

    Found valid GPT with protective MBR; using GPT.

     

    Command (? for help): x

     

    Expert command (? for help): l

    Enter the sector alignment value (1-65536, default = 2048): 1

     

    Expert command (? for help): n

     

    Expert command (? for help): 1

    a set attributes

    c change partition GUID

    d display the sector alignment value

    e relocate backup data structures to the end of the disk

    g change disk GUID

    h recompute CHS values in protective/hybrid MBR

    i show detailed information on a partition

    l set the sector alignment value

    m return to main menu

    n create a new protective MBR

    o print protective MBR data

    p print the partition table

    q quit without saving changes

    r recovery and transformation options (experts only)

    s resize partition table

    t transpose two partition table entries

    u replicate partition table on new device

    v verify disk

    w write table to disk and exit

    z zap (destroy) GPT data structures and exit

    ? print this menu

     

    Expert command (? for help): 40

    a set attributes

    c change partition GUID

    d display the sector alignment value

    e relocate backup data structures to the end of the disk

    g change disk GUID

    h recompute CHS values in protective/hybrid MBR

    i show detailed information on a partition

    l set the sector alignment value

    m return to main menu

    n create a new protective MBR

    o print protective MBR data

    p print the partition table

    q quit without saving changes

    r recovery and transformation options (experts only)

    s resize partition table

    t transpose two partition table entries

    u replicate partition table on new device

    v verify disk

    w write table to disk and exit

    z zap (destroy) GPT data structures and exit

    ? print this menu

  • by Loner T,Solvedanswer

    Loner T Loner T Jul 31, 2016 8:01 PM in response to MLDalglish
    Level 7 (23,828 points)
    Safari
    Jul 31, 2016 8:01 PM in response to MLDalglish

    Please try the following...

     

    sudo gdisk /dev/disk0

     

    x (Experts menu)

    l (lower case L, set sector alignment)

    1 (one sector)

    m (Main menu)

    n (New)

    1 (GPT 1)

    40 (Start)

    409639 (End)

    EF00 (EFI)

    n (New)

    2 (GPT 2)

    409640 (Start)

    591069855 (End)

    AF00 (OSX)

    n (New)

    3 (GPT 3)

    591069856 (Start)

    592339391 (End)

    AB00 (Recovery HD)

    n (New)

    4 (GPT 4)

    666378240 (Start)

    977104895 (End)

    0700 (Microsoft Basic Data)

    p

    w

    y

  • by MLDalglish,

    MLDalglish MLDalglish Jul 31, 2016 8:15 PM in response to Loner T
    Level 1 (4 points)
    Windows Software
    Jul 31, 2016 8:15 PM in response to Loner T

    That went through pretty smoothly with no errors this time.

    Rebooted, noticed I can't boot into Windows partition anymore (no longer an available option if I hold down alt/option at startup).

     

    According to DU, the drive looks like this:

    Screen Shot 2016-07-31 at 10.08.15 PM.png

    Is that what it's supposed to look like?

     

    It looks kinda weird to me but OS X can see into the BOOTCAMP partition properly now.

  • by Loner T,

    Loner T Loner T Jul 31, 2016 8:15 PM in response to MLDalglish
    Level 7 (23,828 points)
    Safari
    Jul 31, 2016 8:15 PM in response to MLDalglish

    This the 'gap', and Windows will not work till we recreate the MBR.

     

    Rebuild MBR to match the new GPT information thus resetting the Hybrid MBR. Use defaults for other questions (like partition codes). The only values that need modifications are the Boot flags and step 10. Accept all other defaults that Gdisk offers. Please see the sample Q&A as an example. These steps can be repeated if you make a mistake before you get to Step 12, otherwise start from Step 1 for these steps. Step 6 has numbers which are typed with a space between the numbers. Please see the sample Q&A before you execute these steps.

    1. Sudo gdisk /dev/rdisk0
    2. P  (Print list of parts)
    3. R  (Recover)
    4. O (print current Hybrid MBR)
    5. H (chooses Hybrid)
    6. Partitions numbers to be hybridized: 2 3 4
    7. Y  (Good for GRUB question)
    8. N  (part 2 boot flag)
    9. N  (part 3 boot flag)
    10. Y  (part 4 boot flag make NTFS bootable partition)
    11. O  (print current Hybrid MBR)
    12. W (Write the new MBR)
    13. Y (Yes! write the new MBR)
    14. Reboot

     

    Here is sample Q&A for this section. Please notice the Press Enter/Return.

     

    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): Press Enter/Return

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

     

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

    Enter an MBR hex code (default AB): Press Enter/Return

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

     

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

    Enter an MBR hex code (default 07): Press Enter/Return

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

     

    Test 1 - Does Bootcamp Volume show up in Finder?

    Test 2 - Can you see files in Bootcamp Volume?

    Test 3 - Can you select Bootcamp in System Preferences -> Startup Disk?

    Test 4 - If Test 3 is successful, select Bootcamp and Click Restart.

  • by MLDalglish,

    MLDalglish MLDalglish Jul 31, 2016 8:27 PM in response to Loner T
    Level 1 (4 points)
    Windows Software
    Jul 31, 2016 8:27 PM in response to Loner T

    The Good News:

     

    Tests 1-3 worked.

     

    The Bad News:

     

    When I chose Boot Camp as the startup disk and rebooted... I was met with this lovely screen.

     

    IMG_3888-1.jpg

    ...I probably should mention I did take advantage of the Windows 10 upgrade on Friday.

first Previous Page 3 of 4 last Next