Up to 17.04 the behaviour was:
When I plug-in an external drive (USB stick, HDD), then it showed up in the sidebar. This was convenient because I was able to eject/safely remove/open it by using the icon in the sidebar.
Now (17.10) an external drive creates an icon on the desktop at some free random place when plugged in. In order to access the icon to eject/safely remove/open the drive, I need to either minimize all windows or switch to another (empty) workspace.
How can I make these external drive icons appearing in the sidebar instead?
This is a missing feature of the GNOME extension called Dash to Dock (even though there are attempts to include this feature, it's not ready yet). Ubuntu Dock found in Ubuntu 17.10 and later is a fork of Dash to Dock.
(Update: The feature is now available and enabled by default on Ubuntu 19.10 and later.)
But you can achieve almost the same feature you're looking for using another extension, but you'll get an indicator in top-bar instead of in the dock. The extension is called "Removable Drive Menu". It shows an indicator in top-bar with the unmount option whenever a drive is mounted.
You can install the extension by simply toggling a button on here (provided you have
chrome-gnome-shell
package and an appropriate browser extension installed).If you don't want to install the browser extension, you can get the archive from the webpage instead and simply extract it to
~/.local/share/gnome-shell/extensions/
. Then you can manage GNOME extensions using (GNOME) Tweaks orgnome-shell-extension-prefs
.