I mount a device with this commands:
sudo mkdir /media/(device uuid)
sudo mount (device path) /media/(device uuid)
Then when it comes to unmount it:
sudo umount (device path)
sudo rmdir /media/(device uuid)
The problem is that when I do this, the icon remains the launcher, but if I mounted and unmounted the same device using the mouse (not using the command line) there will be no problem.
How can I get the same result than doing it graphically but using the command line?