Okay, so two weeks ago I installed windows 8.1 to try it out and it's when all my problems started. After installation I couldn't connect any monitor to the laptop, but that did not bother me as I didn't like the new windows and went back to 7 instead. The problem is that after the re-installation (I formatted C) the problem persists. And it's like that with Ubuntu 14.04 too. I didn't have any problems before installing windows 8.1 so my thoughts are there are some files that are probably located on one of the other partitions (D or E) as they were not formatted, but I couldn't find any. I'm using a hp probook 4540s with intel hd 4000 graphics and ati radeon hd 7600m series, tried on few different monitors (Lenovo and LG) and it's the same problem. The interesting part is when I boot the pc, the monitor works for 2-3 seconds during welcome screen, but after that when desktop shows it goes to safe mode automatically. I'd appreciate some help as I've been struggling with that for 2 days now. Thanks.