I had downloaded some DMG files to install some software and kept getting these error messages:
Unable to attach "******.dmg" - Device not configured.
It was happening for more than one .dmg file, and I'm sure the download was not corrupted.
At first, I tried using the Disk Utility, thinking it was related to disk permissions, but the option wasn't present when I selected the DMG. Clicking on "Verify disk" didn't help either, and resulted in the same error "Device not configured".
Tried the instructions below and they worked.
1. Highlight the following text and run in terminal