Hey there!
So I think my mSD card was failing, and I decided to take the chance of the new 22.03.4 release to redo my setup with the image builder and start from scratch with a new one.
However, now I have to run mount -o remount,rw /
every time I reboot even if the filesystem shows up as clean on /dev/mmcblk0p2
while using a Raspberry Pi 4B.
I've already checked beforehand that the new mSD card is in good condition, as I was able to do several write + verify passes using h2testw in Windows and even GParted in Debian shows it as clean.
To make sure of this, I even modified /lib/preinit/80_mount_root
adding the following:
/usr/sbin/e2fsck -y -v -f /dev/mmcblk0p2
/usr/bin/mount -o remount,rw /
before the do_mount_root instruction, but nothing comes up as successful so far.
Strangely, this started happening only after I copied over line by line my settings from the previous installation, but even still I find it odd that it's happening in the first place.
I'll attach to the bottom of the page both the modified /lib/preinit/80_mount_root
and my /etc/config/fstab
just to be sure, but if anyone has an idea of how to fix this, it'll be greatly appreciated.
/lib/preinit/80_mount_root
# Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2010 Vertical Communications
missing_lines() {
local file1 file2 line
file1="$1"
file2="$2"
oIFS="$IFS"
IFS=":"
while read line; do
set -- $line
grep -q "^$1:" "$file2" || echo "$*"
done < "$file1"
IFS="$oIFS"
}
do_mount_root() {
mount_root
boot_run_hook preinit_mount_root
[ -f /sysupgrade.tgz -o -f /tmp/sysupgrade.tar ] && {
echo "- config restore -"
cp /etc/passwd /etc/group /etc/shadow /tmp
cd /
[ -f /sysupgrade.tgz ] && tar xzf /sysupgrade.tgz
[ -f /tmp/sysupgrade.tar ] && tar xf /tmp/sysupgrade.tar
missing_lines /tmp/passwd /etc/passwd >> /etc/passwd
missing_lines /tmp/group /etc/group >> /etc/group
missing_lines /tmp/shadow /etc/shadow >> /etc/shadow
rm /tmp/passwd /tmp/group /tmp/shadow
# Prevent configuration corruption on a power loss
sync
}
}
/usr/sbin/e2fsck -y -v -f /dev/mmcblk0p2
/usr/bin/mount -o remount,rw /
[ "$INITRAMFS" = "1" ] || boot_hook_add preinit_main do_mount_root
/etc/config/fstab
config global
option anon_swap '1'
option anon_mount '1'
option auto_swap '1'
option auto_mount '1'
option delay_root '5'
option check_fs '0'
config mount
option target '/boot'
option enabled '1'
option enabled_fsck '1'
option uuid 'C5D0-639E'
config mount
option target '/'
option uuid 'ff313567-e9f1-5a5d-9895-3ba130b4a864'
option enabled '1'
option options 'rw'
config swap
option device '/dev/mmcblk0p3'
option enabled '1'
config mount
option target '/usbstick'
option enabled '1'
option enabled_fsck '1'
option uuid 'd1669ce2-13bc-d543-acb1-d130fc562dc2'
config netmount
option enabled '1'
option target '/mnt/NFS/OVERNET/Share'
option src '192.168.1.2:/mnt/EXT/Share'
option options 'rw,async,auto,_netdev,noacl,nocto,rsize=32768,wsize=32768,nfsvers=3'
option network 'lan'
option fstype 'nfs'
option delay '5'
config netmount
option enabled '1'
option target '/mnt/NFS/OVERNET/P2P'
option src '192.168.1.2:/mnt/EXT/P2P'
option options 'rw,async,auto,_netdev,noacl,nocto,rsize=32768,wsize=32768,nfsvers=3'
option network 'lan'
option fstype 'nfs'
option delay '5'
config netmount
option enabled '1'
option target '/mnt/NFS/OVERNET/Servarr'
option src '192.168.1.2:/mnt/EXT/Servarr'
option options 'rw,async,auto,_netdev,noacl,nocto,rsize=32768,wsize=32768,nfsvers=3'
option network 'lan'
option fstype 'nfs'
option delay '5'```