How to hide installed drives in Dock on Ubuntu 19.10 (and later)

In Ubuntu 19.10, the dock displays mounted volume and device icons by default. This article explains how to disable these mounted devices so that they cannot be displayed on Ubuntu Dock, Ubuntu 19.10 and later.

Installed drive icons such as USB and other devices can confuse the Ubuntu Dock, especially if you have multiple drives or a smaller screen. Moreover, these mounted volumes still appear in the Files application (Nautilus), so you can already access them easily. First install the Dconf editor:

sudo apt install Dconf Editor

Ubuntu Dock shows mount hidden volumes and device iconsNext open the Dconf editor and go to / org / gnome / shell / extensions / dash-to-dock / show-mountsAnd set its value to falseYou can also hide the mounted drive from the Ubuntu 19.10 dock using the following command:

gsettings set show-mounts false

It is worth noting that in my case, using Ubuntu 19.10 with a dual monitor setup, the Ubuntu Dock icon disappeared from the dock on the second (non-primary) monitor. However, this issue has been resolved after restarting GNOME Shell, so if you encounter this issue, press Restart GNOME Shell Alt + F2, Enter r,then press Enter key. If you are on Wayland, use logout / login to restart the session. Looking for an alternative to Ubuntu Dock? Try using Dash to Panel, which automatically disables the Ubuntu Dock when enabled, and can be used in both horizontal and vertical panel modes. Do you want to undo the changes and show the mounted USB devices and other drives on the Ubuntu Dock? Use the following command:

gsettings set show-mounts true