Cannot update snapshot packages

I recently installed the snapshot version of the firmware for my router which is Xiaomi Mi Router 4. I recently logged in to LuCI to and checked for updates, it showed quite a few, but for some reason all updates fail with a similar looking error. Here is a screenshot of the error.
2021-04-07_13-18

they probably would have failed anyway

1 Like

Two things:

  • Likely your flash is already full and the rootfs-data filesystem has been mounted "read-only". "Read-only file system"... check your system log about messages related to overlay and/or jffs2 and/or ubifs. E.g. logread | grep overlay
  • you should not try to upgrade core packages like "base-files". (It can lead to difficulties as the base files scripts change during the upgrade process itself.) OpenWrt is not a full x86 Linux distro where you can upgrade kernel and core packages at will.
4 Likes

If your definition of ”recently” is more than (most often) max 24h or to the next time a snapshot is compiled then the packages will fail.
Than you need to install the latest snapshot again and within minutes (without any delay) install the packages you need (if they exist in the first place since it is a Snapshot!).

Alternative you download everything right away at once and manually install them when you want.

1 Like

By recently I meant, about 1-2 weeks before. There are no stable builds for my router, otherwise I would have gone with those.

So I cannot update any package?

There are other updates also that shows the same warning, like this
2021-04-07_16-34

