disc utility won't unmount hd
I am trying to erase my old iMac HD using a Command R restart before reinstalling the Sierra operating system. I have reached Disc Utility. In the sidebar it shows: Internal, "WDC WD1001FALS-40U9B0 Media", indented below is "Macintosh HD". Below this is Disk Images, "Apple disc image Media", indented below is "OS Base System".
I selected the top line "WDC WD1001FALS-40U9B0 Media". Typed "Macintosh HD", left Format, Mac OS Extended (Journaled), and Scheme, "Guid" and security as is then pressed Erase.
Error window shows "erase process has failed. Click Done to continue.
Details:- couldn't unmount disc. Operation failed.
I have tried First aid and this passed fine.
Any ideas to fix this?
iMac, macOS Sierra (10.12.5)