Need to recover SSD partition table using Gdisk on Samsung 512GB on MBP MID 2015

My internal SSD was scrambled due to a power failure during some kind of kernal process or other. It is now unrecognizable in the MBP. I purchased a new SSD and also the OWC external holder for the internal SSD. It is recognized as 251GB uninitialized in the DiskU. Will not mount to do first aid. disutil list shows only this:


/dev/disk2 (external, physical):

  #:            TYPE NAME          SIZE    IDENTIFIER

  0:                          *251.0 GB  disk2


How do I use Gdisk to begin to fix partitions? I do not have this SSD backed up and need to get at a metamask account as I find I saved an incorrect seed phrase (I mixed up seed phrases and threw out the active one!) Could potentially lose 5 k if I cannot recover this! Can anyone held here?

MacBook Pro 15″, macOS 10.12

Posted on Nov 15, 2020 2:16 PM

Reply

Similar questions

45 replies

Nov 17, 2020 8:26 AM in response to BackBay

BackBay wrote:

HWTech has some good recommendations but my Question is: Is there a way to do the (dd) or the better GNU (dd) using a disk image so I can send it to the sandisk I booteded from? (I'm pretty sure I saw this in one of the manuals)

Yes you can send the information into a raw image file by specifying the destination path as a file (replace "diskN" with the drive identifier for the bad SSD):

sudo  ddrescue  --ask  -n  /dev/diskN   ~/Desktop/samsung-clone.img   ~/Desktop/mapping-file.txt


Alternatively, if I install the new apple drive aura pro 480gb: First, the Samsung will not show up (not kidding)

Very odd, but I've seen a lot of odd behaviors with recent Macs. This may be telling us something, but I'm not sure what yet.


Second, it may be cutting it close as far as needing the same amount of space for the data needed for cloning as I am not sure how much was full on the 512GB Samsung drive.]

I'm a bit concerned that your bad Samsung drive is a 512GB drive, but gdisk is only reporting it as 250GB. I just thought the tile of this thread was mistyped.


What I do have is two thunderbolt ports (no proprietary cord for that) another 1TB Sandisk SSD I can empty if needed. and an HDMI port but none of that helps this situation I think.

FYI, if you have any other non-Apple computer with more ports, then you can use that system to clone the bad SSD using a Linux boot disk such as Knoppix which already includes GNU ddrescue. A bit for bit clone is the same regardless of what system does the cloning process.


Or you can purchase a powered USB3 hub to connect multiple USB drives to this Mac. While it is possible to actually attempt the repairs using the raw image file itself macOS tools/utilities don't always work well with them. In the end I find it easier to just push the clone to a spare drive to work from a real drive.


Nov 16, 2020 2:00 PM in response to HWTech

HWTech wrote:

There is a simple to use command "gpt" which can restore the partition table using the backup copy:
sudo gpt recover diskN

If the backup table was available, GDisk should have read it. OP sees this.


Warning! Read error 16; strange behavior now likely!
Warning! Read error 16; strange behavior now likely!


See Semi-Automated Recovery section in https://www.rodsbooks.com/gdisk/repairing.html. If both primary and backup tables are corrupted during power failure, there is a much larger issue with the laptop/SSD controller firmware.

Nov 16, 2020 3:51 PM in response to BackBay

Since you have 2015 Mac, assuming it is the first 4K disk device, I recommend using


sudo gpt -vv -r show /dev/disk0
Password:
gpt show: /dev/disk0: mediasize=1000555581440; sectorsize=4096; blocks=244276265
gpt show: /dev/disk0: PMBR at sector 0
gpt show: /dev/disk0: Pri GPT at sector 1
gpt show: /dev/disk0: Sec GPT at sector 244276264
      start       size  index  contents
          0          1         PMBR
          1          1         Pri GPT header
          2          4         Pri GPT table
          6      76800      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
      76806  150390778      2  GPT part - 7C3457EF-0000-11AA-AA11-00306543ECAC
  150467584   93808640      3  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
  244276224         36         
  244276260          4         Sec GPT table
  244276264          1         Sec GPT header


A dd command is also available on macOS, since you are booted from an external disk. It can be used to make a copy, but will need the same disk space as the size of the SSD for this to work correctly. It should be done first, before GDisk manipulates this disk in any way.


GDisk will create the backup GPT table, once you do the write. The Pri and Sec entries will be cerated. You can also create the EFI.


If you run


sudo dd id=/dev/rdisk0 count=5 2>/dev/null | hexdump -C


what do you get? This will give us the first 5 'sectors' of the on-disk structure.

Nov 19, 2020 11:26 PM in response to Loner T

Wow man, that's an amazing find right there, I am just at a loss for words that I missed that. Here is beetstech SSD guide and then how I missed on OWC website specs:


https://beetstech.com/blog/apple-proprietary-ssd-ultimate-guide-to-specs-and-upgrades#hdr-20

MacBook Pro (Early 2015 - Mid 2015)

The 2015 releases of the MacBook Pro laptops were also relatively minor upgrades, but again the SSDs brought about a huge speed boost, especially for the 15″ model A1398. Both the 13″ and 15″ computers support the full range of drive capacities and supported four channel connections, but the 15″ MacBook Pro also supported PCIe 3.0.

Both the 13″ and 15″ MacBook Pros also support the NVMe protocol and upgrading to Gen. 5 SSDs can bring a modest speed boost to the 13″ model A1502, but the 15″ model A1398 with its PCIe 3.0 connection really allows the NVMe technology to shine. Read speeds increase by ~40% and write speeds can increase by ~60%.


The OWC covers these:

MacBook Pro (15-inch Retina display Mid 2015)

