Iyassou

Q: GPT help

https://discussions.apple.com/message/26125763#26125763

 

Output of sudo fdisk /dev/rdisk0 :

 

Disk: /dev/rdisk0geometry: 60801/255/63 [976773168 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: 07 1023 254  63 - 1023 254  63 [    409640 -  469338128] HPFS/QNX/AUX

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

4: 07 1023 254  63 - 1023 254  63 [ 471017472 -   76855296] HPFS/QNX/AUX

 

I am using GPT fdisk (or gdisk).

 

I don't remember all that I've tried to do, but the changes that I had made were: changing the 4th partition's id to 07 (then because of a confusion, the 2nd partition's id to 07). That's it.

MacBook Pro, Mac OS X (10.7)

Posted on Jun 15, 2014 10:24 AM

Close

Q: GPT help

  • All replies
  • Helpful answers

Previous Page 2 of 3 last Next
  • by Loner T,

    Loner T Loner T Jun 16, 2014 5:47 AM in response to Iyassou
    Level 7 (24,825 points)
    Safari
    Jun 16, 2014 5:47 AM in response to Iyassou

    Can you post the output of gpt/gdisk and fdisk? It may no longer be /dev/rdisk0, so a diskutil list would also be helpful.

     

    1. Computer 1 with Bootcamp (in Target Disk Mode).

    2. Computer 2 with Mac OS X.

    3. Connect Computer 1 to Computer 2 via Firewire/Thunderbolt cable.

    4. Computer 1's hard drive should now be visible on Computer 2.

  • by Iyassou,

    Iyassou Iyassou Jun 16, 2014 5:41 AM in response to Loner T
    Level 1 (0 points)
    Jun 16, 2014 5:41 AM in response to Loner T

    I can't boot into anything. My computer is shut down and I'm replying from my phone.

  • by Loner T,

    Loner T Loner T Jun 16, 2014 5:49 AM in response to Iyassou
    Level 7 (24,825 points)
    Safari
    Jun 16, 2014 5:49 AM in response to Iyassou

    Iyassou wrote:

     

    I can't boot into anything. My computer is shut down and I'm replying from my phone.

    Do you have access to a second MAC computer?

    Do you have an external CD/DVD?

  • by Iyassou,

    Iyassou Iyassou Jul 4, 2014 9:39 AM in response to Loner T
    Level 1 (0 points)
    Jul 4, 2014 9:39 AM in response to Loner T

    Hi, I found another mac. Here's the output of sudo fdisk /dev/disk1:

     

    Disk: /dev/disk1 geometry: 60801/255/63 [976773168 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 -  469338128] HFS+       

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

    *4: 07 1023 254  63 - 1023 254  63 [ 471017472 -  352045056] HPFS/QNX/AUX

  • by Loner T,

    Loner T Loner T Jul 4, 2014 10:11 AM in response to Iyassou
    Level 7 (24,825 points)
    Safari
    Jul 4, 2014 10:11 AM in response to Iyassou

    Can you also post the GPT for this disk? Just need to ensure they are both in sync.

  • by Iyassou,

    Iyassou Iyassou Jul 4, 2014 10:20 AM in response to Loner T
    Level 1 (0 points)
    Jul 4, 2014 10:20 AM in response to Loner T

    And how do I do that? Sorry if this was a simple question

  • by Loner T,

    Loner T Loner T Jul 4, 2014 10:28 AM in response to Iyassou
    Level 7 (24,825 points)
    Safari
    Jul 4, 2014 10:28 AM in response to Iyassou

    sudo gpt -vv -r show /dev/disk1

     

    The MBR looks correct. MAC OS X not booting is strange!

  • by Iyassou,

    Iyassou Iyassou Jul 4, 2014 10:31 AM in response to Loner T
    Level 1 (0 points)
    Jul 4, 2014 10:31 AM in response to Loner T

    Here's the output of sudo gpt -vv -r show /dev/disk1 :

     

    gpt show: /dev/disk1: mediasize=500107862016; sectorsize=512; blocks=976773168

    gpt show: /dev/disk1: Suspicious MBR at sector 0

    gpt show: /dev/disk1: Pri GPT at sector 1

    gpt show: /dev/disk1: Sec GPT at sector 976773167

          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  469338128      2  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

      469747768    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC

      471017304        168        

      471017472  352045056      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

      823062528  153710607        

      976773135         32         Sec GPT table

      976773167          1         Sec GPT header

  • by Loner T,

    Loner T Loner T Jul 4, 2014 11:47 AM in response to Iyassou
    Level 7 (24,825 points)
    Safari
    Jul 4, 2014 11:47 AM in response to Iyassou

    This is strange, because they both match.

     

    One possibility is that bless information was lost when Partition 2 was changed from '07' to 'AF'. Can you run the following command.

     

    The "Macintosh\ HD" string in the following command needs to be replaced with the volume name that you can see when you run diskutil list command for /dev/disk1. Sample output from my machine is shown below.

     

    diskutil list

    /dev/disk0

      #:                      TYPE NAME                    SIZE      IDENTIFIER

      0:      GUID_partition_scheme                        *1.0 TB    disk0

      1:                        EFI EFI                    209.7 MB  disk0s1

      2:                  Apple_HFS Macintosh HD            743.7 GB  disk0s2

      3:                Apple_Boot Recovery HD            650.0 MB  disk0s3

      4:      Microsoft Basic Data BOOTCAMP                256.0 GB  disk0s4

     

    sudo bless --info /Volumes/Macintosh\ HD/System/Library/CoreServices/

     

    finderinfo[0]:    45 => Blessed System Folder is /System/Library/CoreServices

    finderinfo[1]: 1478210 => Blessed System File is /System/Library/CoreServices/boot.efi

    finderinfo[2]:      0 => Open-folder linked list empty

    finderinfo[3]:      0 => No alternate OS blessed file/folder

    finderinfo[4]:      0 => Unused field unset

    finderinfo[5]:    45 => OS X blessed folder is /System/Library/CoreServices

    64-bit VSDB volume id:  0x3EE7659409EF64D1

  • by Iyassou,

    Iyassou Iyassou Jul 4, 2014 12:13 PM in response to Loner T
    Level 1 (0 points)
    Jul 4, 2014 12:13 PM in response to Loner T

    Output of diskutil list :

     

    /dev/disk0

       #:                       TYPE NAME                    SIZE       IDENTIFIER

       0:      GUID_partition_scheme                        *500.3 GB   disk0

       1:                        EFI EFI                     209.7 MB   disk0s1

       2:                  Apple_HFS Macintosh HD            499.4 GB   disk0s2

       3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

    /dev/disk1

       #:                       TYPE NAME                    SIZE       IDENTIFIER

       0:      GUID_partition_scheme                        *500.1 GB   disk1

       1:                        EFI EFI                     209.7 MB   disk1s1

       2:       Microsoft Basic Data                         240.3 GB   disk1s2

       3:                 Apple_Boot Recovery HD             650.0 MB   disk1s3

       4:       Microsoft Basic Data                         180.2 GB   disk1s4

     

    So should I write :  sudo bless --info Microsoft Basic Data   ?  I think that I am wrong here...

  • by Loner T,

    Loner T Loner T Jul 4, 2014 12:32 PM in response to Iyassou
    Level 7 (24,825 points)
    Safari
    Jul 4, 2014 12:32 PM in response to Iyassou

    Bless is OSX specific. Do not use it on Bootcamp volume. The last string in this line (called the PartitionType GUID)

     

         409640  469338128      2  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

     

    is incorrect. It should

     

          409640  1452530904      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC

     

    OS X will not recognize this and boot from it. Fdisk and GPT are two separate entities. the '07' to 'AF' was corrected in MBR (via fdisk), but the GPT needs to be corrected via gdisk.

     

    This is what it should look like...

     

    Partition number (1-4): 2

    Partition GUID code: 48465300-0000-11AA-AA11-00306543ECAC (Apple HFS/HFS+)

    Partition unique GUID: 98D8DC3F-F7F8-41A2-B5AA-6FBFC53694BB

    First sector: 409640 (at 200.0 MiB)

    Last sector: 1452940543 (at 692.8 GiB)

    Partition size: 1452530904 sectors (692.6 GiB)

    Attribute flags: 0000000000000000

    Partition name: 'Customer'

  • by Loner T,

    Loner T Loner T Jul 4, 2014 12:46 PM in response to Iyassou
    Level 7 (24,825 points)
    Safari
    Jul 4, 2014 12:46 PM in response to Iyassou

    I suggest you read this first - http://www.rodsbooks.com/gdisk/repairing.html before an attempt is made to fix the GPT.

     

    Need to ensure the commands I give you do not cause further damage.

  • by Loner T,

    Loner T Loner T Jul 4, 2014 1:09 PM in response to Iyassou
    Level 7 (24,825 points)
    Safari
    Jul 4, 2014 1:09 PM in response to Iyassou

    Can you run the following commands? These do not change the GPT in any way.

     

    sudo gdisk /dev/disk1

    p

    i

    2

    q

     

    Here is what I did on my system.

     

    sudo gdisk /dev/disk0

    Password:

    GPT fdisk (gdisk) version 0.8.9

     

    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: 1954210120 sectors, 931.8 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): 6ED0C429-00D1-4759-B50E-04B6FB80D0E3

    Partition table holds up to 128 entries

    First usable sector is 34, last usable sector is 1954210086

    Partitions will be aligned on 8-sector boundaries

    Total free space is 1293 sectors (646.5 KiB)

     

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

       1              40          409639   200.0 MiB   EF00  EFI System Partition

       2          409640      1452940543   692.6 GiB   AF00  Customer

       3      1452940544      1454210079   619.9 MiB   AB00  Recovery HD

       4      1454211072      1954209791   238.4 GiB   0700  BOOTCAMP

     

    Command (? for help): i

    Partition number (1-4): 2

    Partition GUID code: 48465300-0000-11AA-AA11-00306543ECAC (Apple HFS/HFS+)

    Partition unique GUID: 98D8DC3F-F7F8-41A2-B5AA-6FBFC53694BB

    First sector: 409640 (at 200.0 MiB)

    Last sector: 1452940543 (at 692.8 GiB)

    Partition size: 1452530904 sectors (692.6 GiB)

    Attribute flags: 0000000000000000

    Partition name: 'Customer'

    Command (? for help): q

  • by Iyassou,

    Iyassou Iyassou Jul 4, 2014 1:26 PM in response to Loner T
    Level 1 (0 points)
    Jul 4, 2014 1:26 PM in response to Loner T

    Here's the output:

     

    sudo gdisk /dev/disk1

    GPT fdisk (gdisk) version 0.8.10

     

    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/disk1: 976773168 sectors, 465.8 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): CC23DCF4-ADFD-44F0-94BF-15908E15095C

    Partition table holds up to 128 entries

    First usable sector is 34, last usable sector is 976773134

    Partitions will be aligned on 8-sector boundaries

    Total free space is 153710781 sectors (73.3 GiB)

     

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

       1              40          409639   200.0 MiB   EF00  EFI System Partition

       2          409640       469747767   223.8 GiB   0700  Customer

       3       469747768       471017303   619.9 MiB   AB00  Recovery HD

       4       471017472       823062527   167.9 GiB   0700  BOOTCAMP

     

    Command (? for help): i

    Partition number (1-4): 2

    Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Microsoft basic data)

    Partition unique GUID: A42254FD-CBE8-4FBE-B25E-24F5152205CB

    First sector: 409640 (at 200.0 MiB)

    Last sector: 469747767 (at 224.0 GiB)

    Partition size: 469338128 sectors (223.8 GiB)

    Attribute flags: 0000000000000000

    Partition name: 'Customer'

  • by Loner T,

    Loner T Loner T Jul 4, 2014 1:28 PM in response to Iyassou
    Level 7 (24,825 points)
    Safari
    Jul 4, 2014 1:28 PM in response to Iyassou

    The partition type needs to be changed via GPT fdisk(disk). The GPT is backed-up via the first command (it will prompt for a filename which will be written to the current local directory). After the backup, the partition type for partition 2 is changed from 0700 (Microsoft...) to HFS/HFS+ (AF00).

     

    sudo gdisk /dev/disk1

    b

    <FileName>

    t

    2

    AF00

    i

    2

    w

     

    This should allow the currently "broken" Mac to boot.

     

    Here is test I ran (without the write part).

     

    sudo gdisk /dev/disk0

    GPT fdisk (gdisk) version 0.8.9

     

    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): t

    Partition number (1-4): 2

    Current type is 'Apple HFS/HFS+'

    Hex code or GUID (L to show codes, Enter = AF00):

    Changed type of partition to 'Apple HFS/HFS+'

     

    Command (? for help): i

    Partition number (1-4): 2

    Partition GUID code: 48465300-0000-11AA-AA11-00306543ECAC (Apple HFS/HFS+)

    Partition unique GUID: 98D8DC3F-F7F8-41A2-B5AA-6FBFC53694BB

    First sector: 409640 (at 200.0 MiB)

    Last sector: 1452940543 (at 692.8 GiB)

    Partition size: 1452530904 sectors (692.6 GiB)

    Attribute flags: 0000000000000000

    Partition name: 'Customer'

     

    Command (? for help): q

Previous Page 2 of 3 last Next