You can repair a failed Mac hard disk using a non-GUI mode on OS X and macOS. To do this successfully, follow the procedure below:

  1. The first thing that you need to check is that your Mac is turned off.
  2. Then, you need to press the ‘Power’ button in order to start the Mac followed by holding the Command and S buttons (i.e., Command + S).
  3. After that, you will see single-user mode on the screen, so now, you can begin the repair the failing Mac hard drive along with accessing all the files from it.
  4. You will have to enter a special command in the command line – /sbin /fsck – fy.
  5. Press Return (Enter).
  6. You will now see the command line starting to analyze the volume of your Macintosh HD and return the message based on the action taken.
  7. When the Mac HD is in good condition, it displays the message: "The volume (name) appears to be OK".
  8. When the damaged volume is repaired by FSCK, it displays the message: "The File System Has Been Modified". Repeat FSCK execution until the file system is corrected and the message that appears in step (vii) is displayed again.

In case, your hard drive is not working after following these steps, then you can take help of data recovery experts in Pittsburgh PA because only they can now retrieve data from your damaged MacBook hard drive.