(May, 2015)

Model ID: MacBookPro11,5

2.5GHz, 2.8GHz

Detailed specs


My MBP is 11,4 so even though it says it covers Mid 2015 15"Models it does not cover mine. Shocked.


Great find there Sir. So I will contact the cust. service and find out what IS compatible -- I imagine nothing but we'll see.


Meanwhile I was getting quite demoralized reading up on how to use the GNU ddrescue.


Is there a version of that ddrescue to download that is not some kind of compressed tarballs file for non tech people?


Thanks for finding that one wow...


Nov 15, 2020 2:40 PM in response to BackBay

Some initial questions I have: Do I need to disable SIP? I am using an external SSD to boot the mac and working on the Samsung SSD that is on an OWC ext. Enclosure. Is Disabling SIP necessary?

I do not have a back-up of the disk and now can no longer make one because diskutil will not create disk Image nor will CCC recognize-- is it still possible to use Gdisk to create a binary back-up?

What are the first logical steps to go about approaching Gdisk recovery? I have no idea which method is correct to begin with for my situation. I imagine there is a very easy path for those who are more knowledgeable about computers...


Thanks in advance for any help

Nov 15, 2020 6:33 PM in response to Loner T

The disk was working fine till it was abruptly shut off. When I tried to reboot it was a flashing folder (I think with the question mark). It was working fine before then. If I install it internally it wont be recognized last time I checked. And strangely it is only recognized about 10 percent of the time in the external enclosure. I wait a bit and then it pops up-- this disk needs to be initialized.

Nov 15, 2020 6:39 PM in response to BackBay

So what does this stuff here indicate?


~ michaelleigh$ sudo gdisk -l /dev/disk2

Password:

GPT fdisk (gdisk) version 1.0.5


Warning! Read error 16; strange behavior now likely!

Warning! Read error 16; strange behavior now likely!

Partition table scan:

 MBR: not present

 BSD: not present

 APM: not present

 GPT: not present


Creating new GPT entries in memory.

Disk /dev/disk2: 490234752 sectors, 233.8 GiB

Sector size (logical): 512 bytes

Disk identifier (GUID): B3DDC15B-F14C-4668-B9B0-6D9603D532E9

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 490234718

Partitions will be aligned on 2048-sector boundaries

Total free space is 490234685 sectors (233.8 GiB)


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

Nov 16, 2020 12:48 PM in response to HWTech

I think this implies that I have a backup copy of the partition table right? Which I don't. So this is why I asked if there was a way to make a binary backup above. In Gdisk? The data is meaningful and with vacation photos but really the main priority is getting at that seed phrase on Metamask. It is now worth $8700. If it comes to sending this overseas then yes I will have to do it but I am waiting to hear what Loner T recommends as I have read about his prior data victories on here. The disk had never had a problem then suddenly a power outage wrecks all partitions and recovery of them? I just don't see how that is possible. I holding out the hope that it is actually a simple fix for the person who has seen enough of this kind of thing happen. I believe it was just shut down improperly and mixed up, so there must be a process to straighten out the partitioning so the disk is readable again.

Nov 16, 2020 1:10 PM in response to BackBay

Hey,


I think I had similar problem (still have it). Out of nowhere my macbook pro late 2013 shut down and when I tried to turn it on I had blinking folder. It wasn't recognized by the computer and I needed to save my files. I tried number of things, but unfortunately non of them worked. I went to professional at the very end knowing that that will cost me 600 euros. And they told me that there is a firmware problem and that they cannot fix it at the time, because there is no existing program that can run a repair for that advanced ssd (even though it is 7 year old, at least). As they explained there was a problem with ssd self repair part of the disk (or something like that). Also Samsung original ssd factory installed.


If you find and answer to your problem, please share.

All the best.

Nov 16, 2020 2:48 PM in response to hhh34

The two layouts are shown


sudo gpt -vv -r show /dev/disk0
Password:
gpt show: /dev/disk0: mediasize=1000555581440; sectorsize=4096; blocks=244276265
gpt show: /dev/disk0: PMBR at sector 0
gpt show: /dev/disk0: Pri GPT at sector 1
gpt show: /dev/disk0: Sec GPT at sector 244276264
      start       size  index  contents
          0          1         PMBR
          1          1         Pri GPT header
          2          4         Pri GPT table
          6      76800      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
      76806  150390778      2  GPT part - 7C3457EF-0000-11AA-AA11-00306543ECAC
  150467584   93808640      3  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
  244276224         36         
  244276260          4         Sec GPT table
  244276264          1         Sec GPT header


and...


sudo gpt -vv -r show /dev/disk0
Password:
gpt show: /dev/disk0: mediasize=512110190592; sectorsize=512; blocks=1000215216
gpt show: /dev/disk0: PMBR at sector 0
gpt show: /dev/disk0: Pri GPT at sector 1
gpt show: /dev/disk0: Sec GPT at sector 1000215215
       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   999543392      2  GPT part - 53746F72-6167-11AA-AA11-00306543ECAC
   999953032      262144      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
  1000215176           7         
  1000215183          32         Sec GPT table
  1000215215           1         Sec GPT header



Nov 16, 2020 3:12 PM in response to Loner T

I am still just digesting this info--- but I was not aware that I posted in the Bootcamp forum.

I do not have windows on either disk. So does what you posted still hold up?


I am willing to try to build a primary GPT table but need to know the command line steps as I am not quite sure of everything. - I am still looking at the lines below but do not yet know how to use that.

Also I do have homebrew installed and testdisk.


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Need to recover SSD partition table using Gdisk on Samsung 512GB on MBP MID 2015

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.