Error when running downloader.sh

Just got a MiSTer and need some help? Join the forum and post your questions here!
alspacka
Posts: 6
Joined: Fri Jun 03, 2022 1:36 am
Has thanked: 2 times
Been thanked: 2 times

Error when running downloader.sh

Unread post by alspacka »

I've been using my MiSTer completely offline for quite a while. I'm currently on: MiSTer v210803, OS v210711

Today I attempted to update by using downloader.sh for the first time. I got the following error:
WARNING: cacert file at "/etc/ssl/certs/cacert.pem" seems to be wrong!
Return Code: 60
Removing /etc/ssl/certs/cacert.pem
[Errno 30] Read-only file system: '/etc/ssl/certs/cacert.pem'
ERROR: Your filesystem is mounted incorrectly.
Can I repair this without reformatting my SD card? Please note that I'm using a Windows PC and so I can only see the data partition on the card, but I can borrow a Linux machine if that makes things easier. Thanks!
Malor
Top Contributor
Posts: 860
Joined: Wed Feb 09, 2022 11:50 pm
Has thanked: 64 times
Been thanked: 194 times

Re: Error when running downloader.sh

Unread post by Malor »

The Mister SD is formatted as FAT32, and then the Linux filesystem is encapsulated inside a file, in linux/linux.img. This is called a "loopback" filesystem, if you see that word used anywhere.

I haven't been using Mister for very long, so I'm not familiar with older releases. I'm assuming that a read-only root filesystem is not normal, because that's not how it works on the current release. Don't do what I say here unless you get further confirmation that this diagnosis is correct.

Again: don't do this yet! Wait until people have seen this and said it sounds like a good idea.


First, back up any data you care about. Looking at the SD from Windows, the directories 'saves', 'savestates', and 'config' all have saved data you probably care about. The directories under 'games' may have images or ROM files you care about; you'll have loaded those yourself. Save all these directories somewhere before you do anything else.

Also grab a copy of linux/linux.img. You may need to restore that to get back to where you are now.

From there, I'm running on the assumption that the Linux loopback filesystem has somehow been damaged, and that Mister is mounting it read-only as a consequence. You could try to fix it from within Mister; this should be safe-ish as long as the filesystem is indeed read-only and not too badly corrupted. Note that the machine could stop booting if the linux filesystem is really hosed, so that's why you took those backups. You may end up having to re-flash the card, and you'll want to restore those.

