Disk Utility stuck at exit code 0 during partition restore (in Recovery Mode)

bootcampdisk-utilitypartition

I have an iMac running OS X El Capitan.

I tried to use the disk utility in normal boot to restore two partitions into one but it would exit with an error (exit code 8) and delete the second partition. I then tried to restore the partition in the recovery mode. It seemed to have gone fine but it has got stuck at the last step for ~20 hours now (please see attached image).

enter image description here

I realize it's a foolish thing to have done this without having my data backed up! So, I'm not sure if I should try a hard reset.

Best Answer

In theory, exit code 0 means "No errors found, or successfully repaired" - though I don't know why it has then failed to complete & light the Done button.

Exit code 8 was "A corrupt filesystem was found during a check, or repairs did not succeed." which would not really be surprising if you were trying to work on the partition you were booted from.

Disk Utility is actually running a process called fsck_hfs which has published exit codes on the OS X developer pages

EXIT VALUES
     fsck_hfs indicates some status by exit value.  The current list of exit status results is:
           0       No errors found, or successfully repaired.
           3       A quick-check (the -n option) found a dirty filesystem; no repairs were made.
           4       During boot, the root filesystem was found to be dirty; repairs were made, and the
                   filesystem was remounted.  The system should be rebooted.
           8       A corrupt filesystem was found during a check, or repairs did not succeed.
           47      A major error was found with -E.

If you cannot normally Quit Disk Utility, force Quit it with Cmd ⌘ Opt ⌥ Esc , or persuade the Mac to restart or shut down normally, then you may have no option but to hold the power key until it shuts down.