WRT1900 and MTD and UBI and Mounting NonVolatile Flash

wiki.TerraBase.info
Revision as of 18:22, 29 January 2026 by Root (talk | contribs) (Created page with "All of the below notes are based on a WRT1900ACS device, with OpenWRT 24.10.5, in early 2026. Adjust to your own environment ...start here, to get some information: <code>ubinfo</code><syntaxhighlight lang="text"> ubinfo UBI version: 1 Count of UBI devices: 3 UBI control device major/minor: 10:256 Present UBI devices: ubi0, ubi1, ubi2 </syntaxhighlight>And maybe some more info about a specific device: <code>ubinfo -d 2</code><syn...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

All of the below notes are based on a WRT1900ACS device, with OpenWRT 24.10.5, in early 2026. Adjust to your own environment

...start here, to get some information: ubinfo

ubinfo
UBI version:                    1
Count of UBI devices:           3
UBI control device major/minor: 10:256
Present UBI devices:            ubi0, ubi1, ubi2

And maybe some more info about a specific device: ubinfo -d 2

ubi2
Volumes count:                           2
Logical eraseblock size:                 126976 bytes, 124.0 KiB
Total amount of logical eraseblocks:     272 (34537472 bytes, 32.9 MiB)
Amount of available logical eraseblocks: 0 (0 bytes)
Maximum count of volumes                 128
Count of bad physical eraseblocks:       0
Count of reserved physical eraseblocks:  20
Current maximum erase counter value:     3
Minimum input/output unit size:          2048 bytes
Character device major/minor:            244:0
Present volumes:                         0, 1

Oh, better yet, some more information: ubinfo -d 2 -n 0

Volume ID:   0 (on ubi2)
Type:        dynamic
Alignment:   1
Size:        58 LEBs (7364608 bytes, 7.0 MiB)
State:       OK
Name:        rootfs
Character device major/minor: 244:1

Wait! What allowed for that above "-d 2" to be attached? This is the command: ubiattach -m 7 -d 2

Why "-m 7"? For a WRT1900ACS, just look up the documentation: https://openwrt.org/toh/linksys/wrt1900acs

Layer 0 raw flash

128 MiB

Layer 1 mtd0

u-boot 1 MiB

mtd1

u_env 256 KiB

mtd2

s_env 256 KiB

mtd3

devinfo 1 MiB

firmware

80 MiB

mtd8

syscfg 38 MiB

mtd9

unused_area 6656 KiB

Layer 2 mtd4

kernel1 40 MiB

mtd6

kernel2 40 MiB

Layer 3 primary

kernel image 6 MiB

mtd5

rootfs1 (ubi) 34 MiB

alternate

kernel image 6 MiB

mtd7

rootfs2 (ubi) 34 MiB

What about what's in /dev?: ls -la /dev

Don't try this: mount -t ubifs ubi2:rootfs /tmp/ubi2

Why? Well, it's a SquashFS File System, so try this instead: mount -t squashfs /dev/ubiblock2_0 /tmp/ubi2

* And don't forget to do this first: mkdir /tmp/ubi2