Recover Macbook APFS PartitionHow do I recover the APFS partition of a Macbook using Ubuntu?Can't remove GPT table from hard driveInstalling Ubuntu problem “the partition assigned to starts at an offset”testdisk says partition table structure is badThe CRC for the main partition and back up partition table are invalidFUBAR Fsckk'd Ubuntu Beyond All Repair?gdisk unable to write GPT tableReinstall of 14.04 after somehow changing mbr to gptHow to recover a lost partition data?Accidentally created new partition table for boot driveRecovery GPT after shrinking partition with sfdisk

Why do we say 'Pairwise Disjoint', rather than 'Disjoint'?

Is it appropriate to ask a former professor to order a library book for me through ILL?

After Brexit, will the EU recognize British passports that are valid for more than ten years?

Is "cogitate" used appropriately in "I cogitate that success relies on hard work"?

How to recover against Snake as a heavyweight character?

Why aren't there more Gauls like Obelix?

Are small insurances worth it?

Short SF story. Females use stingers to implant eggs in yearfathers

Why is there an extra space when I type "ls" on the Desktop?

Vector-transposing function

Unidentified signals on FT8 frequencies

How does a sound wave propagate?

How spaceships determine each other's mass in space?

Generating a list with duplicate entries

Why do we call complex numbers “numbers” but we don’t consider 2-vectors numbers?

How to distinguish easily different soldier of ww2?

Insult for someone who "doesn't know anything"

Can I challenge the interviewer to give me a proper technical feedback?

What would be the most expensive material to an intergalactic society?

How can I portion out frozen cookie dough?

Should I apply for my boss's promotion?

Precision notation for voltmeters

The (Easy) Road to Code

Will the concrete slab in a partially heated shed conduct a lot of heat to the unconditioned area?



Recover Macbook APFS Partition


How do I recover the APFS partition of a Macbook using Ubuntu?Can't remove GPT table from hard driveInstalling Ubuntu problem “the partition assigned to starts at an offset”testdisk says partition table structure is badThe CRC for the main partition and back up partition table are invalidFUBAR Fsckk'd Ubuntu Beyond All Repair?gdisk unable to write GPT tableReinstall of 14.04 after somehow changing mbr to gptHow to recover a lost partition data?Accidentally created new partition table for boot driveRecovery GPT after shrinking partition with sfdisk













1















My question is very similar to this thread, but my situation is slightly different.



I have been successfully dual-booting OS X and Ubuntu for some time now with 2 partitions. I managed the partitions using OS X Disk Utility to avoid any partition table errors that Linux may incur given the new APFS structure.



Recently, I decided to shrink the OS X partition and create a 3rd partition as a dedicated swap partition for Ubuntu. Again, I managed the partitions in OS X Disk Utility to avoid errors. I successfully added the swap partition in Ubuntu (I am sure the correct partition was specified) and all seemed well. However, after I rebooted, the boot manager (stock, not rEFInd) was no longer showing OS X as a boot option. I decided to use gdisk (thank you Rod Smith for your incredible recovery tools!) to check the table structure, and it seems that the OS X partition is still recognized, but has been given the partition code FF. As far as I can tell the sectors all look good, leaving me to believe that all of my data is present. Unfortunately, I don't have a backup because my backup drive recently crapped out. Lucky me.



Can I simply change the type code of the OS X partition to rescue my data? From my understanding, APFS doesn't quite work that way.



Here is my output from gdisk -l:



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

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 488397168 sectors, 232.9 GiB
Model: Crucial_CT250MX2
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): 37FE5D3B-875C-471A-B4FC-A4887DDA4659
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 488397134
Partitions will be aligned on 8-sector boundaries
Total free space is 13 sectors (6.5 KiB)

Number Start (sector) End (sector) Size Code Name
1 40 409639 200.0 MiB EF00 EFI System Partition
2 409640 416425263 198.4 GiB FFFF
3 416425264 449628383 15.8 GiB FFFF
4 449628384 488397127 18.5 GiB 8300


Partition 2 is my OS X partition, partition 3 is my swap partition (not sure why its also marked FFFF instead of 8200?), and partition 4 is the Ubuntu partition.



