Cannot boot raspberry pi3 anymore

HI,
I’m using osmc on raspberry pi3. I just came back from holiday and surprisingly I find out that my raspberry pi3 does not boot up anymore. No one used it in this period so I really don’t know what could have happened (clearly before leaving it was working perfectly fine). I tried to plug off and on the power cable and I noticed inside the raspberry two different lights. The first one red keeps staying solid while the second green light blinks 2 times and after that it turns off.
I also tried to insert the sdcard inside the pc and it is correctly readable.
I really hope I won’t have to format the sdcard losing all my data.:pensive:
Thanks in advance

HI,

Is this in windows? if so it will on being seeing the boot partition. If this case trying booting your PC with a linux live iso and check both partitions.

Have you tried a different PSU?

Thanks Tom.

1 Like

Yes I tried with window and this is what I see (second partition not readable):
Immagine

I tried with a linux virtual machine that I have but the sdcard is not readable. I get this error message:

Yeah I also tried a different PSU but I get the same problem.

Hi,

If the 2nd partition is not readable on linux then you will need to reinstall, if you continue to have issues; you will need to replace the sd card.

Thanks Tom.

with the virtual machine of linux it cannot read both the first and 2nd partition

That is not what that picture you posted shows. It says the reader is still in use in Windows so the VM is being blocked from accessing it. SD cards, particularly in Raspberry Pi’s wear out and/or become corrupted. Even if you could read the 2nd partition that does not mean that it isn’t damaged or corrupted.

1 Like

Try this software,Linux File Systems for Windows | Paragon Software , it’s a trial with full speed for like 10 hours, then it’s limites to 5mb/s. It will read a linux if the filesystem isn’t to damaged.

1 Like

Ok thanks to joakim_s mentioned app I’m able to read the full sdcard. This is the full partition I see:
Immagine

What should I check now inside the card?

I would copy the /home/osmc/.kodi folder to your pc(you may have to “show hidden files” on your pc to see it), then reimage/“install osmc image” the card and then copy the .kodi folder back onto the card after the installation completes.

Green LED blinks in a specific pattern

2 flashes: The SD Card cannot be read.

Source: R-Pi Troubleshooting - eLinux.org

1 Like

I also had set up years ago a mysql database inside the sdcard (with all the datas of the movies). Is there a way to backup that too?

Answer. MySQL stores DB files in /var/lib/ mysql by default, but you can override this in the configuration file.

Debian calls it /etc/ mysql /my.cnf

This information is just ripped from the interwebs, since i have no mysql installed on my pi i cant guarantee the accuracy of this information.

I’m not certian how to import that db into a new installation though since it was over 10 years ago since i did it regulary. Here is a link how to do it in ubuntu (close to debian, which osmc is based upon):

but when you got it up and running exporting the db to a file can be a “semi backup” of it and you can do it on regular intervals,

1 Like

@joakim_s is correct, /var/lib/mysql is where the database files are on OSMC. The 2 links are good starting points to recover your database (especially the 1st link). But be warned that if the SD card is failing that the database files may be corrupt. Another way you could try to recover the database would be to use a live linux CD. I’m fairly certain that the Linux Mint CD will allow you to ‘install’ software, so try running LM, install Maria DB and follow the instructions in the first link to see if you can get a good mysqldump of the database.

1 Like

First of all, thanks for the help. Finally yesterday I had the time to dedicate to this problem. I reinstalled osmc in the sdcard and it seems that I found the way to restore the databases (MyVideos90, MyVideos99, MyVideos107). I have also copied back the old .kodi folder in the sdcard but unfortunately when I try to start the raspberry I get this message:
“Migration database in progress. Please wait…”
I let it running the whole night but nothing changed.
I checked from the kodi.log and I noticed that there was a problem with a new database MyVideos116 so I removed it and restarted the raspberry that it actually got to the main page of kodi but without sources or db entries.
After that I simply restarted the raspberry and the database MyVideos116 was again created so I just share with you the log hoping you have some idea:
https://paste.osmc.tv/awipaxakuh

I think the main problem is this one:
“2019-09-21 11:24:53.497 T:1794110176 ERROR: Unable to copy old database MyVideos107 to new version MyVideos116”

I also add that before I had an older version of kodi 17.6 and now I installed the new image in the raspberry with kodi 18.3.

I’m also gonna say that on my computer, that i’m using as a client, kodi works without any problem showing me all the db entries that are inside the raspberry (so I really think that the databases were restored correctly).

Did you do a SD Card check before you installed to it?

That would mean that the Database will be migrated where currently your problem seems to be.
107 is your v17 database while 116 is your v18 database

What do you mean with that? Did you copy the database form your Pi to your PC? If so which version?

  • I just backed up the whole sd card and formatted it before reinstalling the image.

  • ok but it seems that the migration can’t go through. Should I just try to reinstall the old image of kodi 17.6 in the raspberry? If yes, how can I find the image of osmc for kodi 17.6? From their website it seems that the images don’t indicate what version of kodi they host.

  • No, my raspberry is the only device in my house that keeps the mysql server with all the data. In my computer instead I just have installed kodi and inserted the configuration files advancedsettings.xml and sources.xml to synchronize the pc with the data from the server in the raspberry. Basically this guide:
    https://kodi.wiki/view/MySQL

Would have suggested to test the card with h2testw before.

I am lost. So you use a mysql installation? Where is the server installed? Which version of Kodi are you using on Windows?

Yes I’ve installed mysql-server in the raspberry. On windows I have kodi 17.6 that was the same version that the raspberry had before I formatted the sdcard. Now on the raspberry I’ve installed the last image I found on OSMC website that has kodi 18.3

Then I suggest to upgrade on Windows to the latest Kodi version and check if then the database upgrade works. Otherwise you would need to see what’s wrong with your mysql database (I assume you have your DB user full rights

I tried to install kodi 18.3 on windows and in fact the program gets stuck on the first logo image.
The problem is still the same that it cannot see the tables in the folder MyVideos116.
Yes I’ve already granted the full rights to the DB user ‘kodi’ with this command:
GRANT ALL ON . TO ‘kodi’;

Well so that at least indicates the issue is your Database and not only related to OSMC (first logo image is the step of database upgrade. Suggest to enable debug logs and to see if you can find anything in there.