Using MTD partition as extroot with UBI volume

I have a empty system MTD partition on my Linksys EA9500. How can I create a custom UBI volume for use with extroot?

back it up just in-case
but you can recompile your own openwrt
& add the room via concatenation to openwrt

Is there no other way? I already have the mtdblock, I just need to make it into a ubi volume

someone out there may know
usually unused mtd's are marked as read only but you would have to check
you can look up Extroot for using a USB stick to do it

The wiki page for the Netgear R6220 contains a (very terse) section on how to create an UBI partition on an MTD block.

I never tried it on my R6220 myself, not sure if this will work as an extroot partition, if the process happens early enough to pivot root there. But you can probably go "extroot light sugarfree" and install packages there. (Not sure why the examples insist on mounting it into /tmp, though, something like /opt would seem more logical to me.)

Thank you! One final question: when I do this, I get two things: /dev/ubi1_0 and /dev/ubiblock1_0. According to md5sum, these are exactly the same, but I can mount ubi1_0, and not ubiblock1_0. When I run block info it shows the following:

root@OpenWrt:~# block info
/dev/ubiblock0_0: UUID="8a96e0c0-ac35b5fb-f97e9aa1-df9b6bdb" VERSION="4.0" TYPE="squashfs"
/dev/ubiblock1_0: UUID="be8bf523-245c-402e-a1aa-8d8cc647da2b" VERSION="w5r0" TYPE="ubifs"
/dev/ubi0_1: UUID="9bc7abe9-923a-44ae-ae9c-86127375d9fa" VERSION="w5r0" MOUNT="/rwm" TYPE="ubifs"

Since ubi1_0 isn't there, I'm unable to mount it using block. Is there any way to add ubi1_0 there?

And what's the difference between ubi and ubiblock?

Edit: dmesg shows the following:

[ 1645.131309] ubi1: attaching mtd7
[ 1645.385765] ubi1: scanning is finished
[ 1645.398829] ubi1: attached mtd7 (name "system", size 46 MiB)
[ 1645.404576] ubi1: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 1645.411468] ubi1: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 1645.418288] ubi1: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 1645.425288] ubi1: good PEBs: 367, bad PEBs: 1, corrupted PEBs: 0
[ 1645.431374] ubi1: user volume: 1, internal volumes: 1, max. volumes count: 128
[ 1645.438622] ubi1: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 547778732
[ 1645.447759] ubi1: available PEBs: 0, total reserved PEBs: 367, PEBs reserved for bad PEB handling: 19
[ 1645.457079] ubi1: background thread "ubi_bgt1d" started, PID 7927
[ 1652.172047] block ubiblock1_0: created from ubi1:0(system)
[ 2106.104399] /dev/ubiblock1_0: Can't open blockdev
[ 2196.632820] UBIFS (ubi1:0): Mounting in unauthenticated mode
[ 2196.638927] UBIFS (ubi1:0): background thread "ubifs_bgt1_0" started, PID 8730
[ 2196.682791] UBIFS (ubi1:0): recovery needed
[ 2196.766219] UBIFS (ubi1:0): recovery completed
[ 2196.770773] UBIFS (ubi1:0): UBIFS: mounted UBI device 1, volume 0, name "system"
[ 2196.778350] UBIFS (ubi1:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 2196.788316] UBIFS (ubi1:0): FS size: 42409984 bytes (40 MiB, 334 LEBs), journal size 2158592 bytes (2 MiB, 17 LEBs)
[ 2196.798869] UBIFS (ubi1:0): reserved for root: 2003128 bytes (1956 KiB)
[ 2196.805505] UBIFS (ubi1:0): media format: w5/r0 (latest is w5/r0), UUID BE8BF523-245C-402E-A1AA-8D8CC647DA2B, small LPT model
[ 2278.216468] /dev/ubiblock1_0: Can't open blockdev

Pretty much what it says on the tin: ubix_x is the UBI volume, ubiblockx_x is the block device on top of the volume. UBI block devices are read-only, on purpose.

And do you know why ubi1_0 doesn't appear on block info?

I'm not entirely sure honestly, I'm slowly getting out of my depth here with the nitty gritty internals and before I spout something incorrect I would rather defer that to someone more knowledgeable than me.

Haha that's fine, thank you for your help. I'll just use the 'light extroot'

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.