Why does umount automatically remove the mount point of a drive that has been mounted with a file manager?
It is not up to umount
to delete a directory so from command line you need to do it yourself.
You can use a script for that:
#!/bin/bash
mount_point=/media/directory
umount $mount_point && rmdir $mount_point &
and save it as umount.sh
.
The mount_point might be better off as a variable so you could so
./umount.sh /media/dir
Something like this
#!/bin/bash
mount_point=$1
umount $mount_point && rmdir $mount_point &
So why is it automatically removed when I run umount on a drive that has been mounted with a GUI file manager?
The answer to this is more likely a design decision. I have not found any documentation on this (maybe someone else can provide a link ;) )