Changes to Filesystem gone after reboot

Aloha,

it seems like since my osmc tried to update to the August-Update something did not go well and since then it seems like every change to the filesystem is gone after a reboot?

e.g.

  • I can’t apply updates by OSMC-Add-on nor via apt-get
  • I can’t change the hostname via sudo nano /etc/hostname or sudo nano /etc/hosts. After saving and rebooting it’s again ‘osmc’
  • did sudo apt-get install mc and after reboot mc was gone again…

It ‘feels’ like osmc is running on a ramdisk, but on reboot changes are not written back to the SD?

Any Ideas how to fix this? Thanks in advance…

-stefan

Sounds like you have file system corruption causing the root file system to mount read only.

If so, try running fsck:

sudo fsck /

~ $ ssh osmc@192.168.178.10
OSMC: Open Source Media Center
osmc@192.168.178.10’s password:
Last login: Wed Sep 9 17:32:21 2015 from 192.168.178.2
Generating locales (this might take a while)…
de_DE.UTF-8… done
Generation complete.
osmc@osmc:~$ sudo fsck /
fsck from util-linux 2.25.2
e2fsck 1.42.12 (29-Aug-2014)
/dev/mmcblk0p2 ist eingehängt.
e2fsck: Fortsetzung nicht möglich, wird abgebrochen.
osmc@osmc:~$ sudo umount /
umount: /: target is busy
(In some cases useful info about processes that
use the device is found by lsof(8) or fuser(1).)
osmc@osmc:~$ sudo umount /dev/mmcblk0p2
umount: /: target is busy
(In some cases useful info about processes that
use the device is found by lsof(8) or fuser(1).)

Sorry, but I don’t read German… (?)

Addendum:

osmc@osmc:~$ mount -l
/dev/mmcblk0p2 on / type ext4 (rw,noatime,stripe=1024,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=371420k,nr_inodes=92855,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=23,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/mmcblk0p1 on /boot type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
sysfs on /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=75148k,mode=700,uid=1000,gid=1000)

I see all RWs and only one RO … which is not / …

What to do next?
(BTW: If someone can see that my set-up is simply “FUBAR” just tell me, we don’t need suffer both if it is more easy just do a new SD-Set-Up …
… on the other hand I want to know how to do a FSCK on a running system :wink: )

Sorry, but I don’t read German… (?)

Oh, I am Sorry, there was in that whole Quote of mine at least one german line, saying:

Fortsetzung nicht möglich, wird abgebrochen.

… which translate.google translates to:

Continued impossible, will be canceled.

… and I fix to:

Proceeding impossible, will be canceled.

Did I forget to translate anything else?

Well that one is also not translated which would be /dev/mmcblk0p2 is mounted
Basically you would need to activate fsck in fstab and reboot as your system is not mounted read only as expected by @DBMandrake
Change the last digit in the fstab line for that disk from 0 to 1 and reboot
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1

But not sure if it solves your problem as your system is mounted correctly.

… which I can’t do because all “Changes to Filesystem gone after reboot” (I’ve tried)

Put your SD card in a PC and edit cmdline.txt.

At the end of the current line put a space then the following two options:

fsck.mode=force fsck.repair=yes

Save and boot from the SD card - this will force a full fsck scan every time you boot and choose yes to any questions to automatically make repairs.

Assuming this fixes the problem you can then remove those two options when finished.

Hello
I have been trying to do the same thing as the OP, and I am struggling to get it to work. I just tried this, FTPd to it, and occured the same issue.

Here’s the FTP log.

Status:      	Starting upload of /Users/joseph/Desktop/Screen Shot 2016-09-02 at 2.45.24 PM.png
Command:	CWD /media/bf8132fc-6e78-33e4-91cd-bee55ef837cc
Response: 	250 CWD command successful
Command:	TYPE I
Response: 	200 Type set to I
Command:	PASV
Response: 	227 Entering Passive Mode (192,168,0,53,157,25).
Command:	STOR Screen Shot 2016-09-02 at 2.45.24 PM.png
Response: 	550 Screen Shot 2016-09-02 at 2.45.24 PM.png: Read-only file system
Error:        	Critical file transfer error after transferring 1,706 bytes in 1 second
Status:      	Disconnected from server

This occurred after attempting to force fsck. Any ideas?

First thing is to access OSMC by SSH to find out exactly what’s going on.
Details regarding how to access the command line interface can be found here on our Wiki: Accessing the command line - General - OSMC