Hi,
I have just had OpenWrt factory reset by itself while trying to update and install some software! Has this ever happened to anyone else before?
Aaron
Hi,
I have just had OpenWrt factory reset by itself while trying to update and install some software! Has this ever happened to anyone else before?
Aaron
This can happen if you completely fill up the flash storage on your device, so yes, this has happened to others before.
A word of warning... installing packages is fine, but do not attempt to upgrade existing packages.
Upgrading packages (via the CLI opkg upgrade
command or the LuCI Upgrade...
button) can result in major problems. It is generally highly discouraged, unless you know what you are doing or if there is specific instruction to do so.
Nah, I was just doing an opkg update however, it did mention that the sd card ran out of space. Is there a way to make OpenWrt use the maximum amount of space on the sd card?
It is up to you, how you arrange the space on the SD card.
There are some "expand filesystem" scripts in the wiki.
You might read them...
BOOT="$(sed -n -e "/\s\/boot\s.*$/{s///p;q}" /etc/mtab)"
DISK="${BOOT%%[0-9]*}"
PART="$((${BOOT##*[^0-9]}+1))"
ROOT="${DISK}${PART}"
LOOP="$(losetup -f)"
losetup ${LOOP} ${ROOT}
fsck.ext4 -y -f ${LOOP}
resize2fs ${LOOP}
reboot
I run that line by line but receive the following error:
losetup: /dev/loop0: No such file or directory
when running
losetup ${LOOP} ${ROOT}
I think more info about your system is needed.
What is the output of these commands?:
ubus call system board; df; block info |cut -d\ -f 1,3-9
{
"kernel": "5.10.138",
"hostname": "OpenWrt",
"system": "ARMv8 Processor rev 4",
"model": "Bananapi BPI-R64",
"board_name": "bananapi,bpi-r64",
"rootfs_type": "squashfs",
"release": {
"distribution": "OpenWrt",
"version": "22.03.0",
"revision": "r19685-512e76967f",
"target": "mediatek/mt7622",
"description": "OpenWrt 22.03.0 r19685-512e76967f"
}
}
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 5632 5632 0 100% /rom
tmpfs 508520 980 507540 0% /tmp
/dev/mmcblk1p66 94048 61692 32356 66% /overlay
overlayfs:/overlay 94048 61692 32356 66% /
tmpfs 512 0 512 0% /dev
-ash: block: not found
cut: expected a list of bytes, characters, or fields{
"kernel": "5.10.138",
"hostname": "OpenWrt",
"system": "ARMv8 Processor rev 4",
"model": "Bananapi BPI-R64",
"board_name": "bananapi,bpi-r64",
"rootfs_type": "squashfs",
"release": {
"distribution": "OpenWrt",
"version": "22.03.0",
"revision": "r19685-512e76967f",
"target": "mediatek/mt7622",
"description": "OpenWrt 22.03.0 r19685-512e76967f"
}
}
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 5632 5632 0 100% /rom
tmpfs 508520 980 507540 0% /tmp
/dev/mmcblk1p66 94048 61692 32356 66% /overlay
overlayfs:/overlay 94048 61692 32356 66% /
tmpfs 512 0 512 0% /dev
-ash: block: not found
cut: expected a list of bytes, characters, or fields
Hopefully someone with banana pi experience can jump in to help.
It looks like your system doesn't have the block
program. I was thinking that was on all devices. I don't think it would provide much useful info anyway.
I'm only familiar with extending the overlay partition on an sd card for my nanopi r4s which uses a loop device to mount a hidden partition. It looks like you tried using the procedure for that setup.
It looks like your system has a physical partition for /overlay
You may need to search for info on extending the overlay partition on a bananapi bpi-r64 or whatever is the common name on the forum. Also search for mt7622 if need be.
I hesitate to give any advise on trying to extend the partition for your overlay filesystem without knowing more about the setup.
EDIT: Removed some general instructions that likely do not apply here.
There is some info here about it! Will see in the morning if it works for me.
A possible alternative to expanding the filesystem if your reason for running out of space is due to adding packages and not adding a lot of other files like logs or data files is to install a custom build with all your additional packages included. It is my understanding that the extra free space gets tacked on after all binaries and packages are included. This may be of interest especially if you are ready to upgrade to 22.03.3 now.
See the "Customize installed packages" section of the 'firmware-selector.openwrt.org'. This might be the full link for your device but check it yourself:
https://firmware-selector.openwrt.org/?version=22.03.3&target=mediatek%2Fmt7622&id=bananapi_bpi-r64
If 'attended sysupgrade' is installed on your router you can do this right in luci or on the command line. Be sure to back-up the list of installed packages as well as the config.
https://192.168.1.1/cgi-bin/luci/admin/system/attendedsysupgrade/overview
(change the ip address as needed.)
Using this method from post #9 in the link I posted above I was able to resize the sdcard.
I have figured out how to mount the remaining 7gb
to extend the /overlay do the following
install cfdisk
cfdisk /dev/mmcblk0
format the FREE space (7,1GB)
save and exit
then
mkfs.ext4 /dev/mmcblk0p6
mount /dev/mmcblk0p6 /overlay/
now the 7GB are mounted
Damn! It does not survive reboot.
Looking at those instructions it looks like they are for OpenWrt on the emmc for bpi-r3 and not using an sd card in a bpi-r64.
You may have altered your system in way that breaks something at some point, possibly recovery
if such a thing exists. (from memory of reading posts a while ago)
If you added a new partition to fill the free space on the sd card with format the FREE space (7,1GB)
then you may be ok. If you extended an existing partition you may see problems and reinstalling OpenWrt may be in order. Upgrading to the latest stable might be good if it isn't known to break some needed software. Using a custom build with the firmware selector to add all your packages might be useful.
Note that if you do expand your overlay filesystem it does not survive a system upgrade and needs to be redone every upgrade and your files restored from backup.
How do flash the emmc version of OpenWrt?
I don't know, but these links might help:
Installation instructions on the bpi-r64 device page:
https://openwrt.org/toh/sinovoip/bananapi_bpi-r64_v1.1#installation
This older thread might (or might not) still apply:
Banana Pi R64 Can not run sysupgrade OpenWrt image from development snapshot - #2 by adrian_dsl
There may be helpful info for running official OpenWrt on the OEM support page as well.
https://wiki.banana-pi.org/Getting_Started_with_R64