Netgear R7800 - only 19MB Flash available?

Hello everyone!
I've just installing LEDE on Netgear R7800 and found only ca. ~19MB flash available. In specs there are 128MB flash and that point make my choice of router.
/overlay is only "ubi" partition but there is also big unused (?) "netgear" partition. Is it possible to use whole 128 MB flash available in userspace?

You have identified the correct reason: to preserve the possibility to revert back into a fully functional Netgear OEM, the LEDE firmware is only stored to the 30 MB "ubi" partition and the 70 MB "Netgear" partition is left intact and marked read-only.

root@lede:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00c80000 00020000 "qcadata"
mtd1: 00500000 00020000 "APPSBL"
mtd2: 00080000 00020000 "APPSBLENV"
mtd3: 00140000 00020000 "art"
mtd4: 00140000 00020000 "artbak"
mtd5: 00200000 00020000 "kernel"
mtd6: 01e00000 00020000 "ubi"
mtd7: 04480000 00020000 "netgear"
mtd8: 00700000 00020000 "reserve"
mtd9: 02000000 00020000 "firmware"

I am not sure if the OEM firmware uses that actually for something, but it might. So overwriting that may render the device unable to fully utilize the OEM firmware :frowning:

It might be possible to use also that Netgear partition if you edit the DTS file defining the R7800 flash layout and then compile your own firmware:
https://git.lede-project.org/?p=source.git;a=blob;f=target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-r7800.dts;hb=HEAD#l353

 353                         kernel@1480000 {
 354                                 label = "kernel";
 355                                 reg = <0x1480000 0x0200000>;
 356                         };
 357 
 358                         ubi@1680000 {
 359                                 label = "ubi";
 360                                 reg = <0x1680000 0x1E00000>;
 361                         };
 362 
 363                         netgear@3480000 {
 364                                 label = "netgear";
 365                                 reg = <0x3480000 0x4480000>;
 366                                 read-only;
 367                         }; 
 ...
 375                         firmware@1480000 {
 376                                 label = "firmware";
 377                                 reg = <0x1480000 0x2000000>;
 378                         };

I think that combining the entries should be possible, as long as you calculate the values correctly. You also need to adjust "firmware" that is "kernel"+"ubi" combined.

New key values might be:

  • kernel: no changes
  • ubi: size changed to be ubi+Netgear
    reg = <0x1680000 0x6280000>;
  • netgear: removed
  • firmware: size changed to include Netgear
    reg = <0x1480000 0x6480000>;

I have not tested the advice above, so this is just an educated guess...

Thanks to Cezary from http://eko.one.pl who's compiled modified images I can use whole flash space. Also flashing "standard" LEDE image and restoring "netgear" partition from backup I could revert to OFW.

So: IT WORKS :slight_smile:

BTW, if anybody try this, remember to flash "-factory.img" for change flash layout in both cases (OFW/LEDE -> LEDE-large flash and LEDE-large -> LEDE/OFW), sysupgrade won't change paritions.

1 Like

Could you write a brief step by step? How to go larger with which file, and how to revert back? Better have what file you have used

Thanks

Here's my post on eko.one.pl forum (it's Polish forum, so I paste Gogle Translated):
Netgear R7800 - the use of the entire area of the flash
In this tutorial I linked to LuCi image: http://dl.eko.one.pl/luci/lede/17.01-SNAPSHOT/targets/ipq806x/generic/luci-ipq806x-R7800-large-squashfs-factory.img
But if You wish flash it on daily used router, I suggest to wait 'till weekend - Cezary will make new builds (if everything goes fine).

1 Like

Based on the mtd info on your post to the other forum, @cezary has done the DTS modifications for the MTD partition definitions like I proposed above. That is the key part in the actual change for actually expanding the rootfs partition.

Yes, exactly. As he has much, much more experience, I asked him to modify image follow Your @hnyman instructions and make images. So I was like Lab mouse :smile: but everything was OK and router works since then.
On his forum was other people interested in using whole flash so I made a post with instructions step-by-step from backing up partitions to return to OFW. So if anyone think it should be pinned here (in documentation or router's page or somwhere) feel free to get this machine translated text I paste above and make language corrections.

Someone had to test it.

I've asked, I've tested - no big deal :smile:

I've just bought this router so I could test images, even faulty.
Netgear has a nice bootloader with tftp, so easy to revert faulty image, even for noobs.

Yup. The easy recovery from brick is feature that many overlook when selecting a router. The TFTP in R7800 is super-easy (as it is also in my WNDR3700/3800 routers).

I have used R7800's TFTP recovery today 5 times, as I have tried to get a kernel 4.9 based firmware running, but so far no success...

Well, my priority was powerful hardware and LEDE support. The old TP-Link 3600 got hiccup and been overloaded with OpenVPN, 1-wire, Postgress, several WiFi clients and dnsmasq hostfile with nearly 0.5 million blocked sites :smile:
Now R7800 is boring although OVPN uses AES256 instead BC and Adblock shows nearly 1mln blocked domains...

Oh, and I hate extroot :smile:

Thanks to cezary for the build!. Runs nice and smooth with all the flash memory available. Also thanks to Wally and hnyman for the tips in this thread.

I tried sysupgrading from Cezary's build (used it to get more space) to hnymans build, it leaves the router in an unsuable state and I end up tftp installing stock. I unchecked the keep settings option while upgrading, I wonder why I cant upgrade to hnyman's build.

'Coz has different flash map. If You want to flash image with different map/OFW You have to always flash 'factory' via tftp - 'sysupgrade' image doesn't change partition map. Check my translated tutorial (link is a few posts up) - I've tested migration in both ways (sysupgrade too).

Ok sorry, I misunderstood earlier (I mis read the information in the link you posted) for some reason I thought you could upgrade after the partition changes, my stupidity lol. Anyway thanks for clearing that up.

Netgear partition might have the Genie and other readyshare vault store in it might be .

There are also additional languages and saved settings (in OFW) as I could seen in hexeditor. So I've suggested backup all partitions before changing flash layout, just in case.

Anyone have actual partition layout.

Not exactly :slight_smile: Many users looking on flash capacity when searching new router (as me) to avoid extroot. So if You get 19 instead 100MB, there is something that makes You searching deeper. Believe me, there are many users that use firmware with expanded flash not default in LEDE, especially on Netgears. The only way is custom build. So, make backup and free Your router :smile:

So even if the 128MB flash available to one. Is there any firmware that can take advanatage. Like say PFSENSE is almost an OS. A mini version of it.