OS Monterey unable to open dmg workaround using Terminal
Yesterday, 18Feb22 I updated from Big Sur to Monterey 12.2.1. Today I double clicked on the password protected dmg I keep on the Desktop in which I keep sensitive data. Searching online I found this is a known bug in Monterey. At the r/MacOS subreddit I found a workaround.
In Terminal type hdiutil attach ~/Desktop/'name of dmg' and press Return. I discovered that it only works if I type the full path. Typing the command and dragging the dmg into Terminal didn't do a thing. When the full path is typed, pressing Return caused Terminal to prompt me for the command. Entering it and pressing Return opened the dmg.
This showed me that my dmg was not corrupted but that the problem lies within Monterey.