I don’t remember under which circumstances problems occurred (it may have been tmutil or diskutil), but as far as I remember commands concerning harddisks did not work in the terminal.
Solution: go to System preferences, open the Security control panel, scroll down to the harddisk entry and add Terminal.app to the applications list on the right.
This seems to be a new security feature introduced in Mojave.