I'm running RetroPI, I believe it's on top of Raspbian -- Linux 4.4.38-v7+ armv7l GNU/Linux.
So, my PI boots fine, and is running fine, but I started noticing some random garbage files showing up in my ~ directory when I run the "ls" command via putty, in addition to the normal files I expect, I also see these file entries:
(I do get tab completion on these, instead of the "?"s that ls shows, but the files are truly garbage symbols.)
When using WinSCP, I notice other strange files (might be the same ones, not sure):
They're all about 8 KB according to WinSCP (ls -s just prints an "8" next to them, but I don't know how to verify that 1 block == 1 kb.)
I've shut down my PI with a hard power off a few times, so I'm guessing my SD card has some minor corruptions on it.
I don't have Linux on any other machine, just the raspberry PI. How can I perform an online check and repair of the file system from the Raspberry PI itself? (I do not have any X windows shells or GUIs installed, it's a Retro PI system, and I don't know how to install the GUI with that, so the command line is all I've got.)
Here's a list of my partitions:
pi@retropie:~ $ sudo parted /dev/mmcblk0 'print' Model: SD 00000 (sd/mmc) Disk /dev/mmcblk0: 16.0GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 4194kB 64.0MB 59.8MB primary fat16 boot, lba 2 64.0MB 16.0GB 16.0GB primary ext4
I was able to make the following command work to check the first partition, but I have no idea how to check the second one:
sudo dosfsck -w -r -l -a -v -t /dev/mmcblk0p1
I tried changing "mmcblk0p1" to "mmcblk0p2" and also "dosfsck" to "fsck", but neither of those worked out very well for me. -- I got a warning that the file system was mounted and that attempting to repair it would destroy it?
Question 1: how do I repair this file system (Without another PC running Linux)?
Bonus Question: Is there a way to mount the core OS as read-only at boot-up (so that I can kill the power with little-to-no-risk), but retain my emulators / roms / and save games in a read/write partition? (So that the SRAM files, save states, etc. will work?) -- What's the best strategy here?