Disk images are unmounted instead of ejected [FIXED]

Questions, glitches, bugs and crashes
Locked
JayB
Posts: 192
Joined: Sun Jan 08, 2017 4:38 pm

Disk images are unmounted instead of ejected [FIXED]

Post by JayB » Tue Jan 10, 2017 4:24 pm

When using CMD-E to eject mounted disk images (e.g. DMGs), the volumes aren't actually ejected, but unmounted instead. This is fine for physical storage volumes, but not really necessary for disk images.

Alternative for "Command" menu, i.e. user choice:

(1) CMD-E and "Eject Volume" > true eject
(2) ALT-CMD-E and "Unmount Volume" > unmount

User avatar
mike
Posts: 1060
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

Re: Disk images are unmounted instead of ejected

Post by mike » Sat Jan 14, 2017 5:06 am

Hi,

That's interesting, I've actually never thought about this difference.

Ok, I've added an eject call after successfully unmounting a volume, unconditionally for now.
Wondering - are there any situations when you don't want a media to be ejected after being unmounted?

I think that having two separate actions for this task is an overkill.

JayB
Posts: 192
Joined: Sun Jan 08, 2017 4:38 pm

Re: Disk images are unmounted instead of ejected

Post by JayB » Sat Jan 14, 2017 11:50 am

Normally you would want all volumes to "go away", so to speak, i.e. true eject. Just unmounting volumes can be a security risk. E.g. you have an encrypted disk image, and if you only unmount it, it's still in the

Code: Select all

diskutil info -all
list, and you can remount it without password input, so anyone with access to your computer while you're away would have access to this encrypted content. On the other hand, unmounting instead of ejecting can also be an advantage, because you just need to run the mount command again on an unmounted volume, and you don't need to navigate through your filesystem to the DMG or sparsebundle to access the disk image file first. As for data safety, there is (to my knowledge) no difference between eject and unmount: after you've unmounted all volumes on an external drive, you can unplug the drive.

User avatar
mike
Posts: 1060
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

Re: Disk images are unmounted instead of ejected

Post by mike » Mon Jan 16, 2017 3:11 am

Alright then, ejecting will be always called after unmounting, done.

Locked