How to remove right click "format" option from a disk icon in the launcher as it can lead to formatting by mistake.
As far as I know...the Format option is hardcoded in the Unity source.
You can try to edit source code to remove the format item.
NOTE: I recommend you to do this in a Virtual Machine or in a Test Machine to see is everything is OK. (In this example I'm running Ubuntu 12.04 with Unity 5.20.0).
1) Make sure you have enable the Source code repository
- Open the Ubuntu Software Center.
- In the Menu Bar choose Edit -> Software Sources. Click to enable "Source code repository". Just in case I use the "Main Server" to Download.
Open a Terminal window Ctrl+Alt+T and type:
sudo apt-get update
2) In the Terminal type the following to install the necessary packages.
sudo apt-get install build-essential quilt
3) Install build dependencies.
sudo apt-get build-dep unity
4) Create a folder to download the source code.
5) Download the source code & Export variables.
apt-get source unity
6) Create the patch and Edit the source code.
quilt new 99_no_format_option.patch
quilt edit plugins/unityshell/src/DeviceLauncherIcon.cpp
Remove the lines... from 171 to 185.
Save the changes.
7) Build the deb packages.
8) Install the deb packages.
sudo dpkg -i *deb
9) Finally you can logout and Login to see the changes.
Hope this helps.