I can use my laptop with out any problem for a while ( sometimes around 12 hours and sometimes just half an hour ), then suddenly one by one, the applications will be closed. I can't shutdown. So I get trapped in a state where I can't open any application and can't shutdown.
Example Situation
I was working on laptop. I had rythmbox, firefox, codeblocks, notepad, files and terminal open. Suddenly, notepad won't save any more. So I closed it. Then the text file won't open any more. I realized what's happening, but I continued working so that I can use the situation to write a question here. After a while, the music stopped. Then firefox closed. Tried opening it again, but nothing happened. Tried to shutdown by pressing the button on the upper right corner of screen. It's suppose to show a drop down menu, but nothing appears. So can't shutdown through this. I opened the terminal. Typed "sudo poweroff", and it showed "command not found: Input/Output Error". Next I closed the lid of my laptop so that it sleeps. I opened the lid to find that I have been logged out. Tried to shutdown from the upper corner button, but the drop down menu did not appear. Next I try to login, but it says wrong password. I am 100% sure that the password is correct.
How I Get Out
It's an example situation, but every situation leads me to a dead end, where I finally simply push the power button of laptop to force it to switch off. I feel that it's bad, but it's the only out of this situation.
Some History
I was using Windows 8 before. I switched to ubuntu cause I was facing a weird problem there. Suddenly one day, out of blue, my hard disk usage started to spike to 100%. The laptop would get laggy and unusable. I switched to Ubuntu fearing some OS problem. But now even in Ubuntu I am facing a different weird problem. At least, here it won't get laggy.
How I use My Laptop
I keep my laptop switched on for really long time every day. I will start my laptop the moment I wake up and continue to use it until I sleep. So that's around 12-16 hours. I tend to use Firefox for internet, Codeblocks for Programming and Rythmbox for music. That's it.
My Doubts
Is it my hard disk? Is it getting too old or something? Or perhaps it's overheating. I don't use a cooler. Is it time to get a new laptop? I want to avoid buying a new one.
Updates
Thanks for the replies. I am trying to do what you guys have instructed. It is tough doing it while the laptop keeps on getting stuck. I managed to get few more data. I will keep on updating as I collect them.
- I tried sudo shutdown now in the "hanged" state. It said "permission denied: cannot access /var/lib/sudo/10.
- I installed iotop. When I ran it during "hanged" state, it showed 0 write and read speed.
- I am on process of doing SMART scan. But I noticed my hard disk temperature 45C/113F. That seems high.
- When I went to "Disks" and into my hard disk, it showed 593 bad sectors. Is that bad?
- I try to create a file using "touch" it says "Read Only File System". Can't use "mv" either. apt-get can't install anything either.
- Suppose there is folder called Pictures. If I write "cd Pictures", it works. But If I write "cd Pic" and press tab to auto fill the name, the terminal closes.