Thanks for the tips! I'd like to contribute with my experiences from troubleshooting my friend's unbootable Ubuntu PC. I booted the PC with Xubuntu on USB media. After using command e2fsck the hard disk partition could be mounted, and the files could be retrieved from the hard disk (and my friend got happy:).
Hard disk failure error messages could be seen in kernel ring buffer (and can be printed with dmesg command):
[78748.550250] ata1.00: status: { DRDY ERR }
[78748.550253] ata1.00: error: { UNC }
[78748.572323] ata1.00: configured for UDMA/100
[78748.572341] ata1: EH complete
[78753.326771] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
[78753.326777] ata1.00: BMDMA stat 0x25
[78753.326782] ata1.00: failed command: READ DMA
[78753.326790] ata1.00: cmd c8/00:08:48:0b:44/00:00:00:00:00/e4 tag 0 dma 4096 in
[78753.326792] res 51/40:08:48:0b:44/40:00:04:00:00/e4 Emask 0x9 (media error)
When I tried to install Xubuntu on the PC, the installation stopped because of these media errors. I used Gparted to partition the hard disk and mke2fs command to make ext4 file system excluding bad blocks.
ubuntu@ubuntu:~$ sudo mke2fs -c -t ext4 /dev/sda1
...
...
...
Checking for bad blocks (read-only test): 18.07% done, 2:54:19 elapsed
18.20% done, 8:14:58 elapsed
18.20% done, 8:22:01 elapsed
^[[B20% done, 8:35:08 elapsed
Block checking is so slow I thought execution was stucked. It nearly stopped around 18% and it seemed it will never reach the end. But dmesg showed that block is stepped and that block checking is proceeding. If the blocks are ok, block checking is faster and the whole execution took ca 24 hours. Hard disk size is 40 GB.