OSMC does not boot

Hello everyone.

Yesterday I did something stupid. I accidentally unplugged my RPi3 which was running OSMC. Now it will not boot. I can’t ssh into my Pi, but the micro SD card seems to work. I can mount it and copy files on and of of it. A ran fsck /dev/sdc and got

fsck iz util-linux 2.31.1
e2fsck 1.43.8 (1-Jan-2018)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks…
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdc

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193
or
e2fsck -b 32768

/dev/sdc contains `DOS/MBR boot sector; partition 1 : ID=0xc, start-CHS (0x10,0,1), end-CHS (0x3
ff,3,32), startsector 2048, 497664 sectors; partition 2 : ID=0x83, start-CHS (0x1f,59,29), end-C
HS (0x3ff,254,63), startsector 501760, 60250112 sectors’ data

Does anyone have any suggestions?

Thank you
Blaž

AFAIK you should have 2 partitions: 1 FAT and 1 ext[234]

You did an fsck on the entire SD-card. Run fsck on both partitions. If all fails, backup anything you still need and re-install.

You need to run fsck on the partitions [sdX1 and sdX2 (i.e. sdc1)], not on the complete disk.

Thank you

Yes, I do have two partitions, one FAT and one EXT4. I thought I could repair both of them in one go. Now a ran separate commands for separate partitions and this is what I got (I ran both command as sudo)

fsck /dev/sdc1

fsck iz util-linux 2.31.1
fsck.fat 4.1 (2017-01-24)
/dev/sdc1: 267 files, 44781/489976 clusters

and

fsck /dev/sdc2

fsck iz util-linux 2.31.1
e2fsck 1.43.8 (1-Jan-2018)
/dev/sdc2: clean, 40536/1884160 files, 464189/7531264 blocks

If I am not mistaken this means that all is ok. So I thought that something might be wrong with my pi… A did a clean install on second sd card and all went without any problems (OSMC booted).

Does anyone have any other suggestions?

Thank you in advance.

Although the filesystems might be clean, that doesn’t mean that the data in the files is also clean.

Also, the boot partition might have lost its boot flag. What does sudo fdisk -l /dev/sdc show?

Hello.

Thank you dillthedog. Output of sudo fdisk -l /dev/sdc is:

Disk /dev/sdc: 29 GiB, 31104958464 bytes, 60751872 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x935cf2ac

/dev/sdc1 2048 499711 497664 243M c W95 FAT32 (LBA)
/dev/sdc2 501760 60751871 60250112 28,7G 83 Linux

Well, the LBA flag is set - as it should be.

Perhaps a file on the /boot partition has been corrupted. If you were on the December (ie latest) version of OSMC, please post the output from md5sum /boot/*

Unfortunately, if the md5sum doesn’t show anything, I think you’re probably looking at a reinstall.

I’m not exactly sour, but I presume that I must mount my card and navigate to / folder of OSCM an then execute the command.

This is the outpute:

md5sum: /boot/grub: Is a directory
md5sum: /boot/grub.bak: Is a directory
0bb7dde12d66d81801266e7216baebb4 /boot/initramfs-linux-fallback.img
61fee3d6481877e5ab7bb60c2b682c29 /boot/initramfs-linux.img
md5sum: /boot/lost+found: Permission denied
md5sum: /boot/syslinux: Is a directory
f5ce4ab46ced762d98f8aec2a2d3e4f7 /boot/vmlinuz-linux

Sorry, I should have been a bit clearer. You need to mount /dev/sdc1 on your machine and then run md5sum on its contents.

OK, that make’s sense. In my previous post I posted output when I mounted the second partition /dev/sdc2.

Here is the output when I mount the first partition, /dev/sdc1, and run the command:

md5sum: /boot/grub: Is a directory
md5sum: /boot/grub.bak: Is a directory
0bb7dde12d66d81801266e7216baebb4 /boot/initramfs-linux-fallback.img
61fee3d6481877e5ab7bb60c2b682c29 /boot/initramfs-linux.img
md5sum: /boot/lost+found: Permission denied
md5sum: /boot/syslinux: Is a directory
f5ce4ab46ced762d98f8aec2a2d3e4f7 /boot/vmlinuz-linux

I think the the output is the same.

That doesn’t look like the contents of /dev/sdc1.

What is your operating system? If it’s auto-mounted the partition it’ll possibly be at a place like /media/<username>/mmcblk0p1. Run df to see what partitions are mounted.

OK, I am almost positive that I was in the right folder.

The output of df is:


/dev/sdc1 244988 22391 222598 10% /run/media/blaz/CFA4-7A16
/dev/sdc2 29520972 1252672 26745664 5% /run/media/blaz/701987f5-4826-4894-9c6f-ddba3f

When I navigate to the sdc1 folder and run the command md5sum /boot/* I got:

blaz@blaz: CFA4-7A16 -> md5sum /boot/*
md5sum: /boot/grub: Is a directory
md5sum: /boot/grub.bak: Is a directory
0bb7dde12d66d81801266e7216baebb4 /boot/initramfs-linux-fallback.img
61fee3d6481877e5ab7bb60c2b682c29 /boot/initramfs-linux.img
md5sum: /boot/lost+found: Permission denied
md5sum: /boot/syslinux: Is a directory
f5ce4ab46ced762d98f8aec2a2d3e4f7 /boot/vmlinuz-linux

Run md5sum /run/media/blaz/CFA4-7A16/*

OK, now this is different :slight_smile:

md5sum /run/media/blaz/CFA4-7A16/*
f4ee061585231082cea1a48f83e2f6ac /run/media/blaz/CFA4-7A16/bcm2708-rpi-0-w.dtb
89efa7cc50100911db3d8a16a6be3c15 /run/media/blaz/CFA4-7A16/bcm2708-rpi-b.dtb
d98801d614b0f5045e22f745e8321cc3 /run/media/blaz/CFA4-7A16/bcm2708-rpi-b-plus.dtb
d25eb3ac691e9de92fc808757479112c /run/media/blaz/CFA4-7A16/bcm2708-rpi-cm.dtb
2ddc69793825e741fe86b7b4576a23a7 /run/media/blaz/CFA4-7A16/bcm2709-rpi-2-b.dtb
95059e3b4e1d3edff7357089b5c9c232 /run/media/blaz/CFA4-7A16/bcm2710-rpi-3-b.dtb
eb875fe6b3464e2a09ba639856f1e6d4 /run/media/blaz/CFA4-7A16/bcm2710-rpi-cm3.dtb
48aea3aa3bd4f5d42e0dd0b2f88c8e1e /run/media/blaz/CFA4-7A16/bcm2835-rpi-a.dtb
24afb3482c04f0d4c492a031e46939e8 /run/media/blaz/CFA4-7A16/bcm2835-rpi-a-plus.dtb
aedeae038beeee4a27f1d13229acae8c /run/media/blaz/CFA4-7A16/bcm2835-rpi-b.dtb
464fc357f389f97709149e42e1823f4e /run/media/blaz/CFA4-7A16/bcm2835-rpi-b-plus.dtb
0e2cd7377c8bd258ec3b29494c784ab5 /run/media/blaz/CFA4-7A16/bcm2835-rpi-b-rev2.dtb
01bf9d040e6c309a0ab2c24c4732031a /run/media/blaz/CFA4-7A16/bcm2835-rpi-zero.dtb
c993e9ca9867ebdf101016e2c031bdfa /run/media/blaz/CFA4-7A16/bcm2836-rpi-2-b.dtb
fd01b240fcc5d4c83560676415081508 /run/media/blaz/CFA4-7A16/bootcode.bin
fcb781659045ddb7dd95f1487e9330c5 /run/media/blaz/CFA4-7A16/cmdline.txt
1ac2d227733a6b5c7c913d3dfa6f454c /run/media/blaz/CFA4-7A16/config-4.9.29-13-osmc
d41d8cd98f00b204e9800998ecf8427e /run/media/blaz/CFA4-7A16/config.txt
md5sum: /run/media/blaz/CFA4-7A16/dtb-4.9.29-13-osmc: Is a directory
37e8f46927b04637cf7676127afbba9a /run/media/blaz/CFA4-7A16/fixup_x.dat
18d3c6ff667491ce84f95ce0837fae86 /run/media/blaz/CFA4-7A16/install.log
8991f9e3472b4bb7e930e2c5620689ad /run/media/blaz/CFA4-7A16/kernel.img
4a4d169737c0786fb9482bb6d30401d1 /run/media/blaz/CFA4-7A16/LICENCE.broadcom
d41d8cd98f00b204e9800998ecf8427e /run/media/blaz/CFA4-7A16/md5sum
md5sum: /run/media/blaz/CFA4-7A16/overlays: Is a directory
513abe7a87e579f5a9a209169f66b9bd /run/media/blaz/CFA4-7A16/preseed.cfg
1fa40bec23124cfae16b0370bb490070 /run/media/blaz/CFA4-7A16/start_x.elf
f2eab441843239636983a993771282f0 /run/media/blaz/CFA4-7A16/System.map-4.9.29-13-osmc
8991f9e3472b4bb7e930e2c5620689ad /run/media/blaz/CFA4-7A16/vmlinuz-4.9.29-13-osmc

The files look to be good so I’m out of ideas.

Unless someone else can suggest something, I think a reinstall is the next logical step.

I don’t know how much configuration you’ve done to your system but, as a minimum you’ll probably want to copy the .kodi directory with all your Kodi settings. You’ll probably find it in /run/media/blaz/701987f5-4826-4894-9c6f-ddba3f/home/osmc. (It’s a hidden name, so ensure that you can see hidden files and folders if you’re using a file browser.)

Thank you for all your help. I’ll wait till tomorrow if anyone else comes up with any ideas. If not, I’ll try the reinstall and copy the .kodi directory.

Thank you once again.

Hello.

OK, I got around the problem. Previously I sad, that made a fresh install on a second sd card. I copied .kodi folder from the old card to the new one, like dillthedog suggested. I had a cupel of issues with addons I had installed, but I reinstalled them and now all seems to work. Now the first thing I am going to do is a full backup of my OSMC img. :slight_smile:

Once again thank you all for your help.