Partition Mtd resize WRT1200AC v2

Good afternoon, tell me, can I increase the size of the partition where openwrt mtd4, mtd5 is installed by deleting alternative partitions mtd6, mtd7, or is it a complicated procedure.
do I understand correctly that you need to remove mtd4-mtd7, then create mtd4-mtd5, rebuild u-boot specifying the required partition sizes there, and when building openwrt in the kernel, specify the correct partition size ?

I'm not good at working with linux partitions, especially on routers, so I ask for help with increasing the main partition for openwrt, I don't need an alternative partition.

(haven't checked the specific devices' flash layout etc)

if the "unused" partitions sit together you could merge them into one, and use it as extroot ?

this could however break things down the road..

but you're ok with rebuilding uboot and the kernel ?

the size of the openwrt assembly I get is more than 40 Mb. the option with exroot will not work.
I'm ready to assemble u-boot and the kernel, I just need your help in building, I haven't done this yet, but I changed the openwrt kernel to boot from hdd to ext4 which is connected to sata and can load an openwrt image of any size, but hdd buzzes and interferes sleep

The partitioning on the wrt1200ac cannot be repartitioned easily, you'd basically have to change 'everything' at a very high risk for the device in question.

1 Like

just a remark, questions about building u-boot should probably be posted at some u-boot forum.

if you're replacing it, why not enable usb boot, and have openwrt boot completely off your usb storage ?

Given the efforts needed and risks involved, replacing the device with one that provides 'enough' usable flash would be far more reasonable. These days we fortunately have options, but on the other hand, a >40 MB image is also a sign of doing something wrong (it's a router, keep it lean).

1 Like

It is dual-firmware device...

Usually not.
You shouldn't need to touch u-boot, if you are not changing the start location of the kernel partition.
Partition sizes are in the DTS for kernel, not in the compiled u-boot.

But, WRT12900AC u-boot is designed for a dual-boot logic. Removing the "alternative" kernel and rootfs means that you need to remove the whole dual-boot logic from u-boot env variables. You need to re-design the bootcmd.
(And OpenWrt sysupgrade routine and boot routine for the device)

First guess is that you have included Samba package in the build. Sometimes it causes crazy large images. (if yes, you might consider ksmbd tools instead)

At least kernel1+rootfs1 (40 MB), kernel2+rootfs2 (40 MB) and syscfg (38 MB) are expected and used (required) by bootloader- and OpenWrt (sysupgrade) without serious changes (and that ignores u-boot (2 MB), u_env (256 KB), s_env (256 KB) and devinfo (1 MB)), which are totally hands-off), that doesn't leave you with much to salvage (128 MB total flash size).

…it's just $not_a_good_idea.


if i remove kernel2+ rootfs2(40MB) then the router won't boot if openwrt is installed in kernel1+ rootfs1(40MB) ?

i want to remove kernel1+ rootfs1(40MB) and kernel2+ rootfs2(40MB) and then create kernel1+ rootfs1 to have 80MB

it would be nice to combine the main partition (40 MB) and the alternate (40 MB) into one partition (80 MB) and build an openwrt assembly with the necessary components so that everything is stored in one nand-memory, for 40 MB The alternative partition is not used, and I no need to run the OS from an alternate partition.

I need samba 4 and qbittorrent, and they are voluminous

do you need windows file sharing, or samba4 pacifically ?
as @hnyman wrote, use ksmbd instead.

That is not going to happen for OpenWrt, if you want that, you will have to make all necessary source changes (and there are more interactions than you seem to think - and more for these linksys mvebu devices than for most other devices as well) yourself, for all future updates to come.


I seem to have found a solution to my question

That seems to be nothing complicated, I will try :slight_smile:

Is there a compelling reason not to use a USB stick and extroot?


I will have two hard drives connected to USB2.0-esata and USB 3.0 ports

I suggest a small USB 3.0 hub with 3 or 4 ports. Then you can use a USB stick with extroot, and other external drives.

It's better to use the built-in mechanisms for root space expansion rather than to fight with OpenWrt.

I am aware that you can use a USB 3.0 hub, but I would like to run the assembled firmware with openwrt packages with nand memory

So, no, there isn't a compelling reason not to use USB and extroot, you just want to do it the way you want to do it. Which is fair enough, but this is less a project of necessity and more just experimenting with how you can bend OpenWrt's design on your device.

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