Can RetroPie run Read-Only with USB for write needs?
-
Hello,
Is it possible to run Retropie's SD card in a read only mode (or RO filesystem type setting) and utilize USB storage for Roms, saves, etc? I am worried about wrecking SD cards...
As a newbie to all of this I was able to get it up and running but I burned 2 SD cards and they are gone. They show "32mb RAW". And everything I read explains I blew them up good. hehe
So my goal would be set it all up perfectly the way I want it then set it to read only so I won't corrupt the SD card and anything that needs to be written can be pushed to the USB device.
I am just looking for a good way to protect it from me and any other interrupted power issues.
I have been checking these forums and others but I am not sure if it will work or how to go about starting it if it would work.
Thanks for reading, any information would be appreciated.
First post be gentle. :) -
Hey @wickedklown007 and welcome to the forum.
When you say you "burned" 2 SD cards, do you mean they no longer work at all? Or do you mean that you copied over the retropie image to these cards.
I have a suspicion that you're using a windows computer to create your SD cards.
If that's true, than the SD card will only show a small fraction of their actual size on windows because they were formatted for the pie (which runs Linux).
Have you tried putting this "burned" SD cards in your pie and turning it on? It may be that your problem isn't a problem at all.
As for adding roms, here's a handy guide: https://github.com/RetroPie/RetroPie-Setup/wiki/Transferring-Roms
-
Yes you can use USB for games and the game save storage (I strongly recommend to do this!). Imho there is no need for a RO system the wear leveling of SD cards are well balanced if you offer enough space. RetroPie needs 2.5 GB if you use a 4 GB SD card you have 33% of free space really enough for writing access. You can try to link log files in RAM if you are worried. But you really need not to worry about a sudden SD card death.
I think you will run in issues if you deny write access! About the 32 MB ... That is just the visible FAT32 boot partition. The rest is "hidden" in a ext3 partition - not visible for Billies Toy :)
-
To be honest, I have NEVER had an issue with an SD card in retropie. I have been using it for over a year now. I do have a bit of a system to help prvent issues:
-When I am done playing, I shout down EmulationStation from the menu and leave the Pi on the command line
-When I want to play, I remote in via SSH from a PC or my Phone and issue a "sudo reboot" to reboot and get everything running again.
My 5yr old loves to unplug the power cord,and we get plenty of summer storm power outages, so I have plenty of experience with unexpected loss of power. There just isn't much write activity going on when the pi is sitting at a command prompt so a power loss doesn't do much (my printer server Pi B+ sits on my desk ad I only see an activity light if something is printing.
I'm sure it's possible to get corruption, but I just haven't had issues, so just relaying my method for minimizing chances for data loss.
-
You folks are awesome! I will definitely work on pushing roms and stuff to the USB soon. As for the SDs I believe I broke them. I tried some other tools to remove all partitions and nothing would put it back to the full size.
I just got an SD to USB adapter so maybe I'll see if a base raspbian image can fix my issues with those ones. I will need to google it. They won't boot the pi at all. I was dumb and didn't wait long enough to pull the plug like a dummy. :)
I am having fun in general, I work in the windows realm so Linux is a chalange but a fun puzzle at the same time. :)
-
Update. SDs are bad.. "Someone" must have man handled the SDs and snapped them in half.. "someone" lol
-
@wickedklown007 said in Can RetroPie run Read-Only with USB for write needs?:
Update. SDs are bad.. "Someone" must have man handled the SDs and snapped them in half.. "someone" lol
I have broken lots of full sized SD cards. At one point, I learned that super glue is it a good way to glue a cracked ad card case back togetherness because it flows over everything. Funny thing is that I found a glued one the other day that I think is still good (they are 2gb full size sad cards so not super useful).
Edit: Linux is pretty straightforward one you get used to it. Luckily, I learned about Debian back in the day when I had to custom compile a kernel for a 300Mhz Pentium 1 laptop.
I also learned how to get X wi does running in a terminal session in Windows so I could log into the Unix BAX machines to do my C coding homework back in the day. Told the professor I figured it out and he told the class that someone figured out and if they wanted to pay me $5/case of beer/etc, I could tell them how. Never told anyone how to do it because they were too cheap.
-
I'm looking for a similar option to make a read-only system. I made some pseudo nes classics using retropie for some family members... and 2 out of 5 of them had some boot problems. They swear up and down they shut it down the correct way. Meanwhile I've had my own DIY arcade for over a year and my own pseudo nes classic for the past 6 months and haven't had a single problem. So I have no idea what these people are doing to break their cards. I already have roms, images, and save states loading from USB, and I use the Kiosk version of EmulationStation so I don't know what else would need write perms. I'd guess I may be able to just symlink it and have it write to the usb drive instead.
I found this script from adafruit but it is for Raspian Lite. Not sure if there's a simple change to make it work with retropie.
https://learn.adafruit.com/read-only-raspberry-pi/Found a few other read-only tutorials as well that I am going to try
http://www.matteomattei.com/web-kiosk-with-raspberry-pi-and-read-only-sd/
https://hallard.me/raspberry-pi-read-only/
http://k3a.me/how-to-make-raspberrypi-truly-read-only-reliable-and-trouble-free/
https://ferdinandkeil.com/read-only-filesystem-for-raspberry-pi.html -
@dsstrainer The Retropie image is based on Raspbian Lite, so there's no reason the script would not work. However
I already have roms, images, and save states loading from USB, and I use the Kiosk version of EmulationStation so I don't know what else would need write perms
You should consider that Emulationstation will need write permissions at least on the
/home/pi/.emulationstation
folder in order to write the metadata for last played/number of times game was launched and RetroArch might need permission to unzip archived (.zip) roms on the ROM folder. -
Thx for the info mitu.
Am I wrong in thinking I can simply symlink that folder to /media/usb0/.emulationstation as that is where I have my usb drive mounted. Ultimately I don't really care about that number anyway. So if I could just have it fail and suppress and error message, that would work too.
-
@dsstrainer said in Can RetroPie run Read-Only with USB for write needs?:
So if I could just have it fail and suppress and error message, that would work too
If ES does not throw an error an stops, then you can ignore them, sure. But I don't think symlinks work across different mount points. If the USB is always attached to the system and it's Linux formatted, then I'd go ahead and mount the
/home
folder directly onto the USB drive (or at least on one if its partitions). -
@mitu Well I already have /home/pi/RetroPie mounted to /media/usb0 and its windows formatted. This was to make adding more roms easy without having to alter the microsd and this has been working great. gamelists.xml, all theme images, and mame2003 cfg files all load from usb as well. Scaper scrapes directly to usb. So ultimately I see this as being a very doable (and expectedly more popular) option.
/home/pi/.emulationstation is really just a symlink to /opt/retropie/configs/all/emulationstation/ anyway so I just changed it to symlink to /home/pi/RetroPie/emulationstation now. I can't test until I get home later but at the very least, it didn't crash when I ran es from the commandline in putty.
pi@retropie:~ $ readlink ~/.emulationstation /opt/retropie/configs/all/emulationstation pi@retropie:~ $ readlink /opt/retropie/configs/all/emulationstation /home/pi/RetroPie/emulationstation pi@retropie:~ $ readlink /home/pi/RetroPie /media/usb0
Might even be worth moving the whole configs directory to the usb drive so I can talk them through config changes easily over the phone and they can do it all by putting the usb drive into their home computer....
-
Unbelievable! THIS is how it should have been done from the start!
I've moved ALL configs over to the usb drive now and it easily shaves 8 secs off of boot time. The 4 raspberries screen used to sit longer. Now they are gone within 4-5 secs before loading my custom animation movie (which is still on the microsd). But everything else is on the usb drive now
- I mounted dev/sda1 to /media/usb0 as I only plan on having a single usb flash drive in the system.
- I replaced the following directories with symlinks:
/opt/retropie/configs to /home/pi/RetroPie/configs /etc/emulationstation to /home/pi/RetroPie/etc/emulationstation /home/pi/RetroPie to /media/usb0
As there are some symlinks within those folders, I simply renamed to the one I use. So for example in the download_images folder, "genesis" was symlinked to "megadrive", So I just removed genesis as all my roms use megadrive folder structures.
Now I can edit config files by simply inserting the usb drive into my windows computer and editing them, then simply pop the usb back in to see the changes. Plus I have all the theme settings, scraped images, etc all on the faster drive (usb much faster than microsd) so things like all the game images load much faster.
This leaves the microsd all but isolated to do just the core system work. I used to load my custom startup movie from USB too, but found that during startup, a lot of times the usb drive isn't ready yet so the video only played 30% of the time. Moving it to the microsd allowed it to be ready to go and plays everytime now.
I would definitely recommend doing this for power users but really I would recommend this for new users too as it is much easier to wrap your head around things when the data is all in one location.
I have not yet tried the readonly script, but I was more concerned about this part working first and it works even better than hoped! Long live the symlink!
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.