Massive space loss on UBIFS partition

root@OpenWrt:~# ubinfo -a
UBI version:                    1
Count of UBI devices:           1
UBI control device major/minor: 10:126
Present UBI devices:            ubi0

Volumes count:                           2
Logical eraseblock size:                 15872 bytes, 15.5 KiB
Total amount of logical eraseblocks:     3840 (60948480 bytes, 58.1 MiB)
Amount of available logical eraseblocks: 0 (0 bytes)
Maximum count of volumes                 92
Count of bad physical eraseblocks:       0
Count of reserved physical eraseblocks:  80
Current maximum erase counter value:     4
Minimum input/output unit size:          512 bytes
Character device major/minor:            251:0
Present volumes:                         0, 1

Volume ID:   0 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        787 LEBs (12491264 bytes, 11.9 MiB)
State:       OK
Name:        rootfs
Character device major/minor: 251:1
Volume ID:   1 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        2969 LEBs (47123968 bytes, 44.9 MiB)
State:       OK
Name:        rootfs_data
Character device major/minor: 251:2
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                12.0M     12.0M         0 100% /rom
tmpfs                    58.9M      2.5M     56.4M   4% /tmp
/dev/ubi0_1              32.9M      2.9M     27.9M   9% /overlay
overlayfs:/overlay       32.9M      2.9M     27.9M   9% /
tmpfs                   512.0K         0    512.0K   0% /dev

UBI0:1 partition is 44.9MB big, but df shows that ubi0_1 is just 32.9MB big. 12MB space has gone, and that is close to UBI0:0 which is squashfs rootfs.

Where do these space go? Is it a bug?

I tried Chaos Calmer and Snapshot branch, both of them have this problem.

What device?

Chaos Calmer is long out of support.

A device supported by me, I copied its config from kirkwood. But as far as I know, all kirkwood devices using squashfs + ubifs have this problem. please have a look, also tried snapshot branch. And that is what I'm using now. I merge it every week.

So, you're asking the forum to fix your black box for you, by providing zero info and details?


I forked openwrt snapshot branch and added a target. I didn't change any of the original code. I'm using kirkwood default partition table, squashfs + ubifs. I think this is an old problem of kirkwood targets.
Look at this post.
His df space is smaller than ubi0:1 too, and the gone space is close to squashfs size too.

UBIFS (ubi0:1): FS size: 13919744 bytes (13 MiB, 877 LEBs), journal size 698368 bytes (0 MiB, 44 LEBs)
[    1.282892] 0x000000490000-0x000001600000 : "ubi"
/dev/root                 2.3M      2.3M         0 100% /rom
/dev/ubi0_1               9.8M     84.0K      9.0M   1% /overlay