My hard drive is partly visible (only 4.1 GB of 2TB) in "Disks" and has a bad sector. I have tried using the smartmontools to check for bad sectors and then used badblocks -svn /dev/sda
for which I get the response
badblocks: Permission denied while trying to determine device size
Then I tried to use installation utility but the 18.04 LTS stops responding at selecting language.
Edit 3: New development in the issue - the live usb has started to become unresponsive/ freezing.
Edit 4: using the method provided by 1st answer I am getting the error shown: