Diskspace on Netgear R6220

I bought this router which should have 128 MB of disk space.

Yet after installation of relevant release of OpenWRT I can only see 18MB:

% df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 2.8M      2.8M         0 100% /rom
tmpfs                    60.5M      1.1M     59.4M   2% /tmp
/dev/ubi0_1              18.3M     11.7M      5.6M  67% /overlay
overlayfs:/overlay       18.3M     11.7M      5.6M  67% /
tmpfs                   512.0K         0    512.0K   0% /dev

Is this just a matter of configuration, a partition is too small (hard to check, somehow I do not have block command available that OpenWRT docs recommend to check for this)? If the disk is actually bigger, how to extend it?

in the link you provided, scroll down to Flash Layout... most info you need is clearly listed. USB extroot overlay is the simplest and recommended method if you require additional disk space.

If a device has 128 MB of flash memory, that does not equal to 128 MB usable "disk space" (it is obviously not a "disk" by the way). And the R6220 is a rather extreme example of that.

That's because OpenWrt is using the same partition layout as the original firmware and works within its restraints. Keeping the layout is absolutely necessary for partitions related to booting and keeping essential hardware information (for example the wifi calibration data), but it also makes sense to keep the rest of the partition layout intact to allow a path back to the manufacturer's firmware.

Now, Netgear decided to do their whole firmware in a partition of roughly 21 MB, so that's what OpenWrt uses, too. 3 MB are used for the read-only system files, so 18 MB free space checks out. Someone please CMIIW.

There is a hack on the wiki page to "unlock" an unused 60 MB partition on flash, and make it usable to mount into the file system (much like you would mount a USB drive). Proceed at your own risk of course.

All that being said, 18 MB is actually quite generous and allows to install all but the really hitting packages that don't make much sense on a router anyway. You should be fine even with 18 MB.

2 Likes