2

This question already has an answer here:

I was trying to install Kali linux in a dual boot fashion when I accidentally ended up install a terminal only version of Debian as a second partition. So I decided to retry, which meant I needed to delete the Debian partition. When I tried to in Disk Utility, it gave me errors, so I booted into internet recovery mode and removed the partitions there. I then proceeded in clicking the Apple Logo and selecting the choose boot partition thing. It showed nothing. At first I panicked, thinking I had somehow deleted all of my data. I tried creating a second partition, so I could install Mac OS there and then fix my mac from there. I clicked on the create partition, waited 3ish hours while I went out, came back and it said preparing to partition. So I rebooted and saw that the partition type was: FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFF. So I installed Mac OS X onto a painfully slow flash drive (15-20MB/s) and then looked up my problem. I found other solution people had created only they were specific to the exact case. I do not know what the partition type is supposed to be so here is my info: /dev/disk1 is the USB flash drive that is running MAC OS X so I can use my laptop.

sh-3.2# diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.3 GB   disk0
   1:                        EFI NO NAME                 209.7 MB   disk0s1
   2: FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF               450.1 GB   disk0s2
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *31.4 GB    disk1
   1:                        EFI EFI                     209.7 MB   disk1s1
   2:                  Apple_HFS Fixer OS                30.5 GB    disk1s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk1s3

And here is some more:

sh-3.2# gpt -r show /dev/disk0
    start       size  index  contents
        0          1         PMBR
        1          1         Pri GPT header
        2         32         Pri GPT table
       34          6         
       40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
   409640  879039128      2  GPT part - FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF
879448768   97656259         
977105027         32         Sec GPT table
977105059          1         Sec GPT header

How can I mount this partition again? Which command should I use?

marked as duplicate by klanomath, user3439894, IconDaemon, Jaime Santa Cruz, fsb Nov 22 '16 at 17:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • @Thoughtyness Please ask a moderator to fuse your accounts (Thoughtyness & Harold Finch). Instead of modifying and expanding the question far beyond the original scope, better ask a new question. – klanomath Nov 22 '16 at 20:22
  • @Thoughtyness Please ask a new (follow-up) question with all the updated content (and a link to the question here) . After you've posted the follow-up I will revert the question here to the previous state. – klanomath Nov 22 '16 at 20:51
3

To add an answer exactly fitting to your case I slightly modified my answer in the linked "duplicate" and posted it here again.


The second partition of your internal disk got the wrong partition type, your data probably won't be lost.

A bootable OS X partition (except the Recovery HD) either has the GUID 48465300-0000-11AA-AA11-00306543ECAC for a standard OS X partition or the GUID 53746F72-6167-11AA-AA11-00306543ECAC for a CoreStorage partition. The FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF is an unknown partition type (but not no partition like the 000000-0000-0000.... one).

The first block of a standard OS X partition doesn't contain non-zeros, the first block of a CoreStorage partition contains some non-zeros. To get the first 3 blocks of a partition enter sudo dd if=/dev/diskXsY count=3 | hexdump.