Likely your flash is already full and the rootfs-data filesystem has been mounted "read-only". "Read-only file system"... check your system log about messages related to overlay and/or jffs2 and/or ubifs. E.g. `logread | grep overlay

This is after fresh reboot,

root@OpenWrt:~# logread | grep overlay
Mon Apr  5 12:46:46 2021 user.info kernel: [   11.280323] mount_root: switching to ubifs overlay

you should not try to upgrade core packages like "base-files". (It can lead to difficulties as the base files scripts change during the upgrade process itself.) OpenWrt is not a full x86 Linux distro where you can upgrade kernel and core packages at will.

So when/what should I upgrade?

Yes.
There is the same warning "Read-only file system".

Like I said above:

.

Nothing until you have free flash space.

How can I check how much space is used/free on flash?

it shows on the status screen in the web interface, or use df -kh from ssh.

And you can see the possible boot time error with the command I gave to you:

This is after a fresh reboot of router,

root@OpenWrt:~# logread | grep overlay
Mon Apr  5 12:46:46 2021 user.info kernel: [   11.280323] mount_root: switching to ubifs overlay

You mean this,

root@OpenWrt:~# df -kh
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 2.8M      2.8M         0 100% /rom
tmpfs                    59.4M    252.0K     59.2M   0% /tmp
/dev/ubi0_1              98.1M      4.0M     89.3M   4% /overlay
overlayfs:/overlay       98.1M      4.0M     89.3M   4% /
tmpfs                   512.0K         0    512.0K   0% /dev

That "df" output looks pretty normal.
Does the system log give you any hints about reason why there would be a read-only system?

What do these commands give?

logread | grep ubi
mount

my bad about the status screen, i remembered incorrectly, df -kh is good enough though.

Here is output of logread | grep ubi

root@OpenWrt:~# logread | grep ubi
Mon Apr  5 12:46:46 2021 kern.notice kernel: [    2.864568] ubi0: attaching mtd9
Mon Apr  5 12:46:46 2021 kern.notice kernel: [    4.101896] ubi0: scanning is finished
Mon Apr  5 12:46:46 2021 kern.notice kernel: [    4.123324] ubi0: attached mtd9 (name "ubi", size 117 MiB)
Mon Apr  5 12:46:46 2021 kern.notice kernel: [    4.128823] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
Mon Apr  5 12:46:46 2021 kern.notice kernel: [    4.135682] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
Mon Apr  5 12:46:46 2021 kern.notice kernel: [    4.142452] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
Mon Apr  5 12:46:46 2021 kern.notice kernel: [    4.149394] ubi0: good PEBs: 939, bad PEBs: 1, corrupted PEBs: 0
Mon Apr  5 12:46:46 2021 kern.notice kernel: [    4.155383] ubi0: user volume: 2, internal volumes: 1, max. volumes count: 128
Mon Apr  5 12:46:46 2021 kern.notice kernel: [    4.162587] ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 1616648604
Mon Apr  5 12:46:46 2021 kern.notice kernel: [    4.171691] ubi0: available PEBs: 0, total reserved PEBs: 939, PEBs reserved for bad PEB handling: 19
Mon Apr  5 12:46:46 2021 kern.notice kernel: [    4.180915] ubi0: background thread "ubi_bgt0d" started, PID 485
Mon Apr  5 12:46:46 2021 kern.info kernel: [    4.185119] block ubiblock0_0: created from ubi0:0(rootfs)
Mon Apr  5 12:46:46 2021 kern.notice kernel: [    4.192376] ubiblock: device ubiblock0_0 (rootfs) set to be root filesystem
Mon Apr  5 12:46:46 2021 kern.notice kernel: [   10.955291] UBIFS (ubi0:1): Mounting in unauthenticated mode
Mon Apr  5 12:46:46 2021 kern.notice kernel: [   10.961283] UBIFS (ubi0:1): background thread "ubifs_bgt0_1" started, PID 596
Mon Apr  5 12:46:46 2021 kern.notice kernel: [   11.044935] UBIFS (ubi0:1): recovery needed
Mon Apr  5 12:46:46 2021 kern.notice kernel: [   11.215394] UBIFS (ubi0:1): recovery completed
Mon Apr  5 12:46:46 2021 kern.notice kernel: [   11.219977] UBIFS (ubi0:1): UBIFS: mounted UBI device 0, volume 1, name "rootfs_data"
Mon Apr  5 12:46:46 2021 kern.notice kernel: [   11.227798] UBIFS (ubi0:1): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
Mon Apr  5 12:46:46 2021 kern.notice kernel: [   11.237699] UBIFS (ubi0:1): FS size: 111992832 bytes (106 MiB, 882 LEBs), journal size 5586944 bytes (5 MiB, 44 LEBs)
Mon Apr  5 12:46:46 2021 kern.notice kernel: [   11.248281] UBIFS (ubi0:1): reserved for root: 4952683 bytes (4836 KiB)
Mon Apr  5 12:46:46 2021 kern.notice kernel: [   11.254893] UBIFS (ubi0:1): media format: w5/r0 (latest is w5/r0), UUID 4EA2C938-5BBC-4218-BBD0-365AE31971D0, small LPT model
Mon Apr  5 12:46:46 2021 user.info kernel: [   11.280323] mount_root: switching to ubifs overlay

and here is the output of mount

root@OpenWrt:~# mount
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/ubi0_1 on /overlay type ubifs (rw,noatime,assert=read-only,ubi=0,vol=1)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)

That looks quite normal, I think.
No clear reason for "Read-only file system".

Can you install some small new package? E.g. "joe" editor without dependencies.

opkg update
opkg install joe

what happens? What is the output in console?

I think it installed correctly..

root@OpenWrt:~# opkg install joe
Installing joe (4.6-2) to root...
Downloading https://downloads.openwrt.org/snapshots/packages/mipsel_24kc/packages/joe_4.6-2_mipsel_24kc.ipk
Configuring joe.

Install a new systemupdate snapshot and then directly install the packages you want, then I am sure the downloads will work just fine for that day.

1-2weeks, then there are probably at least 14days those packages disappeared from the earth. So your Snapshot can’t simply find anything to download.

Install a new systemupdate snapshot and then directly install the packages you want, then I am sure the downloads will work just fine for that day.

If you mean the sysupgrage file, I tried that 1 time, it never finishes, keep doing something forever, and you can't reboot in the middle of it.

1-2weeks, then there are probably at least 14days those packages disappeared from the earth. So your Snapshot can’t simply find anything to download.

So once you install a snapshot you can't upgrade anything? I thought it was supposed to mean bleeding edge/devel packages which can be upgraded I suppose..