Retropie Fails to boot after every Shutdown
-
Looking for some ideas on how to solve boot corruption issue I have.
I am using a raspberry pi zero with Retropie 4.1. I load the image on the 16GB SD card class 10 and place it in the rpi. It boots perfect first time.
if i make absolutely no changes to anything and using the menu i choose shutdown, leave the device for about 20 minutes before disconnecting power, 100% of the time it will not boot on the next power on.I have tried 3 different working SD cards and have tried exiting emulation station first then doing a sudo shutdown -h and still no matter what it will refuse to boot on the next power cycle. I can choose restart instead of shutdown and it will run perfect.
The only way to get it to boot again is to reimage the SD cards.
please halp
-
Hi @jerrekhai
When I first read this, it sounded like a fake SD card and when the OS is resized to fill the device, it is wiping out data. But you mentioned 3 different SD cards in your post. Are they all genuine good quality cards (i.e. not bought from a cheap ebay seller)?
After they fail to boot, if you put them back in your computer, can you see the SD card contents, even in windows, you should be able to see the Boot folder as a drive letter (try opening config.txt), if this doesn't appear then the card is definitely getting corrupt somehow.
Si
-
Thanks for the response,
The SD Cards were purchased at reputable retailers and for much more than on Ebay. Sandisk branded however. I will check to see what windows shows after it corrupts ill have to check tomorrow. Any other suggestions. what should i be looking for in the config and boot folder.
-
That's good to know, I use SanDisk cards in general.
Do you get anything on the screen at all when it fails to boot?
In Windows you cannot see the o/s folders for the pi, but there is a small partition which is mounted as /boot on the pi. You should be able to open config.txt from this folder in Notepad++ or Wordpad, I wouldn't use Notepad as it doesn't recognise the end of line from linux. If you can open this and it looks OK, at least the card isn't being overwritten in full.
Si
-
There is absolutely nothing on the screen, completely black. The flashes on the rpi itself i noticed, will flash a few times then very very dim flashes for a couple seconds when it has been shutdown and restarted and the corruption has occurred.
The blinking is very different the first time i boot.
-
Is the red light flashing? This would suggest a power supply issue.
-
Yellow/green light never red
-
just a thought,
If i take a copy of the boot files before it is placed into the rpi. After it stops booting from the shutdown, Can i just place the boot files back without re-imaging the whole SD card and expect it to boot correctly?
I read somewhere that you can make the FS readonly to prevent changes, but i'm not sure that will help if the corruption is occuring before i have access to console.
-
@jerrekhai What PSU are you using ? (specs please) - have you tried another PSU ?
Do you have any devices connected ?
-
Ok so i solved it. I used 3.8 retropie image instead of 4.1 and it seemed to do more installing and so far boots after every shutdown. 😊
-
I have been having the same issue.
History:
Decided to make my own Retropie, so I took a RaspberryPi 2 that I got last year, since it wasn't in use and downloaded 4.1. Imaged a 16GB Sandisk class 10 SD card with said image. MD5 checksum checked out, so I booted it up and the system comes up on first boot. I configured the controller (which was just a standard USB keyboard) and loaded a few NES roms that I had. Everything comes up fine and I was able to play a few of the games. Did a couple of restarts from within the MAIN menu and the system rebooted every time. So, I decided to shut it down to carry home, since I was working on it from my lab at work. I shutdown the system using the MAIN menus again and the system shutdowns. I did notice that the red light doesn't go off after a shutdown, but honestly I can't remember if this is normal behavior. So, I then unplugged it. After 5 or so minutes, I plugged it back in, just for a sanity check and the system just sits there, without waking up the monitor. The Red light comes on and the activity light does light up green with activity. After a while, it just sits there with an occasional blink from the green light. I left it this way for 10-15 minutes, holding my breathe that it would come on, but with no luck, nothing changed. So, I re-formatted the SD card and tried again. Same results each time. On first boot, everything works as it should. So, I did some more testing, in which each time, plugged the SD card in my Windows machine and checked a few files, to see if I could read them, to see if there was any corruption going on. After spot checking a few of the files, there were no issues in reading those files. I then proceeded to image the card again, and performed the first boot, in this fashion around 4 or 5 times and it produced the same results.After doing some research on the net, it appears that this is only happening on the current release (4.1). Going to try 3.8 and 4.0 to see if this works on those versions. Also in my research I came across a few people who were having some similar issues and they were able to resolve it by updating the firmware version on their Rpi. So, going to try that and see what kind of results that produces. I will send an update with my findings.
-
Okay, I found out a work around, after testing everything under the sun. I tried a new SD card, then tried 3.8 (which produced the same results), tried a new Pi3 (same results) and then did some more research. I finally came across the issue, where when the Raspberry Pi is put in a full halt state, it will not boot back up. I tried the whole resetting it by connecting pins 5 & 6 (physical pins, not GPIO numbers) and this did not work. But, what did work, was temporarily connecting the holes for the RUN function on the board. After doing this, everything works, on both Pi 2 & 3. So in conclusion, I will be building a reset switch for this build.
Does anyone have anything else on this issue or did I miss something on this build. From all of the RetroPie tutorials that I have come across, no one mentions this in their instructions. Also, if there a fix for this or other work-around that I have missed? I am sure I am not the only person who has come across this.
For anyone else who is having this problem, try the above work-around I came across, if you get stumped as I did. Just google and you should find images for your revision of the board. The RUN pin out should be listed in some of the images you may find out. I just used a jumper wire and connected the sockets for only a second, to get it to reboot.
-
@zigshaker You should ask on the official Raspberry Pi forum https://www.raspberrypi.org/forums/ (Or if you think it's a bug you can report it here - https://github.com/raspberrypi/firmware)
-
I also have this problem. RPi 3, RetroPie v4.1. After every shutdown, be it using the menu or the cmd line, the Pi doesn't boot up. Red LED is lit indicating power, and activity LED flashes green indicating activity but no image is produced.
This is getting on my nerves, as the only thing I can do is to reformat the card and reinstall RetroPie. But after every shutdown, the same thing happens. Other OSes/tools run fine.
I guess a reset switch will have to suffice...
-
@Raen see the post above. Unrelated to retropie really.
-
How can it be not related to Retropie if it only happens with the Retropie pre-built standalone image?
A reset workaround is not a solution for the problem, and updating the Rpi firmware didn't solve it.
-
@Raen Because the RetroPie images are just "Raspbian Lite" with the RetroPie software installed on top - nothing that I would think could be related to this.
-
I can understand what you're saying, but one thing I'm sure of: it happens with Retropie even out of the box at the 1st shutdown, and I don't have the problem with vanilla Raspbian for example.
Even if Rpi remains in a dormant state with the Retropie SD cand inserted, even after removing the power connector, it will start correctly right after I swap Retropie's SD card with another one with Raspbian for example. And the SD cards are not the culprits.
-
Between this thread, the retropie forum, reddit, and other sites, this is definetly an issue that popped up with the RetroPie build 4.1. I know RetroPie is a software baseline that bundles the Raspian OS with EmulationStation, but there's something wrong. Perhaps the shutdown script or the way the bundled version of Raspian OS is handling shutdowns.
Pi Model: 3B (CanaKit)
SD Card: Sandisk Ultra 32 GB Class 10, Sandisk Ultra 16 GB Class 10, Patriot 32 GB Class 10
RetroPie Version Used: 4.1
Built From: ISO images from Retropie downloads, then transferred using Win32DiskImager
USB Devices connected: keyboard
Controller used: 8Bitdo 30NES gamepad, keyboard
Error messages received: none
Guide used: https://github.com/RetroPie/RetroPie-Setup/wikiI can confirm doing a shutdown from EmulationStation results in a corrupted SD Card 100% of the time. I've used two different power supplies (both rated for 5v 2.5A) and used a meter to confirm their output. I've used 3 different SD cards (listed above). I've also installed RaspianOS by itself and confirmed I can do a "sudo shutdown -h now" with no problem and survive a reboot; on retroPie 4.1 "sudo shutdown -h now" from the console as well as shutting down from the EmuStation Menu, both result in SD Card corruption and I cant boot again. Yes, I even wait 5 minutes before pulling the power.
Going back to RetroPie 3.8 worked. So, there's "something" with the 4.x RetroPie baseline (most likely with the bundled version of Raspian) that is not shutting down properly. Perhaps the auto-expanding of the file system has something to do with it? I dont know. I hope the devs check this board. I'm open to anything at this point.
-
Workaround Update!
So something caught the corner of my eye that was very odd. After i shutdown, i pulled the power and got ready to walk away and consult my Beer tech manual. And i noticed, the Green LED was blinking...with no power plugged in. However the HDMI cable was still plugged in. This wasnt a latent couple of seconds, this continued for 20-30 seconds and was random, as if something running digital logic was accessing the SD card. To my knowledge you cant power a Pi3B over HDMI, but when i pulled the HDMI cable the blinking stopped. I plugged it back in, then the power, and BOOT! I've repeated this process 10x now successfully. Now power does flow over the HDMI, but its not enough to run a Pi. There must be something in the current version of Raspian that is keeping components on the board alive, they run off the HDMI power, and are accessing the card even after power is pulled, and may result in an SD card corruption. So until this gets worked out, @Raen give this a try:
Shutdown:
- From Emulation Station, select Quit -> Shutdown System -> Yes Really Shutdown
- Wait for a complete shutdown (e.g. 30 seconds), no green blinking just a solid red LED
- Pull the HDMI cable
- Pull the USB Power cable
Startup:
- Plug in the HDMI cable
- Plug in the USB Power cable
@Raen @BuZz @jerrekhai Let me know if this worked for you.
Also, I noticed different behavior on the Pi2 vs Pi3B
sudo shutdown -h now => the green LED flashes several times and then stays on. (Red LED staying on.)
sudo halt -h => the green LED flashes just a few times and then stays off. (Red LED staying on.)So depending on what kind of shutdown script is being ran in the background of EmuStation when you choose Shutdown, there is obviously a different set of actions going on and how Raspian handles the newer Pi3B. And Having an HDMI cable plugged in before you pull the power, has "something" to do with it, coupled with the type of HDMI monitor you are using. Maybe Raspian has a wake on HDMI thing going on?
I shall now go crack a celebratory beer open vs my original pissed of trouble shooting beer. It doesnt fix the problem but i can successfully shutdown and startup my Pi3 w/ RetroPie 4.1 now!
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.