Here is my output from swapon -s && free to prove I'm not a moron:



Filename Type Size Used Priority
/dev/sda3 partition 16601556 435456 -2

total used free shared buff/cache available
Mem: 16335648 2089764 374952 51452 13870932 14611436
Swap: 16601556 435456 16166100









share|improve this question
























  • Welcome to Ask Ubuntu and thank you for sharing your solution! Apparently your problem was different than mine linked above, luckily for you. :)

    – Andrea Lazzarotto
    Aug 17 '18 at 22:36















1















My question is very similar to this thread, but my situation is slightly different.



I have been successfully dual-booting OS X and Ubuntu for some time now with 2 partitions. I managed the partitions using OS X Disk Utility to avoid any partition table errors that Linux may incur given the new APFS structure.



Recently, I decided to shrink the OS X partition and create a 3rd partition as a dedicated swap partition for Ubuntu. Again, I managed the partitions in OS X Disk Utility to avoid errors. I successfully added the swap partition in Ubuntu (I am sure the correct partition was specified) and all seemed well. However, after I rebooted, the boot manager (stock, not rEFInd) was no longer showing OS X as a boot option. I decided to use gdisk (thank you Rod Smith for your incredible recovery tools!) to check the table structure, and it seems that the OS X partition is still recognized, but has been given the partition code FF. As far as I can tell the sectors all look good, leaving me to believe that all of my data is present. Unfortunately, I don't have a backup because my backup drive recently crapped out. Lucky me.



Can I simply change the type code of the OS X partition to rescue my data? From my understanding, APFS doesn't quite work that way.



Here is my output from gdisk -l:



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

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 488397168 sectors, 232.9 GiB
Model: Crucial_CT250MX2
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): 37FE5D3B-875C-471A-B4FC-A4887DDA4659
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 488397134
Partitions will be aligned on 8-sector boundaries
Total free space is 13 sectors (6.5 KiB)

Number Start (sector) End (sector) Size Code Name
1 40 409639 200.0 MiB EF00 EFI System Partition
2 409640 416425263 198.4 GiB FFFF
3 416425264 449628383 15.8 GiB FFFF
4 449628384 488397127 18.5 GiB 8300


Partition 2 is my OS X partition, partition 3 is my swap partition (not sure why its also marked FFFF instead of 8200?), and partition 4 is the Ubuntu partition.



Here is my output from swapon -s && free to prove I'm not a moron:



Filename Type Size Used Priority
/dev/sda3 partition 16601556 435456 -2

total used free shared buff/cache available
Mem: 16335648 2089764 374952 51452 13870932 14611436
Swap: 16601556 435456 16166100









share|improve this question
























  • Welcome to Ask Ubuntu and thank you for sharing your solution! Apparently your problem was different than mine linked above, luckily for you. :)

    – Andrea Lazzarotto
    Aug 17 '18 at 22:36













1












1








1








My question is very similar to this thread, but my situation is slightly different.



I have been successfully dual-booting OS X and Ubuntu for some time now with 2 partitions. I managed the partitions using OS X Disk Utility to avoid any partition table errors that Linux may incur given the new APFS structure.



Recently, I decided to shrink the OS X partition and create a 3rd partition as a dedicated swap partition for Ubuntu. Again, I managed the partitions in OS X Disk Utility to avoid errors. I successfully added the swap partition in Ubuntu (I am sure the correct partition was specified) and all seemed well. However, after I rebooted, the boot manager (stock, not rEFInd) was no longer showing OS X as a boot option. I decided to use gdisk (thank you Rod Smith for your incredible recovery tools!) to check the table structure, and it seems that the OS X partition is still recognized, but has been given the partition code FF. As far as I can tell the sectors all look good, leaving me to believe that all of my data is present. Unfortunately, I don't have a backup because my backup drive recently crapped out. Lucky me.



Can I simply change the type code of the OS X partition to rescue my data? From my understanding, APFS doesn't quite work that way.



Here is my output from gdisk -l:



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

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 488397168 sectors, 232.9 GiB
Model: Crucial_CT250MX2
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): 37FE5D3B-875C-471A-B4FC-A4887DDA4659
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 488397134
Partitions will be aligned on 8-sector boundaries
Total free space is 13 sectors (6.5 KiB)

