All we need is an easy explanation of the problem, so here it is.
I’m trying to figure out how to change icons for individual drives.
As you can see the last three are indistinguishable until hovered:
How to solve :
I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.
The trick with
autorun.inf suggested by pLumo seems not to work anymore, but one can set icons via the
x-gvfs-icon option in
For this option only icons that are provided through an icon theme can be used.
x-gvfs-icon with gnome-disks
If you want to be on the safe side, make a backup copy of your
sudo cp /etc/fstab /etc/fstab.backup
gnome-disks (it is under Activities -> Utilities – Disks). Find the partition for which you want to change the icon, select it (it must be highlighted) and click on the gear icon ("Additional partition options").
In the menu, that pops up select "Edit Mount Options…".
In the dialog you must first switch off "User Session Defaults". Then under "Icon Name" you can place a name known to the icon theme. For a first test you could put
gnome-cd, which will get you an CD-icon. How to find icon names and how to add custom ones I will explain in the following two sections.
Before clicking "OK", ensure yourself, that the other options are correct, for example "Mount at system startup". When you click "OK", enter your password, which will then save those settings in
gnome-disks provides you with good default options, but still you have to handle them with care.
The new entry in
/etc/fstab that has been created for us could for example look like this:
/dev/disk/by-uuid/<the-uuid> /mnt/<the-uuid> auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-icon=<name-of-the-icon>,noauto 0 0
Find some icon names in the theme
Icons are located under
/usr/share/icons/<theme-name>/<size>/<topic>, so for example to look up 48×48 device icons in the Yaru theme one can do:
The name for
x-gvfs-icon is simply without the file ending.
How to create a small custom icon theme
This are a few steps to create custom icons that can be used for
I assume in this description that you have put an icon called
~/Downloads. Formats accepted are PNG or SVG, ICO did not work for me. The size should be somewhere between 32 and 128 pixels for PNG.
prepare the folders
sudo bash cd /usr/share/icons/ mkdir -p custom/any/devices
I assume that you do not want to maintain different sizes, so I just used
anyfor the size.
create the index.theme file
and put the following content into it:
[Icon Theme] Name=Custom Comment=Icons added by the user Directories=any/devices [any/devices] Context=Devices Size=48 Type=Fixed
Note that the "Size" parameter is just a hint for GTK, the actual size of the file can differ.
copy a new icon
cp ~/Downloads/mydrive.png /usr/share/icons/custom/any/devices
link to the new theme from existing themes
Here if you are using different theme now, you must replace
Yaruwith the name of your theme. I edit
Humanityhere too, because it is a fallback for many themes.
gedit ...) the files
That gives for Yaru:
and for Humanity:
Exit the super user bash with
Done! Now the name
mydrive can be used as "Icon Name" in gnome-disks!
After copying new icons, a restart of Gnome (logoff + logon) might be required!
Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