I removed the external drive icon on the macos, how do i put it back

external-diskfinderhard driveiconterminal

As per title, I decided I wanted to remove my external drive icon (the one that is shown, usually, on the desktop) on my mac, but now I'm not able to put it back.

The problem is not due to the finder preferences, as external drive IS ticked.

I remember doing it from the terminal with a command, but now I'm not able to revert that change.

I did try with the following commands with no luck:

defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true

from this answer: How to show Hard Disk icon on Desktop via Terminal?

and I've also tried with this command:

defaults write com.apple.finder CreateDesktop -bool true; killall Finder

from here: http://www.idownloadblog.com/2016/02/01/how-to-hide-device-icons-on-your-mac-desktop/

But neither worked.

Any help with this? I just want the drive icon to be on the desktop when the drive is connected, nothing more

Thanks for any help

Best Answer

You can reset these settings to their default values by deleting their keys.

defaults delete com.apple.finder ShowHardDrivesOnDesktop
defaults delete com.apple.finder ShowRemovableMediaOnDesktop
defaults delete com.apple.finder CreateDesktop
killall Finder

Note that the CreateDesktop key is for determining whether any icons are on screen, so if you are able to put other files on the Desktop then the problem is not with the CreateDesktop key's value.