Booting - Help! Weird problem with Boot Camp / Windows 7 / OS X

Discussion in 'Windows, Linux & Others on the Mac' started by Raikun, Aug 5, 2012.

  1. Raikun, Aug 5, 2012
    Last edited: Aug 5, 2012

    Raikun macrumors regular

    Joined:
    Apr 8, 2008
    #1
    Hey guys,
    I've had this weird problem for a while with Boot Camp and Windows 7.

    • My computer has trouble booting.
    • I can boot if I hold down ALT and selecting the OS, sometimes it needs a CD in the DVD drive (weird, huh)
    • When I turn on my Mac, the grey screen with the apple logo stays fully grey for a LONG time before the apple logo appears
    • During this time, the hard drive makes a lot of read noises, making me believe there is an issue with the MBR/GPT or something similar
    • This problem had occurred for a long time, but then I made matters even worse by attempting to shrink my Mac partition and create a 3rd partition in between the two, screwing up the MBR and boot tables. I was able to get around this problem with rEFIt and a lot of hassle
    • To fix this problem, I deleted my windows/storage partition
    • I then made the Mac partition smaller
    • and redid the whole boot camp process, this time with a larger boot camp partition
    • The LONG boot times are still there, but I no longer have to go through rEFIt
    • However, PROBLEM 1: OS X cannot see my boot camp partition at all (suggesting something wrong with mbr/gpt/etc)
    • I have since, in an attempt to fix this, done a clean install of OS X Mountain Lion by reformatting my OS X partition. I still (PROBLEM 2) have long boot problems, and now Mountain Lion can't see Windows 7 and I can't boot to it. Going to attempt to delete the recovery partition to see if that helps.


    Below I have included terminal output for the sudo gpt -r -vv show disk0 commands and the sudo fdisk /dev/disk0 commands

    I have been at my wits end about this and it's driving me crazy! Very tempted to sell this iMac and just go back to windows computers.

    Code:
    rais-imac:~ Rai$ sudo gpt -r -vv show disk0
    Password:
    gpt show: disk0: mediasize=1000204886016; sectorsize=512; blocks=1953525168
    gpt show: disk0: Suspicious MBR at sector 0
    gpt show: disk0: Pri GPT at sector 1
    gpt show: disk0: Sec GPT at sector 1953525167
           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   821258416      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
       821668056     1269544      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
       822937600  1130586112      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
      1953523712        1423         
      1953525135          32         Sec GPT table
      1953525167           1         Sec GPT header
    rais-imac:~ Rai$ sudo fdisk /dev/disk0
    Disk: /dev/disk0	geometry: 121601/255/63 [1953525168 sectors]
    Signature: 0xAA55
             Starting       Ending
     #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
    ------------------------------------------------------------------------
     1: EE 1023 254  63 - 1023 254  63 [         1 -     409639] <Unknown ID>
     2: AF 1023 254  63 - 1023 254  63 [    409640 -  821258416] HFS+        
     3: AB 1023 254  63 - 1023 254  63 [ 821668056 -    1269544] Darwin Boot 
     4: 0C 1023 254  63 - 1023 254  63 [ 822937600 - 1130586112] Win95 FAT32L
    
    I would be eternally grateful to anyone who could lend a hand. I've tried googling for so long now.
     
  2. jwolf6589 macrumors 6502a

    jwolf6589

    Joined:
    Dec 15, 2010
    Location:
    Colorado
    #2
    This is one reason why I do not want to upgrade to Windows 7 and would rather just keep XP which works just fine.



     
  3. murphychris macrumors 6502a

    Joined:
    Mar 19, 2012
    #3
    Which options appear when you hold down option/alt?

    Sounds like you need to zap PRAM to clear possibly corrupt NVRAM, and then go to Startup Disk in System Preferences, and choose the Mac OS X system you want to boot.

    These structures are really tiny and are completely read in a fraction of a second. But it might be that EFI or Apple's bootloader are having difficulty finding a blessed system or it could even be file system needs repairs.

    When you say OS X, you mean when you're booted into Mac OS, the BOOTCAMP volume doesn't mount?

    I'm seeing in the MBR and GPT that the Windows partition is defined in both, and have the same start and end sectors. That's good. However MBR partition 4 (Windows) does not have the active flag set. And the type code is 0x0C instead of 0x07. So that very well could be the problem and can be fixed directly with fdisk if you're feeling brave.

    Code:
    sudo fdisk -e /dev/disk0
    edit 4
    07
    n
    822937600
    1130586112
    flag 4
    p                     [copy and paste the results in the forum to confirm before you write out the updated mbr]
    quit
    y
     
  4. Raikun, Aug 6, 2012
    Last edited: Aug 6, 2012

    Raikun thread starter macrumors regular

    Joined:
    Apr 8, 2008
    #4
    Both Boot Camp and OS X


    Reset PRAM. Thanks.



    :eek:



    Correct, but now Windows doesn't appear in rEFInd either. I can see the partition in disk utility though, but can't manually mount it. Installing ntfs-3g had no effect. It appears when I hold alt on boot.

    Since that post I've now deleted the recovery partition. Since installing mountain lion I can't see any options in rEFInd for boot camp

    Here are my relevant terminal outputs now:

    Code:
    /dev/disk0
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *1.0 TB     disk0
       1:                        EFI                         209.7 MB   disk0s1
       2:                  Apple_HFS Macintosh HD            421.0 GB   disk0s2
       3:       Microsoft Basic Data                         578.9 GB   disk0s3
    
    
    gpt show: disk0: mediasize=1000204886016; sectorsize=512; blocks=1953525168
    gpt show: disk0: Suspicious MBR at sector 0
    gpt show: disk0: Pri GPT at sector 1
    gpt show: disk0: Sec GPT at sector 1953525167
           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   822265816      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
       822675456      262144         
       822937600  1130586112      3  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
      1953523712        1423         
      1953525135          32         Sec GPT table
      1953525167           1         Sec GPT header
    
    
    Disk: /dev/disk0	geometry: 121601/255/63 [1953525168 sectors]
    Signature: 0xAA55
             Starting       Ending
     #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
    ------------------------------------------------------------------------
     1: EE 1023 254  63 - 1023 254  63 [         1 -     409639] <Unknown ID>
     2: AF 1023 254  63 - 1023 254  63 [    409640 -  822265816] HFS+        
    *3: 0B 1023 254  63 - 1023 254  63 [ 822937600 - 1130586112] Win95 FAT-32
     4: 00    0   0   0 -    0   0   0 [         0 -          0] unused 
    
    
    
    I am going to play with the fdisk tool and try and adapt the instructions you gave me to the idea that windows is now disk0s3 instead of 4, hopefully I won't screw things up.
    First, however, I'm going to try and use my windows disk to try and repair everything.

    I really appreciate your advice. Thanks.

    Windows disk did not work. Could not automatically repair.

    Played with fdisk, here's what I've come to:


    Code:
    rais-imac:~ Rai$ sudo fdisk -e /dev/disk0
    Password:
    fdisk: could not open MBR file /usr/standalone/i386/boot0: No such file or directory
    Enter 'help' for information
    fdisk: 1> edit 3
             Starting       Ending
     #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
    ------------------------------------------------------------------------
    *3: 0B 1023 254  63 - 1023 254  63 [ 822937600 - 1130586112] Win95 FAT-32
    Partition id ('0' to disable)  [0 - FF]: [B] (? for help) ?
    Choose from the following Partition id values:
    00 unused         20 Willowsoft     66 Netware 386    A7 NEXTSTEP    
    01 DOS FAT-12     24 NEC DOS        67 Novell         A8 Darwin UFS  
    02 XENIX /        38 Theos          68 Novell         A9 NetBSD      
    03 XENIX /usr     39 Plan 9         69 Novell         AB Darwin Boot 
    04 DOS FAT-16     40 VENIX 286      70 DiskSecure     AF HFS+        
    05 Extended DOS   41 Lin/Minux DR   75 PCIX           B7 BSDI filesy*
    06 DOS > 32MB     42 LinuxSwap DR   80 Minix (old)    B8 BSDI swap   
    07 HPFS/QNX/AUX   43 Linux DR       81 Minix (new)    C0 CTOS        
    08 AIX fs         4D QNX 4.2 Pri    82 Linux swap     C1 DRDOSs FAT12
    09 AIX/Coherent   4E QNX 4.2 Sec    83 Linux files*   C4 DRDOSs < 32M
    0A OS/2 Bootmgr   4F QNX 4.2 Ter    93 Amoeba file*   C6 DRDOSs >=32M
    0B Win95 FAT-32   50 DM             94 Amoeba BBT     C7 HPFS Disbled
    0C Win95 FAT32L   51 DM             84 OS/2 hidden    DB CPM/C.DOS/C*
    0E DOS FAT-16     52 CP/M or SysV   85 Linux ext.     E1 SpeedStor   
    0F Extended LBA   53 DM             86 NT FAT VS      E3 SpeedStor   
    10 OPUS           54 Ontrack        87 NTFS VS        E4 SpeedStor   
    11 OS/2 hidden    55 EZ-Drive       93 Amoeba FS      EB BeOS/i386   
    12 Compaq Diag.   56 Golden Bow     94 Amoeba BBT     F1 SpeedStor   
    14 OS/2 hidden    5C Priam          99 Mylex          F2 DOS 3.3+ Sec
    16 OS/2 hidden    61 SpeedStor      9F BSDI           F4 SpeedStor   
    17 OS/2 hidden    63 ISC, HURD, *   A0 NotebookSave   FF Xenix BBT   
    18 AST swap       64 Netware 2.xx   A5 FreeBSD     
    19 Willowtech     65 Netware 3.xx   A6 OpenBSD     
    Partition id ('0' to disable)  [0 - FF]: [B] (? for help) 0B
    Do you wish to edit in CHS mode? [n] n
    Partition offset [0 - 1953525168]: [822675456] 822937600
    Partition size [1 - 1130587568]: [1130587568] 1130586112
    fdisk:*1> flag 4
    Partition 4 marked active.
    fdisk:*1> p
    Disk: /dev/disk0	geometry: 121601/255/63 [1953525168 sectors]
    Offset: 0	Signature: 0xAA55
             Starting       Ending
     #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
    ------------------------------------------------------------------------
     1: EE 1023 254  63 - 1023 254  63 [         1 -     409639] <Unknown ID>
     2: AF 1023 254  63 - 1023 254  63 [    409640 -  822265816] HFS+        
     3: 0B 1023 254  63 - 1023 254  63 [ 822937600 - 1130586112] Win95 FAT-32
    *4: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
    fdisk:*1> flag 3
    Partition 3 marked active.
    fdisk:*1> p
    Disk: /dev/disk0	geometry: 121601/255/63 [1953525168 sectors]
    Offset: 0	Signature: 0xAA55
             Starting       Ending
     #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
    ------------------------------------------------------------------------
     1: EE 1023 254  63 - 1023 254  63 [         1 -     409639] <Unknown ID>
     2: AF 1023 254  63 - 1023 254  63 [    409640 -  822265816] HFS+        
    *3: 0B 1023 254  63 - 1023 254  63 [ 822937600 - 1130586112] Win95 FAT-32
     4: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
    fdisk:*1> 
    Exiting and saving gave me an error that it could not access 'exclusively'. Rebooted, slow reboot problem gone but still can't mount/see in rEFInd.


    Tried booting into windows, now says 'missing operating system'.
     
  5. murphychris macrumors 6502a

    Joined:
    Mar 19, 2012
    #5
    The first time you posted this snip from the MBR, the 2nd column labeled 'id' was 0C. Now it's 0B. Why? What's creating these MBR entries?

    I ask because OC and OB imply to me that the underlying file system is FAT32, not NTFS. Are you absolutely 100% positive this is an NTFS file system? Because the id for that should be 07.

    And Windows 7 shouldn't be agreeable to installing on FAT32 although somehow on occasion people manage to make it happen. Apple's Boot Camp Assistant formats the BOOTCAMP partition as FAT32, but the Boot Camp User Guide explicitly says that you must use the Windows 7 installer to reformat this volume as NTFS before installing Windows.




    Why are you using 0B instead of 07?? I did say to use 07 because I'm assuming the boot volume is NTFS, not FAT32.

    You need to stop if you care about the data on this file system. You've possibly inserted into the MBR the wrong partition type code, and the file system itself might now need repairs before you do anything else and make the problem worse.
     
  6. Raikun thread starter macrumors regular

    Joined:
    Apr 8, 2008
    #6
    Okay, I'll stop. In the past I've gotten frustrated with helping people who've taken 0 initiative. I really appreciate the time you're taking to help me out, and I realise that I may be being counterproductive by being overzealous. My university work relies on me being in windows, however.

    What is my next step from here? I used 0B because I didn't readily recognise the ? result for 07 as being NTFS. Should I redo the process, this time with 07?
     
  7. murphychris macrumors 6502a

    Joined:
    Mar 19, 2012
    #7
    Only if you know for sure the volume is NTFS and not FAT32.

    If it is NTFS, the code should be 07. But I would still only boot from a Windows DVD and run chkdsk to make sure the file system is clean, and maybe chkdsk /p to force a full check instead of just relying on the journal. You don't want to use the file system if there's any chance it needs repairs or it will get worse, possibly unusable. NTFS is as fragile as JHFS+/X.
     
  8. Raikun thread starter macrumors regular

    Joined:
    Apr 8, 2008
    #8
    It's honestly been so long since I've installed it. I have no idea why it was 0C before, if anything it should have been 07 originally. I didn't change it to 0C at any point. Is there any way of checking what it was?
     
  9. murphychris macrumors 6502a

    Joined:
    Mar 19, 2012
    #9
    I don't know. Chances are the first few sectors will lend a clue what it is. Something like this:

    Code:
    sudo dd if=/dev/rdiskXsY of=~/winvolume.bin bs=512 count=4
    hexdump -C ~/winvolume.bin
    1. X= the number of the disk, usually 0.
    2. Y= the slice/partition for Windows.
    3. You'll need to find out what NTFS and FAT32 do in the first few sectors to define their volume formats as unique. You might even format a spare USB stick as FAT32/NTFS and use dd to copy its first 4 sectors to a file, then use hexdump to inspect.

    When I tried this on an HFS+ volume, the first two sectors are all zeros. The start of the 3rd sector clearly identifies it as JHFS+.

    Code:
    00000400  48 2b 00 04 80 00 20 00  48 46 53 4a 00 00 14 61  |H+.... .HFSJ...a|
    00000410  cb f2 dc 52 cc 45 fa 4a  00 00 00 00 cb f3 4e e5  |...R.E.J......N.|
    00000420  00 0a d5 64 00 02 0c 0e  00 00 10 00 0a 2e 84 05  |...d............|
    00000430  07 16 1a 3b 03 47 81 18  00 01 00 00 00 01 00 00  |...;.G..........|
    00000440  00 94 5c 4e 04 9a 0b d0  00 00 00 00 02 20 00 fb  |..\N......... ..|
    00000450  00 02 07 f6 00 02 93 e3  00 00 00 00 00 00 00 00  |................|
    00000460  00 00 00 00 00 02 07 f6  8f f0 cc b2 8b 6d 65 f2  |.............me.|
    
    
     

Share This Page