Open a command prompt (F9 at the main menu), log in as root (the default password is '1', which should be changed if you haven't already done so), and type 'mount'. You should see something like this, possibly on the first line:

Code: Select all

/dev/loop8 on / type ext4 (rw,noatime,nodiratime)
along with a bunch of other irrelevant mountpoints. It's the "on /" that's critical; that's where your root filesystem is. No other line should say that exactly. If it's not "/dev/loop8" on /, abort, don't do anything else, and post back with what you see.

The quote there is what my line looks like; it's showing "rw" for "read/write", which is normal. If yours says "ro", that means it wasn't correctly mounted.

First, for safety, type this:

Code: Select all

sync
mount / -oro,remount
That makes sure the root filesystem is mounted read-only, so that the Mister system won't make any more changes to it, so you can safely operate on it with fsck. It probably already is, this is just an extra layer of safety net.

Then, type:

Code: Select all

fsck -f /dev/loop8
You probably want to say "y" to anything you see. When it's done, reboot IMMEDIATELY. (type "reboot" and hit enter.)

If it comes back up, go back to the command prompt and see if your mount line now says rw. If so, yay! You should be able to proceed with your updater of choice.

If it doesn't come back up, shut down the Mister, mount the card under Windows, and restore the linux/linux.img file you saved. Then try rebooting again; you should be back exactly where you were, none the worse for wear.

If you have to restore the linux.img, you'll probably end up having to reflash the card, rebuild your Mister installation, and then restore your save, savestate, and config directories, along with anything you saved from games.
alspacka
Posts: 6
Joined: Fri Jun 03, 2022 1:36 am
Has thanked: 2 times
Been thanked: 2 times

Re: Error when running downloader.sh

Unread post by alspacka »

Thank you for the detailed response! I'll wait for another user to confirm as you said.

Edit: I just jumped in to check how the file system is mounted as you instructed, and it's actually read-write, just like yours.
Malor
Top Contributor
Posts: 860
Joined: Wed Feb 09, 2022 11:50 pm
Has thanked: 64 times
Been thanked: 194 times

Re: Error when running downloader.sh

Unread post by Malor »

Ok, that's weird. I'd like to see the output from your mount command. I'd suggest cutting and pasting it, but unless you're doing it via ssh, that'll be a pain.

Here's a workaround if you can't cut and paste:

Code: Select all

cd /media/fat
mount >mount.output
You can then get the mount.output file via FTP or by shutting down and moving the card over, and copy it here.

If it isn't already going, it would probably be worth the effort to get SSH running. Copying the output of a program from an SSH window is dead easy.
alspacka
Posts: 6
Joined: Fri Jun 03, 2022 1:36 am
Has thanked: 2 times
Been thanked: 2 times

Re: Error when running downloader.sh

Unread post by alspacka »

I'd have to set up SSH, but for now I'll just use iPhone's live text to copy and paste:
root# mount
/dev/loop8 on / type ext4 (rw, noatine, nodiratine)
/dev/nncbIk0p1 on /media/fat type exfat (ru, noatine, nodiratine, sync, dirsync, fmask=0022, dmask=0022, iocharset=utf8, nanecase=0, errors=renount-ro)
deutmpfs on /dev type devtmpfs (ru, relatine, size=250172k, r inodes=62543, mode= 755)
¡proc on /proc type proc (ru,relatine)
devpts on /dev/pts type depts (ru,relatine, gid=5, mode=620, ptmxmode=000)
tmpfs on /dev/shm tupe tmpfs (ru,relatine, mode=777)
› tmpfs on /tp type tmpfs (ru, relatine)
1tmpfs on /run type tmpfs (rw, nosuid, nodev, relatine, node=755)
esysfs on /sus tupe susfs (ru,relatine)
• tmpfs on /var/lib/samba type tmpfs (ru,relatime)
media/fat/linux/bluetooth on /var/lib/bluetooth type ext4 (rw, noatime, nodiratine, sync, dirsunc)
root#
Malor
Top Contributor
Posts: 860
Joined: Wed Feb 09, 2022 11:50 pm
Has thanked: 64 times
Been thanked: 194 times

Re: Error when running downloader.sh

Unread post by Malor »

I am completely baffled by that output because so many things are wrong. It looks like incorrect letters are being substituted. Is your system set to a non-English language? If that's the iPhone transcription function doing that, it is terrible.

Like, lots of your mounts are using "atine" instead of atime, but not all of them. And I've never in my life seen partitions mounted as "ru"... I thought that option could only be rw or ro.

And then 'esysfs on /sus tupe susfs'? What the heck even is that? Is it just more garbage from transcription? It sounds like your machine is playing Among Us.
alspacka
Posts: 6
Joined: Fri Jun 03, 2022 1:36 am
Has thanked: 2 times
Been thanked: 2 times

Re: Error when running downloader.sh

Unread post by alspacka »

Malor wrote: Sun Jun 05, 2022 1:18 am It looks like incorrect letters are being substituted. Is your system set to a non-English language?
I used the iPhone's optical character recognition to copy and paste that text from my monitor, so I'm sure there are transcription errors; I just thought it might give you an idea of what's going on before I get SSH set up and can paste the logs verbatim.
Malor
Top Contributor
Posts: 860
Joined: Wed Feb 09, 2022 11:50 pm
Has thanked: 64 times
Been thanked: 194 times

Re: Error when running downloader.sh

Unread post by Malor »

Dumping mount to a file would probably let you grab it via ftp, if you have that working.

The transcription's no good because the one really critical thing is 'rw' versus 'ro', and it's getting those all wrong.

A more informative program to run is "findmnt'. It does the same thing, but presents a much more verbose output.
alspacka
Posts: 6
Joined: Fri Jun 03, 2022 1:36 am
Has thanked: 2 times
Been thanked: 2 times

Re: Error when running downloader.sh

Unread post by alspacka »

Here you go, sorry about all of that:

Code: Select all

/dev/loop8 on / type ext4 (rw,noatime,nodiratime)
/dev/mmcblk0p1 on /media/fat type exfat (rw,noatime,nodiratime,sync,dirsync,fmask=0022,dmask=0022,iocharset=utf8,namecase=0,errors=remount-ro)
devtmpfs on /dev type devtmpfs (rw,relatime,size=250172k,nr_inodes=62543,mode=755)
proc on /proc type proc (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /dev/shm type tmpfs (rw,relatime,mode=777)
tmpfs on /tmp type tmpfs (rw,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /var/lib/samba type tmpfs (rw,relatime)
/media/fat/linux/bluetooth on /var/lib/bluetooth type ext4 (rw,noatime,nodiratime,sync,dirsync)

Code: Select all

TARGET               SOURCE         FSTYPE   OPTIONS
/                    /dev/loop8     ext4     rw,noatime,nodiratime
├─/media/fat         /dev/mmcblk0p1 exfat    rw,noatime,nodiratime,sync,dirsync,fmask=0022,dmask=0022,iocharset=utf8,namecase=0,errors=remount-ro
├─/dev               devtmpfs       devtmpfs rw,relatime,size=250172k,nr_inodes=62543,mode=755
│ ├─/dev/pts         devpts         devpts   rw,relatime,gid=5,mode=620,ptmxmode=000
│ └─/dev/shm         tmpfs          tmpfs    rw,relatime,mode=777
├─/proc              proc           proc     rw,relatime
├─/tmp               tmpfs          tmpfs    rw,relatime
├─/run               tmpfs          tmpfs    rw,nosuid,nodev,relatime,mode=755
├─/sys               sysfs          sysfs    rw,relatime
├─/var/lib/samba     tmpfs          tmpfs    rw,relatime
└─/var/lib/bluetooth /dev/loop0     ext4     rw,noatime,nodiratime,sync,dirsync
User avatar
aberu
Core Developer
Posts: 1144
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 244 times
Been thanked: 388 times
Contact:

Re: Error when running downloader.sh

Unread post by aberu »

Try this

1. Remove your Micro SD card from the MiSTer and plug it into your PC.

2. Download this --> https://github.com/MiSTer-devel/SD-Inst ... 0220413.7z - and unzip it

3. Copy and overwrite the contents of the linux folder from the zip over the contents of the linux folder on the MicroSD card.
birdybro~
alspacka
Posts: 6
Joined: Fri Jun 03, 2022 1:36 am
Has thanked: 2 times
Been thanked: 2 times

Re: Error when running downloader.sh

Unread post by alspacka »

Success! Thank you.
Post Reply