Number Start (sector) End (sector) Size Code Name
1 40 409639 200.0 MiB EF00 EFI System Partition
2 409640 416425263 198.4 GiB FFFF
3 416425264 449628383 15.8 GiB FFFF
4 449628384 488397127 18.5 GiB 8300


Partition 2 is my OS X partition, partition 3 is my swap partition (not sure why its also marked FFFF instead of 8200?), and partition 4 is the Ubuntu partition.



Here is my output from swapon -s && free to prove I'm not a moron:



Filename Type Size Used Priority
/dev/sda3 partition 16601556 435456 -2

total used free shared buff/cache available
Mem: 16335648 2089764 374952 51452 13870932 14611436
Swap: 16601556 435456 16166100









share|improve this question
















My question is very similar to this thread, but my situation is slightly different.



I have been successfully dual-booting OS X and Ubuntu for some time now with 2 partitions. I managed the partitions using OS X Disk Utility to avoid any partition table errors that Linux may incur given the new APFS structure.



Recently, I decided to shrink the OS X partition and create a 3rd partition as a dedicated swap partition for Ubuntu. Again, I managed the partitions in OS X Disk Utility to avoid errors. I successfully added the swap partition in Ubuntu (I am sure the correct partition was specified) and all seemed well. However, after I rebooted, the boot manager (stock, not rEFInd) was no longer showing OS X as a boot option. I decided to use gdisk (thank you Rod Smith for your incredible recovery tools!) to check the table structure, and it seems that the OS X partition is still recognized, but has been given the partition code FF. As far as I can tell the sectors all look good, leaving me to believe that all of my data is present. Unfortunately, I don't have a backup because my backup drive recently crapped out. Lucky me.



Can I simply change the type code of the OS X partition to rescue my data? From my understanding, APFS doesn't quite work that way.



Here is my output from gdisk -l:



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

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 488397168 sectors, 232.9 GiB
Model: Crucial_CT250MX2
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): 37FE5D3B-875C-471A-B4FC-A4887DDA4659
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 488397134
Partitions will be aligned on 8-sector boundaries
Total free space is 13 sectors (6.5 KiB)

Number Start (sector) End (sector) Size Code Name
1 40 409639 200.0 MiB EF00 EFI System Partition
2 409640 416425263 198.4 GiB FFFF
3 416425264 449628383 15.8 GiB FFFF
4 449628384 488397127 18.5 GiB 8300


Partition 2 is my OS X partition, partition 3 is my swap partition (not sure why its also marked FFFF instead of 8200?), and partition 4 is the Ubuntu partition.



Here is my output from swapon -s && free to prove I'm not a moron:



Filename Type Size Used Priority
/dev/sda3 partition 16601556 435456 -2

total used free shared buff/cache available
Mem: 16335648 2089764 374952 51452 13870932 14611436
Swap: 16601556 435456 16166100






dual-boot partitioning data-recovery gedit






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 15 '18 at 17:27







D. Mills

















asked Aug 15 '18 at 17:20









D. MillsD. Mills

164




164












  • Welcome to Ask Ubuntu and thank you for sharing your solution! Apparently your problem was different than mine linked above, luckily for you. :)

    – Andrea Lazzarotto
    Aug 17 '18 at 22:36

















  • Welcome to Ask Ubuntu and thank you for sharing your solution! Apparently your problem was different than mine linked above, luckily for you. :)

    – Andrea Lazzarotto
    Aug 17 '18 at 22:36
















Welcome to Ask Ubuntu and thank you for sharing your solution! Apparently your problem was different than mine linked above, luckily for you. :)

– Andrea Lazzarotto
Aug 17 '18 at 22:36





Welcome to Ask Ubuntu and thank you for sharing your solution! Apparently your problem was different than mine linked above, luckily for you. :)

– Andrea Lazzarotto
Aug 17 '18 at 22:36










1 Answer
1






active

oldest

votes


















1














I solved my problem by following this thread's solution and using the GUID 7C3457EF-0000-11AA-AA11-00306543ECAC as my original OS X partition was an APFS container rather than an HFS partition or Logical Volume.