The GUID can be modified with gpt.


  • Boot to "Fixer OS"
  • Open Terminal
  • Get an overview with diskutil list
  • Get an overview of your internal disk with the disk identifier found in the previous command. Below I assume the disk identifier of your internal disk is disk0 (replace it with the one you have found in your environment)

    sudo gpt -r show disk0
    
  • Unmount disk0 with diskutil umountDisk disk0
  • hexdump the first 3 blocks of the FFFF... partition:

    sudo dd if=/dev/disk0s2 count=3 | hexdump
    

    The following result identfies it as a normal OS X partition:

    0000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    0000400 48 2b 00 04 80 00 21 00 48 46 53 4a 00 00 01 ff
    0000410 d3 8c 77 d3 d4 33 3c b0 00 00 00 00 d3 8c 5b b3
    0000420 00 00 02 a8 00 00 00 25 00 00 10 00 00 fe b7 f6
    0000430 00 fe 1e fa 00 ed 80 00 00 01 00 00 00 01 00 00
    0000440 00 00 10 f2 00 00 5a 9d 00 00 00 00 00 00 00 01
    0000450 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0000460 00 00 00 00 00 00 00 00 7d 9d b0 3a 02 31 62 f0
    0000470 00 00 00 00 00 1f e0 00 00 1f e0 00 00 00 01 fe
    0000480 00 00 00 01 00 00 01 fe 00 00 00 00 00 00 00 00
    0000490 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    00004c0 00 00 00 00 00 60 00 00 00 60 00 00 00 00 06 00
    00004d0 00 00 0a 00 00 00 06 00 00 00 00 00 00 00 00 00
    00004e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    0000510 00 00 00 00 03 10 00 00 03 10 00 00 00 00 31 00
    0000520 00 03 ac 00 00 00 31 00 00 00 00 00 00 00 00 00
    0000530 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    0000560 00 00 00 00 05 40 00 00 05 40 00 00 00 00 54 00
    0000570 00 00 10 00 00 00 54 00 00 00 00 00 00 00 00 00
    0000580 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    0000600
    

    The first number is the byte count in hex: 0000000: 0; 0000600: 1536. The * denotes identical lines. This means: the first two blocks (0x000-0x3ff) are all zeros.

    A CoreStorage partition shows some non-zeros in the first block (0x000-0x1ff):

    0000000 0c 73 a1 a9 ff ff ff ff 01 00 10 00 07 14 d7 01
    0000010 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0000030 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0000040 00 20 c1 cc 0f 00 00 00 00 00 00 00 00 00 00 00
    0000050 00 00 00 00 00 00 00 00 43 53 01 00 00 00 04 00
    0000060 00 10 00 00 00 00 40 00 11 bc fc 00 00 00 00 00
    0000070 11 c0 fc 00 00 00 00 00 11 c4 fc 00 00 00 00 00
    0000080 11 c8 fc 00 00 00 00 00 00 00 00 00 00 00 00 00
    0000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00000a0 00 00 00 00 00 00 00 00 10 00 00 00 02 00 00 00
    00000b0 62 02 98 59 ee a9 ab 51 9b 49 23 90 2e f8 8b 43
    00000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    0000130 e4 6e f8 f2 63 99 45 c1 b2 13 86 28 a5 18 46 6d
    0000140 c4 51 c0 f6 32 f9 43 ab 8e 59 42 d2 1a ef f6 50
    0000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    0000400 48 2b 00 04 80 00 21 00 48 46 53 4a 00 00 01 ff
    0000410 d1 98 a4 93 d4 33 8b d5 00 00 00 00 d1 98 88 73
    0000420 00 06 07 53 00 01 82 39 00 00 10 00 00 fb 6a 00
    0000430 00 c5 1c 55 00 25 73 c7 00 01 00 00 00 01 00 00
    0000440 00 0d e2 65 00 3e a2 fb 00 00 00 00 02 20 00 fb
    0000450 00 00 00 31 00 06 b9 ef 00 00 00 00 00 00 00 00
    0000460 00 00 00 00 00 00 00 31 fb 48 1e a0 6c 47 a2 9f
    0000470 00 00 00 00 00 1f e0 00 00 1f e0 00 00 00 01 fe
    0000480 00 00 00 01 00 00 01 fe 00 00 00 00 00 00 00 00
    0000490 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    00004c0 00 00 00 00 00 60 00 00 00 60 00 00 00 00 06 00
    00004d0 00 00 0a 00 00 00 06 00 00 00 00 00 00 00 00 00
    00004e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    0000510 00 00 00 00 0e 40 00 00 01 30 00 00 00 00 e4 00
    0000520 00 00 10 00 00 00 e4 00 00 00 00 00 00 00 00 00
    0000530 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    0000560 00 00 00 00 11 d0 00 00 01 30 00 00 00 01 1d 00
    0000570 00 02 80 00 00 00 72 00 00 13 30 97 00 00 13 00
    0000580 00 15 c5 aa 00 00 13 00 00 18 2d 23 00 00 13 00
    0000590 00 19 d8 fb 00 00 13 00 00 1b 76 cb 00 00 13 00
    00005a0 00 1c 34 70 00 00 13 00 00 1d 0e 4d 00 00 13 00
    00005b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    0000600
    

    The line starting with byte 0x130 shows the UUID of the Physical Volume, the line starting with byte 0x140 shows the UUID of the Logical Volume Group.

    The string 48 46 53 4a (= "HFSJ") in the first 16 bytes of the third blocks identifies a Journaled HFS+ volume on both partition types.

  • Now remove the second partition:

    diskutil umountDisk disk0
    sudo gpt remove -i 2 disk0
    

    re-add the partition with the proper type
    either a normal OS X partition

    sudo gpt add -i 2 -b 409640 -s 879039128 -t 48465300-0000-11AA-AA11-00306543ECAC disk0
    

    or (if you have found a CoreStorage partition)

    sudo gpt add -i 2 -b 409640 -s 879039128 -t 53746F72-6167-11AA-AA11-00306543ECAC disk0
    
  • Finally verify/repair the disk with diskutil verifyDisk disk0 and/or diskutil verifyVolume disk0s2. If a repair is needed use repair (instead of verify) as prefix in the above commands but contact me before repairing it and send me the error message.

-1

Sorry for my previous non-answer, reading fail on my part.

You can use gpt to change type UUIDs on partitions, by removing the GPT record and re-adding it with a different type. (gpt requires exclusive access to do it, so you must boot from another drive/internet recovery) You just need to copy verbatim the starting sector and size.

in your case, that would be:

gpt remove -i 2 disk0
gpt add -b 409640  -s 879039128 -t hfs disk0

Not the answer you're looking for? Browse other questions tagged .