I've been creating OpenWrt VMs (of the latest stable version) on Virtualbox and I always encounter the same problem.
First boot, I don't install anything on them and suddenly, a few boots after, they become a read-only filesystem and I cannot create or write in files. The df
output before the issue is:
vm1@OpenWrt:~$ df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 252.0M 34.0M 212.9M 14% /
tmpfs 246.1M 68.0K 246.1M 0% /tmp
/dev/sda1 15.7M 3.2M 12.2M 21% /boot
/dev/sda1 15.7M 3.2M 12.2M 21% /boot
tmpfs 512.0K 0 512.0K 0% /dev
and when the problem appears:
vm1@OpenWrt:/dev$ df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 252.0M 159.7M 87.1M 65% /
tmpfs 246.1M 72.0K 246.1M 0% /tmp
/dev/sda1 15.7M 3.2M 12.2M 21% /boot
/dev/sda1 15.7M 3.2M 12.2M 21% /boot
tmpfs 512.0K 0 512.0K 0% /dev
Sometimes, /dev/root %Use will go up to 100%.
I decided I should take a look into dmesg
:
vm1@OpenWrt:~$ sudo dmesg | grep error
[ 8.247885] EXT4-fs error (device sda2): ext4_mb_generate_buddy:757: group 1, block bitmap and bg descriptor inconsistent: 32209 vs 32208 free clusters
vm1@OpenWrt:~$ sudo dmesg | grep read-only
[ 0.340195] Write protecting the kernel read-only data: 12288k
[ 8.252252] EXT4-fs (sda2): Remounting filesystem read-only
I don't know how to interpret the errors, but it's obvious there is a serious problem here.
I've also done sudo mount -o remount,rw /dev/root /
to see if it would help. It didn't.
Also, as you can see in the dmesg output, it talks about a sda2
, which according to the df -h
results, I don't have.
I don't know if it has anything to do with it, but I created a user (without root access) in the VMs (added a user in /etc/passwd, gave it a password, gave it a /home folder and gave root access with /etc/sudoers file) and everything works perfectly (regarding this new configuration).
What is the issue here?