In summary:



1. Boot Mac in Recovery mode (Hold Cmd+R while booting)
2. Open Utilities->Terminal
3. "diskutil list" to identify the partition in question (for me, disk0s2 was marked with GUID FFFF...)
4. gpt -r show disk0" to provide the start sector and size of the disk0 partitions. The output here is very similar to the gdisk -l output of my original post above.
5. "diskutil unmountDisk disk0" to allow the next step...
6. "gpt remove -i 2 disk0" to strip the partition table data associated with the broken partition.
7. "gpt add -b 409640 -i 2 -s 416425263 -t 7C3457EF-0000-11AA-AA11-00306543ECAC"


Part 7 is the most critical step. It adds the correct data to the partition table and recovers the lost partition. Here is the breakdown of the instruction:



'-b' is the beginning sector of the partition as observed in step 4.
'-i' is the index of the partition to be recovered; in my case, this was disk0s2, so index position 2.
'-s' is the size of the partition as observed in step 4.
'-t' is the GUID type of the partition. Specifically, the originally broken data preventing use of the partition (previously marked FFFF...).





share|improve this answer






















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1065640%2frecover-macbook-apfs-partition%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    I solved my problem by following this thread's solution and using the GUID 7C3457EF-0000-11AA-AA11-00306543ECAC as my original OS X partition was an APFS container rather than an HFS partition or Logical Volume.



    In summary:



    1. Boot Mac in Recovery mode (Hold Cmd+R while booting)
    2. Open Utilities->Terminal
    3. "diskutil list" to identify the partition in question (for me, disk0s2 was marked with GUID FFFF...)
    4. gpt -r show disk0" to provide the start sector and size of the disk0 partitions. The output here is very similar to the gdisk -l output of my original post above.
    5. "diskutil unmountDisk disk0" to allow the next step...
    6. "gpt remove -i 2 disk0" to strip the partition table data associated with the broken partition.
    7. "gpt add -b 409640 -i 2 -s 416425263 -t 7C3457EF-0000-11AA-AA11-00306543ECAC"


    Part 7 is the most critical step. It adds the correct data to the partition table and recovers the lost partition. Here is the breakdown of the instruction:



    '-b' is the beginning sector of the partition as observed in step 4.
    '-i' is the index of the partition to be recovered; in my case, this was disk0s2, so index position 2.
    '-s' is the size of the partition as observed in step 4.
    '-t' is the GUID type of the partition. Specifically, the originally broken data preventing use of the partition (previously marked FFFF...).





    share|improve this answer



























      1














      I solved my problem by following this thread's solution and using the GUID 7C3457EF-0000-11AA-AA11-00306543ECAC as my original OS X partition was an APFS container rather than an HFS partition or Logical Volume.



      In summary:



      1. Boot Mac in Recovery mode (Hold Cmd+R while booting)
      2. Open Utilities->Terminal
      3. "diskutil list" to identify the partition in question (for me, disk0s2 was marked with GUID FFFF...)
      4. gpt -r show disk0" to provide the start sector and size of the disk0 partitions. The output here is very similar to the gdisk -l output of my original post above.
      5. "diskutil unmountDisk disk0" to allow the next step...
      6. "gpt remove -i 2 disk0" to strip the partition table data associated with the broken partition.
      7. "gpt add -b 409640 -i 2 -s 416425263 -t 7C3457EF-0000-11AA-AA11-00306543ECAC"


      Part 7 is the most critical step. It adds the correct data to the partition table and recovers the lost partition. Here is the breakdown of the instruction:



      '-b' is the beginning sector of the partition as observed in step 4.
      '-i' is the index of the partition to be recovered; in my case, this was disk0s2, so index position 2.
      '-s' is the size of the partition as observed in step 4.
      '-t' is the GUID type of the partition. Specifically, the originally broken data preventing use of the partition (previously marked FFFF...).





      share|improve this answer

























        1












        1








        1







        I solved my problem by following this thread's solution and using the GUID 7C3457EF-0000-11AA-AA11-00306543ECAC as my original OS X partition was an APFS container rather than an HFS partition or Logical Volume.



        In summary:



        1. Boot Mac in Recovery mode (Hold Cmd+R while booting)
        2. Open Utilities->Terminal
        3. "diskutil list" to identify the partition in question (for me, disk0s2 was marked with GUID FFFF...)
        4. gpt -r show disk0" to provide the start sector and size of the disk0 partitions. The output here is very similar to the gdisk -l output of my original post above.
        5. "diskutil unmountDisk disk0" to allow the next step...
        6. "gpt remove -i 2 disk0" to strip the partition table data associated with the broken partition.
        7. "gpt add -b 409640 -i 2 -s 416425263 -t 7C3457EF-0000-11AA-AA11-00306543ECAC"


        Part 7 is the most critical step. It adds the correct data to the partition table and recovers the lost partition. Here is the breakdown of the instruction:



        '-b' is the beginning sector of the partition as observed in step 4.
        '-i' is the index of the partition to be recovered; in my case, this was disk0s2, so index position 2.
        '-s' is the size of the partition as observed in step 4.
        '-t' is the GUID type of the partition. Specifically, the originally broken data preventing use of the partition (previously marked FFFF...).





        share|improve this answer













        I solved my problem by following this thread's solution and using the GUID 7C3457EF-0000-11AA-AA11-00306543ECAC as my original OS X partition was an APFS container rather than an HFS partition or Logical Volume.



        In summary:



        1. Boot Mac in Recovery mode (Hold Cmd+R while booting)
        2. Open Utilities->Terminal
        3. "diskutil list" to identify the partition in question (for me, disk0s2 was marked with GUID FFFF...)
        4. gpt -r show disk0" to provide the start sector and size of the disk0 partitions. The output here is very similar to the gdisk -l output of my original post above.
        5. "diskutil unmountDisk disk0" to allow the next step...
        6. "gpt remove -i 2 disk0" to strip the partition table data associated with the broken partition.
        7. "gpt add -b 409640 -i 2 -s 416425263 -t 7C3457EF-0000-11AA-AA11-00306543ECAC"


        Part 7 is the most critical step. It adds the correct data to the partition table and recovers the lost partition. Here is the breakdown of the instruction:



        '-b' is the beginning sector of the partition as observed in step 4.
        '-i' is the index of the partition to be recovered; in my case, this was disk0s2, so index position 2.
        '-s' is the size of the partition as observed in step 4.
        '-t' is the GUID type of the partition. Specifically, the originally broken data preventing use of the partition (previously marked FFFF...).






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 15 '18 at 23:14









        D. MillsD. Mills

        164




        164



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1065640%2frecover-macbook-apfs-partition%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Möglingen Índice Localización Historia Demografía Referencias Enlaces externos Menú de navegación48°53′18″N 9°07′45″E / 48.888333333333, 9.129166666666748°53′18″N 9°07′45″E / 48.888333333333, 9.1291666666667Sitio web oficial Mapa de Möglingen«Gemeinden in Deutschland nach Fläche, Bevölkerung und Postleitzahl am 30.09.2016»Möglingen

            Virtualbox - Configuration error: Querying “UUID” failed (VERR_CFGM_VALUE_NOT_FOUND)“VERR_SUPLIB_WORLD_WRITABLE” error when trying to installing OS in virtualboxVirtual Box Kernel errorFailed to open a seesion for the virtual machineFailed to open a session for the virtual machineUbuntu 14.04 LTS Virtualbox errorcan't use VM VirtualBoxusing virtualboxI can't run Linux-64 Bit on VirtualBoxUnable to insert the virtual optical disk (VBoxguestaddition) in virtual machine for ubuntu server in win 10VirtuaBox in Ubuntu 18.04 Issues with Win10.ISO Installation

            Antonio De Lisio Carrera Referencias Menú de navegación«Caracas: evolución relacional multipleja»«Cuando los gobiernos subestiman a las localidades: L a Iniciativa para la Integración de la Infraestructura Regional Suramericana (IIRSA) en la frontera Colombo-Venezolana»«Maestría en Planificación Integral del Ambiente»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»«Conózcanos»«Caracas: evolución relacional multipleja»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»