D-LINK DIR-825 b1 size of overlay changed in snapshots?

Hi!
I test snapshots now and then on this device and like 5-8 month ago I noticed I can't install luci any longer due to running out of overlay disk space.
Comparing a snapshot and 21.02.2 I see a reduction in overlay size by ~400kb. According to device page https://openwrt.org/toh/d-link/dir-825#flash_layout this device should have 3328KiB /overlay, right?
So where does all the space go?
I do see that /rom is looks bigger on my device than on the device page but I think that is due to /rom being compressed and df shows uncompressed, right?
I wonder if this loss of space may have anything to do with the switch to kernel 5.10 in December...

Snapshot (after trying to install luci and failed):

root@OpenWrt:/tmp# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 3.3M      3.3M         0 100% /rom
tmpfs                    27.8M      6.1M     21.6M  22% /tmp
tmpfs                    27.8M     48.0K     27.7M   0% /tmp/root
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock5          576.0K    516.0K     60.0K  90% /overlay
overlayfs:/overlay      576.0K    516.0K     60.0K  90% /

21.02.2:

root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 3.3M      3.3M         0 100% /rom
tmpfs                    28.6M     72.0K     28.5M   0% /tmp
tmpfs                    28.6M     72.0K     28.5M   0% /tmp/root
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock5          960.0K    236.0K    724.0K  25% /overlay
overlayfs:/overlay      960.0K    236.0K    724.0K  25% /

It's possible...

With only 8 MB of flash and 64 MB of RAM, your device is currently at the minimum required to run a plain vanilla install of 21.02.0

From the 21.02.0 release announcement -

Increased minimum hardware requirements: 8 MB flash, 64 MB RAM

Due to new features being introduced and the general size increase of the Linux kernel, devices now need at least 8 MB of flash and 64 MB of RAM to run a default build of OpenWrt. More flash space is recommended for extensibility, see 8/64 warning.

There's a pull request to increase the available space on this router. It's here: https://github.com/openwrt/openwrt/pull/4603

I'm hoping this gets merged into a future release! :crossed_fingers:

1 Like

Thanks for your replies, I think I've looked at this PR before. Sure would be nice to see that merged :slight_smile:
Still curious what actually decides the size of /overlay? Device page say 3328KiB for this and that ends up being 960K or 576K, how come? Has /rom eaten of this space? Even if /rom looks bigger in my df above it still does not explain where all of the 3328K might have gone :frowning:

Looking at the device wiki page, this is my interpretation:

The partitions at "Layer1" are fixed (ie what D-Link decided).

mtd7 (firmware) is then split between kernel, /rom and /overlay. These three partitions can vary in size.

I'm currently running 19.07 on my DIR-825 and have this partitioning (from kernel log):


[    0.700656] Creating 2 MTD partitions on "firmware":
[    0.705672] 0x000000000000-0x000000187128 : "kernel"
[    0.711271] 0x000000187128-0x000000610000 : "rootfs"
[    0.716847] mtd: device 4 (rootfs) set to be root filesystem
[    0.722532] 1 squashfs-split partitions found on MTD device rootfs
[    0.728753] 0x0000003f0000-0x000000610000 : "rootfs_data"

Ie.. kernel is now 1601832 (0x187128) bytes, /rom is 2526936 (0x3f0000 - 0x187128) bytes and /overlay is 2228224 (0x610000 - 0x3f0000) bytes.

(And the PR referenced earlier adds mtd6 to mtd7, ie adds an additional 1600 kb to /overlay)

Overlay is whatever space remains in the flash chip after reserved areas, kernel, and rootfs have been taken.

The explanation on the PR is not well written but the modification is to de-allocate a reserved area which is only used by stock firmware.

1 Like

How much do you see when you do a df then? Why isn't all of the overlay partition available in the file system? My understanding is that the overlay should be completely empty when a device is just flashed? But if something has used overlay space I guess that should be visible as used but it isn't, it is the total size of overlay that confuses me which does not match the device wiki page :frowning:

That is the logical and easy explanation of it but how to explain the differences then?

Yes, my understanding of the PR too

Look in /overlay/upper and you will see what's using space in /overlay.

Yes that is of course empty on a fresh flash. It was not exactly my question what is visible, it is more about what is taking up space that is not visible since overlay partition should be much larger than is usable/visible with df.

New larger kernel versions, new larger packages included in the firmware...

See a brief analysis at

(from section "Analysis of firmware size growth" onward)

I would expect those changes to be in the /rom partition and not in /overlay?
/rom is 3.3MB on both current stable and snapshots so I guess that is not changed or is that number some fictive number because of how the rom+overlay works together? And that /rom can still eat overlay space without any visible difference with df?

@jow would probably be able to give the exact details.

However, it doesn't change anything.

As @hnyman stated, kernel and package size increases have pushed your 8/64 device to it's limits.

Your choices currently are to use an older stable to get you under the limit, or purchase a new device.

Yes I understand it does not change anything but I'm curious how rom/overlay space works, like why it does not seem to match flash partition sizes given in device wiki page? Why overlay is smaller in snapshots but nothing else seems to have changed? :blush:

I wouldn't attribute much to differences in the device wiki page sizes, which were likely based on the stable release (which "stable" is the question).

Snapshots by definition are "experimental", and change daily.

What you see today may, or may not be in the snapshot tomorrow.

The /overlay size difference between snapshot and stable is "minor", about 400K so we can forget I even mentioned snapshots for now. The difference beween wiki page /overlay and stable is 3328K vs 960K = 2368K diff, not really minor.

The D-Link DIR-825 rev B1 is an ancient device, supported for almost a decade - do you really think the details (like flash usage, which are always in a state of flux) are updated after every new release? If you do, you'll have to get a wiki account and do the updating yourself.

3 Likes

Yeah I could, but it is kind of catch 22 when nobody can answer how the flash space works to check it out...

As mentioned above, @jow could probably give exact details.

You might ping him.

I'm out.

1 Like

Mk24 already explained the core logic.

There is a defined max size available for firmware.
First kernel area gets allocated, then the rootfs (/rom), and the remaining part gets set as overlay.

As kernel grows, the space left for overlay decreases.

1 Like