So I've used my Mac to write the Raspbian OS to a 16 GB SD card, and it ran without problem. Then I updated and upgraded with
sudo apt-get update && sudo apt-get upgrade
I also installed Apache and PHP5
sudo apt-get install apache2 -y && sudo apt-get install php5 libapache2-mod-php5 -y
This took about 5 hours to fetch and install this stuff and because of that I've wanted to create a backup. 5 hours seems like a long time but I guess that's network or SD card speed issue. So I created an image copy of the SD card using Mac OS terminal with the command (I have also tried using .dmg as extension and used disk2 instead of rdisk2)
sudo dd if=/dev/rdisk2 of=~/Documents/pi.img bs=1m
According to the terminal this was succesful. Though, when I plug the SD card back into the Pi, it will boot properly with the lights flashing as they should and all of the boot text being shown on my monitor (through HDMI), but after the boot text it goes almost blank, with a text cursor in the top left corner, flashing a couple of times then disappears and then comes back periodically.
This is where it stops for me. Sometimes I'm able to spam press Ctrl+Alt+F2 and it'll show me to input my username for 3 seconds or something and then hide itself again.
By repeating the task of spamming Ctrl+Alt+F2 when it hides itself again I have been able to actually login and get to the terminal if I am very careful and patient. When I was lucky enough to get into the terminal I tried using
startx
because I read somewhere that, that would start the desktop. It outputted an error which was difficult to read because of the whole thing constantly hiding itself from me.
The system is running with the Pi's LED flashing seemingly correct and the Apache server is running as I can get to it through my other devices on the network with the local IP address, which I got before these errors happened. I can also get to the Pi through SFTP with FileZilla from my Mac.
So the system is running, but I can't use it from the Pi itself. It should also be noted that this is my fourth run, as when I first encountered the problem, I just reinstalled and startet over again.
I am thinking that somehow it is the backup process with dd that does something to SD card, although not corrupting it, as the rest of the system actually runs.
Hope you guys can help me.