recently my system was very slow, so i formatted it and installed ubuntu. After the reboot i was getting 'Out of Disk' error while booting. I took it to my friend and checked with the USB kind of adapter from which we can use Sata disks as USBs. But the hard disk was not at all working. My friend said the disk inside itself is not running. What would be the problem? Is my hard disk is gone?
There are a variety of bootable disk utilities to test the health of Hard Drives. One simple but effective tool I like to use is Drive Fitness Test. This will tool will essentially go through the drive checking for bad sectors as well as performing a number of other checks in the process.
If DFT reports that the drive is failing (diagnostics in red box) you should check to see if the drive is still under warranty and if possible file an RMA claim to get it replaced. Though, if it is 4 years old that possibility is doubtful.
If the test does not report any problems (green ok) then you don't need to worry for the time being about Hard Drive health and should look elsewhere for the problem.