When I restart my computer I usually type my password to log me in. However, when I try to do this now it shows me the following message:
"Your computer restarted because of a problem"
So I restart my laptop and enter my password again but I still get the same error message. This happens repeatedly if I reboot, so I can't login anymore.
After researching this problem I found out that my computer is suffering a kernel panic. I tried the following 3 possible solutions I found to fix this problem:
- I used the cmd + option + P + R shortcut during startup to reset the NVRAM.
- I booted into Safe Mode by holding the shift key down while rebooting.
- I booted into Recovery with the cmd + R keys to get me into OS X Utilities to run First Aid on the Startup Disk.
None of the above resolved the issue.
Can anyone help me fix this problem?
Best Answer
This answer assumes:
The following steps will allow you to delete what we call a
sleepimage
file. These are usually quite large and should free up enough space for you to be able to log back in.Note that while this can be done in much fewer steps (steps 4 to 10 could be removed and step 11 could contain a much longer file path), I've deliberately split this up to reduce the risk of making a typo and to make it easier to understand.
Deleting your sleepimage file via Single User Mode
/sbin/mount -uw /
(note there is a space after the 't' and again after the 'w') and then pressing the enter keyls
and pressing the enter keycd private
(note there is a space after 'cd') and press the enter keycd var
(note there is a space after 'cd') and press the enter keycd vm
(note there is a space after 'cd') and press the enter keyls
and press the enter keysleepimage
file located here (this is what we're going to remove)rm sleepimage
(note there is a space after 'rm') and press the enter keyreboot
and then pressing the enter keyHopefully this will free enough space for you to be able to login. If so, then take the time to remove any other data you don't need. If not, message me and we'll go from there.
NOTE: If your Mac doesn't reboot after Step 12, feel free to switch it off with the power button.
IMPORTANT: - You really should have a backup regime in place! Buy yourself an external USB hard drive and start using Time Machine for backups!
Deleting downloads via Single User Mode
Since you know you have items in your Downloads you can delete, these steps will help you do that from Single User Mode.
cd users
(note there is a space after 'cd') and press the enter keyls
and press the enter keycd marvin
(note there is a space after 'cd'). Obviously, if your username is something else, then use that instead of marvin!ls
and press the enter keycd downloads
(note there is a space after 'cd') and press the enter keyls
and press the enter keyrm
command to remove items you don't want.rm Installer.dmg
(note there is a space after 'rm') and pressing the enter keyreboot
and then pressing the enter keyNote: If an item has a space in its name (e.g. Install XYZ.dmg), then the command you would need to enter is
rm Install\ XYZ.app
. That is, I have used a backslash\
before the space!Deleting Applications via Single User Mode
If you want to remove applications, then follow these steps:
cd applications
(note there is a space after 'cd') and press the enter keyls
and press the enter keyrm
command to remove items you don't want.rm XYZ.app
(note there is a space after 'rm') and pressing the enter keyreboot
and then pressing the enter keyNote: If an item has a space in its name (e.g. Microsoft Word.app), then the command you would need to enter is
rm Microsoft\ Word.app
. That is, I have used a backslash\
before the space!