How to show Hard Disk icon on Desktop via Terminal?
To show various drive icons on the desktop use the following commands in Terminal:

External hard drives:

defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true


Hard drives:

defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true


Removable media:

defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true


(To complete all options available in the Finder preferences: mounted servers:)

defaults write com.apple.finder ShowMountedServersOnDesktop -bool true


Afterwards restart the Finder:

killall -HUP Finder


To disable showing the respective desktop icons simply replace true by false