How can I remove mounted volumes from the list that are no longer attached? I have a problem and I suspect that it might be a symptom of a hardware issue though I am hoping I'm wrong.

If I connect an external drive or mount a disk image it shows up in finder and I can see using the "Disk Utility.app" and it shows up using:

diskutil list


When I finished working with the drive or image I eject it an move on with my day unit a later point when I connect the drive/image again. The problem is, I now have two mounted versions of the same drive. Trying to open "Disk Utility.app" does not work as it endlessly keeps "Loading disks". There is nothing under /Volumes (so no mountpoint) however

diskutil list


Shows the duplicate disks still being connected?

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *2.0 TB     disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:                  Apple_HFS Backup2_GO              2.0 TB     disk2s2

/dev/disk5 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *2.0 TB     disk5
   1:                        EFI EFI                     209.7 MB   disk5s1
   2:                  Apple_HFS Backup2_GO              2.0 TB     disk5s2

/dev/disk6 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *2.0 TB     disk6
   1:                        EFI EFI                     209.7 MB   disk6s1
   2:                  Apple_HFS Backup2_GO              2.0 TB     disk6s2


These are all the one drive which is no longer connected at all. I cannot eject the drive from finder as it is not mounted, I cannot do anything using "Disk Utility.app" as it does not work in this state and I cannot remove the drives using diskutil

diskutil unmountDisk disk2
Unmount of all volumes on disk2 was successful


Though it really was not as all drive are still there and not unmounted at all.

What can I do here? A restart usually solves this however that gets to be really annoying quick.

I cannot open /dev in finder. I can see the content using the terminal though I am unable to remove the mountpoints, even using sudo.

Any suggestions regarding a solution or what might be causing this issue would be greatly appreciated.
So, I had to revise the title/question as the solution to my problem was not an answer to the question posted originally.

As far as I know, there is no way to manually edit the list of attached volumes manually. However, I managed to prevent mounted volumes to become "permanently attached" by borrowing parts of a solution to a similar problem.

The problem seems to be "Time Machine" related, I cannot say for sure though it seems like the problems I described was observed after mounting an old backup drive to access other files. I read a description of a similar problem and thought I'd give it a try and so far it seems to have solved my issue.


Remove the disk from Time Machine's list of backup destination
drives
Move/Rename or Remove the file "tmbootpicker.efi" from the drive's root
directory
Move/Rename or Remove the file /var/db/volinfo.database
Restart
Mount you backup drive and re-add to Time Machine for future backups


After a slower than usual restart (sweating bullets) I was able to mount drives again, tested a backup, mounted and unmounted drives and so far, they are ejected properly and removed from the output of diskutil list. I have not observed any other unwanted effects so far.

This solved my problem (even if this was not the initial question) and I thought I'd post it here if someone else experience similar issues.