Is my RT3200 on UBI

Greetings,

My Belkin RT3200 succumbed to the OKD. I was able to revive it using with the UART method.

Thank you to those who pinpointed the bug, fixed it, and provided the recovery! Kudos!

Re: https://openwrt.org/toh/linksys/e8450#installation

Now, I am reading about this UBI layout, but I can't figure out the state of my installation. I assume it is on UBI, but I'd like a confirmation. I installed OpenWRT 23.05.2 last December, but I didn't keep notes. I can't recall what I did. To that end:
(1) How do I tell if the router is on UBI layout? From the outputs below I assume it might be...
(2) Looks like I was able to save the "vendor boot chain". Or did I save the OpenWRT boot chain?
(3) I would like to use "OpenWRT permanently". Do I need to run the referenced installer first? As per "Upgrading an UBI installation to new releases after 2024-02". Provided I am on a UBI installation.
(4) Can I just use attended sysupgrade (never done it before) to version 24.10.2, and it will take care of all of the above?

I searched the forum, read wiki pages, but still could not connect all the dots.

Any pointers are appreciated.

tjk :slight_smile:

# cat /etc/openwrt_release 
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='23.05.2'
DISTRIB_REVISION='r23630-842932a63d'
DISTRIB_TARGET='mediatek/mt7622'
DISTRIB_ARCH='aarch64_cortex-a53'
DISTRIB_DESCRIPTION='OpenWrt 23.05.2 r23630-842932a63d'
DISTRIB_TAINTS=''

# grep "(release)" /dev/mtd0ro
v2.4(release):OpenWrt v2021-05-08-d2c75b21-3 (mt7622-snand-1ddr)
v2.4(release):OpenWrt v2021-05-08-d2c75b21-3 (mt7622-snand-1ddr)
v2.4(release):OpenWrt v2021-05-08-d2c75b21-3 (mt7622-snand-1ddr)
v2.4(release):OpenWrt v2021-05-08-d2c75b21-3 (mt7622-snand-1ddr)

# block info
/dev/ubiblock0_4p1: UUID="*-*-*-*-*" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/ubi0_3: UUID="*-*-*-*-*" VERSION="w5r0" TYPE="ubifs"
/dev/ubi0_5: UUID="*-*-*-*-*" VERSION="w5r0" MOUNT="/overlay" TYPE="ubifs"
/dev/sda: UUID="*-*-*-*-*" LABEL="slax" TYPE="iso9660"
/dev/sda1: UUID="*-*-*-*-*" VERSION="1.0" MOUNT="/mnt/sda1" TYPE="ext4"

# mkdir /tmp/boot_backup
# mount -t ubifs ubi0:boot_backup /tmp/boot_backup
# ls -l /tmp/boot_backup/
-rw-r--r--    1 root     root        524288 Dec 31  1969 mtd0
-rw-r--r--    1 root     root       1310720 Dec 31  1969 mtd1
-rw-r--r--    1 root     root       1048576 Dec 31  1969 mtd2
-rw-r--r--    1 root     root       2097152 Dec 31  1969 mtd3

Let's use the rest of the provided information to answer this one:

This shows your BL2 is running a version built specifically for OpenWRT. Because non-UBI devices use the factory preloader and boot chain, the above is strong evidence for having converted to the UBI layout.

These lines confirm that indeed you are running a UBI variation.

2 and 3: If you ran the UBI installer once and only once, then these files from boot_backup will contain the factory bootchain and (hopefully) supporting partitions, saved in a 23.05.x OpenWRT compatible MTD layout. Even when properly backed up, restoring it contains some potential issues. If you're going to permanently run OpenWRT (good choice!), there is only one file in that set that you should treat like gold: mtd2 (the factory partition). This is the one partition that is both unique to your router and is also absolutely crucial for both stock and OpenWRT to run correctly. If you have a valid copy of this file, you can recover your router to OpenWRT regardless of how badly the flash data is damaged.

We need a little more information from your previous post to completely and definitively answer the last two questions.

This device has only one UBI layout compatible with 23.05.x. Since we know the device is running a UBI version, the fact that it is running 23.05 and has version 2.4 of the BL2 confirm that the device is properly configured to use the older version of UBI. Therefore:

3 and 4: No. We confirmed above that you are running the older UBI layout. It is not compatible with 24.10.x, so you do need to load UBI Installer 1.1.4 before upgrading to any of the 24.10.x series firmwares.

1 Like

@grauerfuchs,

Thank you for the great explanation. I'll do the 1.1.4 installer, then the 24.10.2 upgrade. I'll post the outcome.

Cheers!
tjk :slight_smile:

I'm glad it provided the information you needed. A few tips to help out:

If you can, start a new configuration after upgrading to 24.10. There were enough changes between the major versions (including the fact that you need to run the installer) that make the configuration backup "not entirely" compatible between the versions. Although it's possible to pick and fit the compatible parts, it's often easier, faster, and more reliable to simply start the configuration from the defaults after a major version upgrade.

Also, to reiterate a prior point, please make sure you have safeguarded a backup of mtd2 somewhere other than the router prior to performing the upgrade. You may have already seen it if you've combed through the forum, but if you haven't caught sight of one of the many users that didn't do so, recovering without the data is never perfect and it's loaded with headaches. If you don't want to go through the trouble of mounting boot_backup and using scp or another tool to offload the files, LuCI on 23.05 provides the easy option of backing up the mtdparts right from the firmware flash/backup page. The partition you want is labeled 'factory'. Sadly, this ease of access disappears with 24.10 because everything other than the BL2 gets moved into UBI by the installer.

1 Like

@grauerfuchs,

Just finished the upgrade. All went fine. Thanks again!

Cheers!
tjk :slight_smile:

1 Like

That's excellent news. Thank you for the update, and I'm glad all went well!