This tutorial shows how to hide the icons of mounted drives / partitions from the left (or bottom) dock launcher in Ubuntu 21.10 and / or Ubuntu 20.04.
When you plug in a USB drive or browse through an external system partition in Nautilus file manager, a new device icon will appear in the left dock panel in Ubuntu Gnome desktop.
To keep your panel clean, you may remove these removable device icons and prevent them from appearing again. And this can be done either by running a single command in terminal or using a graphical configuration tool called Dconf Editor.
Single command to hide mounted devices from Ubuntu Dock:
1.) Firstly, open terminal either by pressing Ctrl+Alt+T key combination on keyboard or by searching it from the Activities overview screen.
2.) When terminal opens, copy and paste the command below into it and hit Enter.
gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts false
Removable disk and USB icons on panel disappear immediately after running this command.
(Optional) At anytime, you can reset the change if you change your mind by running command in a terminal windows:
gsettings reset org.gnome.shell.extensions.dash-to-dock show-mounts
Remove Mounted icons from Ubuntu Dock via Dconf Editor:
For those hating Linux command, an advanced configuration tool ‘Dconf Editor’ is present to do the trick.
1.) Firstly, search for and install dconf editor
via Ubuntu Software if you don’t have it:
2.) Next search for and launch the tool from activities overview, then navigate to org/gnome/shell/extensions/dash-to-dock
.
There scroll down and find out the key “show-mounts“, and turn off the toggle icon will do the job.
That’s all. Enjoy!
How about only showing certain mounts, or only blocking certain mounts? Is that possible?
I am looking to reactivate mounted drives in Ubuntu 18.04, and that “show-mounts” feature is not available
Do you know if there is a way to update nautilus maybe ? adding an extension ?
Thanks