3-Partitions scheme with Boot Camp and Parallels Desktop

Discussion in 'Installation and Configuration of Parallels Desktop' started by Angel Garcia, Mar 17, 2009.

  1. joevt

    joevt Forum Maven

    Messages:
    1,207
    Maybe gdisk removes the hybrid MBR? To test this, use fdisk after writing the partition map in gdisk. The MBR on a GPT formatted disk that is no longer a hybrid will have one partition of type EE and which covers the entire disk from block 1 to the last block. If that is the case, then it will be necessary to rebuild the hybrid MBR. gdisk has a command for creating a hybrid MBR from the GPT. It will ask you for up to 3 GPT partitions that you want to be listed in the hybrid MBR.
     
  2. GeoffreyZ

    GeoffreyZ Member

    Messages:
    36
    Hi again joevt

    Surprised to see you posting over the weekend! Appreciate your help...

    Yes, that's exactly what the fdisk result showed. I tried to restore / recreate a hybrid MBR via gdisk using their recovery option command, and assigned the two Windows partition to the MBR (wasn't sure about the 200 MB EFI partition), verified the GPT table was the same as before and restarted. Unfortunately, I couldn't boot to the Windows system and one of the partitions ("Windows") was no longer visible in Finder.

    I used Boot Camp utility to create a single Windows partition again and am restoring the original system via ShadowProtect. I'll go ahead and use iPartition to create the 12 GB Win7x64 partition again and let it go at that. Maybe the GPT table will be OK this time, but if not I dare not touch it again for now. Gotta get back to work tomorrow!

    Update: This time the fdisk results and GPT table match! I can see the Win7x64 partition in Finder (although when I open the folder Snow Leopard claims it's empty), and Parallels now runs using the Windows partition without any "Cannot access hard disk 1" error messages. The Win7x64 partition isn't visible in Parallels but I don't need it to be. I rebooted after every step in Snow Leopard before continuing, which may have made a difference. I also attempted to format the Win7x64 partition with Paragon NTFS for Mac once I'd created it, but when I rebooted in Boot Camp it was still listed as "unallocated space" in Computer Management and I had to format it again to create a simple volume. Looks like we're ok this time!

    Thanks again for all your help!

    Salut

    Geoffrey
     
    Last edited: Nov 1, 2010
  3. joevt

    joevt Forum Maven

    Messages:
    1,207
    The EFI partition does not need to be selected for the MBR and is usually not included in the MBR. Instead, the first partition of a hybrid MBR is a gpt protective partition of type EE. It's called a gpt protective partition because it covers the GPT partition map (which starts at block 1; block 0 is the MBR) and extends up to the start of the first real partition that is selected for the MBR. This usually covers the EFI partition (which usually starts at block 40) if the EFI partition is not listed in the MBR.

    If you're not using rEFIt to boot your Mac into Windows (using Boot Camp), then it's possible the MBR did not have an active partition selected or did not have any boot code. To check the boot code, you can dump the entire contents of the MBR:
    Code:
    sudo dd if=/dev/disk0 count=1 skip=0 | xxd
    
    The boot code will have strings like the following (it can change depending on which Windows or Linux utility version added the boot code):
    Code:
    ...
    0000160: 2402 c349 6e76 616c 6964 2070 6172 7469  $..Invalid parti
    0000170: 7469 6f6e 2074 6162 6c65 0045 7272 6f72  tion table.Error
    0000180: 206c 6f61 6469 6e67 206f 7065 7261 7469   loading operati
    0000190: 6e67 2073 7973 7465 6d00 4d69 7373 696e  ng system.Missin
    00001a0: 6720 6f70 6572 6174 696e 6720 7379 7374  g operating syst
    00001b0: 656d 0000 0063 7b9a d4e8 f7db 0000 0000  em...c{.........
    ...
    
    The same command can be used to check the boot code on each of your partitions. Just change the skip number to the first block of the partition. The fdisk command will tell you which partition is the active partition (the one with the *)
    Code:
     #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
    ------------------------------------------------------------------------
     1: EE    0   0   2 - 1023 162  35 [         1 -  435548455] <Unknown ID>
    *2: 0C 1023 162  36 - 1023  45  43 [ 435548456 -    2097152] Win95 FAT32L
     3: 0C 1023  45  44 - 1023 234  41 [ 437645608 -    1024000] Win95 FAT32L
     4: 01 1023 234  42 - 1023  44  42 [ 438669608 -       4096] DOS FAT-12  
    
    rEFIt automatically sets the boot code and the active partition when you use it to select a Windows partition to boot. iPartition can write the MBR Boot Code. fdisk -e can set the active partition flag of a partition.

    These issues shouldn't happen if both partitions are visible in Windows and the GPT correctly matches those partitions in the MBR and the partition types in the MBR and the GPT correctly match their contents.
     
  4. GeoffreyZ

    GeoffreyZ Member

    Messages:
    36
    Hi oevt

    You're right! The 3rd partition doesn't map exactly between the fdisk results and the GPT:
    [CodeLast login: Tue Nov 2 07:21:19 on ttys000
    Geoffrey-Zimmers-MacBook-Pro:~ Geoffrey$ sudo diskutil list
    Password:
    /dev/disk0
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme *256.1 GB disk0
    1: EFI 209.7 MB disk0s1
    2: Microsoft Basic Data Windows 243.0 GB disk0s2
    3: Microsoft Basic Data Win7x64 12.9 GB disk0s3
    /dev/disk1
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme *750.2 GB disk1
    1: EFI 209.7 MB disk1s1
    2: Apple_HFS System 600.2 GB disk1s2
    3: Apple_HFS Backup 149.5 GB disk1s3
    Geoffrey-Zimmers-MacBook-Pro:~ Geoffrey$ sudo fdisk /dev/rdisk0
    Disk: /dev/rdisk0 geometry: 31130/255/63 [500118192 sectors]
    Signature: 0xAA55
    Starting Ending
    #: id cyl hd sec - cyl hd sec [ start - size]
    ------------------------------------------------------------------------
    1: EE 0 0 2 - 25 159 6 [ 1 - 411647] <Unknown ID>
    *2: 07 25 159 7 - 1023 21 51 [ 411648 - 474519321] HPFS/QNX/AUX
    3: 07 1023 254 63 - 1023 254 63 [ 474931200 - 25182208] HPFS/QNX/AUX
    4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
    Geoffrey-Zimmers-MacBook-Pro:~ Geoffrey$ sudo gdisk -l /dev/disk0
    GPT fdisk (gdisk) version 0.6.13

    Partition table scan:
    MBR: hybrid
    BSD: not present
    APM: not present
    GPT: present

    Found valid GPT with hybrid MBR; using GPT.
    Disk /dev/disk0: 500118192 sectors, 238.5 GiB
    Logical sector size: 512 bytes
    Disk identifier (GUID): 67AC034D-2607-4CBE-80DB-5FEC00ACD57B
    Partition table holds up to 128 entries
    First usable sector is 34, last usable sector is 500118158
    Partitions will be aligned on 1-sector boundaries
    Total free space is 2019 sectors (1009.5 KiB)

    Number Start (sector) End (sector) Size Code Name
    1 40 409639 200.0 MiB EF00 EFI System Partition
    2 411648 474930968 226.3 GiB 0700 Windows
    3 474930969 500118153 12.0 GiB 0700 Win7x64
    [/Code]

    The 3rd partition (the smaller Win7x64 sector, which shows no content in Finder) begins at 474931200 according to fdisk and at 474930969 in the GPT. The 2nd partition (which is the preferred bootable Windows system) is correctly defined in both tables. I'll try to recreate the GPT using gdisk to match the fdisk values for both the 2nd and 3rd partitions, rebuild the hybrid MBR, then use iPartition to load the MBR and fdisk to ensure the 2nd partition is active.
    Does that sound right?

    Update: OK, I just ran the gdisk commands to modify the start and end sectors of the 3rd partition and then verified that the MBR was still there and that the 2nd partition was set as active in fdisk. Now I can run the gdisk command without error and all values match! Whew, what an effort! Parallels 6 started up fine after I reselected the hard disk in the configuration menu but Windows had to be reactivated. Looks like we're good to go!

    Thanks again for all your help
     
    Last edited: Nov 2, 2010
  5. joevt

    joevt Forum Maven

    Messages:
    1,207
    Right.

    - Use gdisk to fix partition 3. After writing the changes, use fdisk to see if gdisk did anything to the MBR. Use dd to check if the boot code is still in the MBR.

    - If gdisk did remove the hybrid MBR contents, then use gdisk's "make hybrid MBR" command to fix it. iPartition can also make a hybrid MBR for a GPT disk - just select the "Show in Windows" check box for each partition.

    - Use iPartition to fix the boot code if it was removed by gdisk.

    - Use fdisk to set the active partition if gdisk cleared all the active partition flags.

    Restart the computer. Make sure the Finder can see all the partitions and the contents. Make sure you can boot your Mac into Windows and see all the Windows partitions. Make sure Parallels can see all the partitions.

    The gpt command should work properly now. I like it's output better than gdisk because it matches the output of fdisk more closely (I don't need to calculate gpt partition size to see if it matches MBR partition size).
     
  6. essbee

    essbee Bit poster

    Messages:
    1
    Help Please!!!

    I have a 17" MBP i7 with 500gb and 8gb ram.

    I am a really new Mac user and am just getting the hang of it. I want to end up with a 3 partition system, Mac, windows xp and a data partition both OS can use. I want to use Parallels 6 so that i have the choice of using windows either from within the Mac OS or on it's own.

    I followed the original instructions with a few minor adjustments which i thought should work......They didn't!

    I created the boot camp partition with the boot camp assistant.
    Installed xp professional sp3.
    Backed up XP with winclone....all working fine.
    Installed Paragon NTFS and ipartition.
    Used ipartition to create a data partition (MS NTFS)
    Went back into xp and new partition was not visible. Formated it as ntfs and gave it a drive letter.
    Went onto mac all ok.
    went back to XP...windows files missing.
    Restored image in bootcamp on mac.
    XP loaded fine.
    rebooted in and out of each OS, windows then would not load, various files missing.
    Imaged again, still no luck. Tried it a few times. Eachtime image says it worked but still problem starting windows.
    Tried to reinstall windows but boot camp assistant will not work, as boot camp already created.

    Any advice would be greatly appreciated!
     
  7. joevt

    joevt Forum Maven

    Messages:
    1,207
    You could probably do this without Boot Camp Assistant. Start with your Mac OS X partition. Shrink it using iPartition, then add 2 partitions, first for data and the last partition for XP. Use the "Show in Windows" partition option in iPartition to make the two partitions visible to Windows. Use iPartition to format the partitions. You could format the data partition as FAT-32 so that you don't need Paragon NTFS.

    Use iPartition to write boot code to the MBR just in case the Windows installer doesn't do it for you. Use fdisk to make sure the last partition is the active partition to make sure the Windows installer won't put the boot files somewhere else (don't trust Windows not to do something stupid). Also use fdisk to make sure the partition types in the MBR match the format of the partitions (07 for NTFS, OC for FAT 32).

    Then install Windows XP to the last partition (Windows XP needs to be installed to the last partition listed in the MBR for some strange reason).

    You won't need Winclone because you won't be changing the number of partitions after installing Windows XP.
     
  8. DeanaO

    DeanaO Bit poster

    Messages:
    1
    This thread is really great, thank you so much for sharing such wonderful information that was posted here.
     
  9. SyscomS

    SyscomS Bit poster

    Messages:
    2
    Problem after FileVault

    I have 3-partitions scheme:

    /dev/disk0
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme *750.2 GB disk0
    1: EFI 209.7 MB disk0s1
    2: Apple_HFS 249.0 GB disk0s2
    3: Apple_Boot Recovery HD 650.0 MB disk0s3
    4: Microsoft Basic Data System_Windows 128.9 GB disk0s4
    5: Microsoft Basic Data Data_Windows 371.4 GB disk0s

    Number 2: is Mac OS, 4: is Windows 7 x64 and 5: is NTFS DATA (d: in Windows OS)

    After I Turn On FileVault on my MacBook Pro, everything work fine in Parallels Desktop. But if I boot to Windows I see only C:. Diskmanager in Windows is showing unformated space instead of NTFS partition D:.
    Turn Off FileVault cannot solved my problem - after boot to Windows I see D: as Apple_HFS disk :(
    In MacOS (Lion) and Parallels desktop is still everything OK.
    May I ask you for Help with my problem? Thank you and sorry for my English.

    Edit: Problem solved with iPartition software. Uncheck "Visible in Windows" on Mac partitions and check "Visible in Windows" on DATA partitions. Now everything is OK in both enviroment (Parallels and Boot camp).
     
    Last edited: Jul 19, 2012

Share This Page