Build error: ext4_allocate_best_fit_partial: failed to allocate 1 blocks, out of space?

I tried building an image for RPi4 after enabling a new option in my .config and found that the build is consistently ending an error. Complete make -j1 v=S build log is here.

An excerpt from the log is below and the error message is suggestive that my build root is out of disk space but that is not the case. I have over 40G free on that file system. I also ran e2fsck on the filesystem and no errors were present. Any thoughts?

...
rm -f /scratch/union/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/image-bcm2711-rpi-cm4.dtb.tmp
mkdir -p /scratch/union/bin/targets/bcm27xx/bcm2711 /scratch/union/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/tmp
rm -rf /scratch/union/build_dir/target-aarch64_cortex-a72_musl/json_info_files
/scratch/union/staging_dir/host/bin/make_ext4fs -L rootfs -l 109051904 -b 4096 -m 0 -J -T 1668450021 /scratch/union/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/root.ext4 /scratch/union/build_dir/target-aarch64_cortex-a72_musl/root-bcm27xx/
Creating filesystem with parameters:
    Size: 109051904
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 6656
    Inode size: 256
    Journal blocks: 0
    Label: rootfs
    Blocks: 26624
    Block groups: 1
    Reserved blocks: 0
    Reserved block group size: 7
error: ext4_allocate_best_fit_partial: failed to allocate 1 blocks, out of space?
make[5]: *** [/scratch/union/include/image.mk:328: /scratch/union/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/root.ext4] Error 1
make[5]: Leaving directory '/scratch/union/target/linux/bcm27xx/image'
make[4]: *** [Makefile:33: install] Error 2
make[4]: Leaving directory '/scratch/union/target/linux/bcm27xx'
make[3]: *** [Makefile:11: install] Error 2
make[3]: Leaving directory '/scratch/union/target/linux'
time: target/linux/install#4.43#1.00#5.41
    ERROR: target/linux failed to build.
make[2]: *** [target/Makefile:30: target/linux/install] Error 1
make[2]: Leaving directory '/scratch/union'
make[1]: *** [target/Makefile:24: /scratch/union/staging_dir/target-aarch64_cortex-a72_musl/stamp/.target_install] Error 2
make[1]: Leaving directory '/scratch/union'
make: *** [/scratch/union/include/toplevel.mk:231: world] Error 2

EDIT: I just found this thread... is the issue that the IMAGE'S root filesystem is now too small to fit all the packages I want?

I partitioned the uSD card for this RPi4 to have a pretty large data partition after the two that the default image created. Here is the partition table on the device:

Disk /dev/mmcblk0: 14.84 GiB, 15931539456 bytes, 31116288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5452574f

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1 *      8192   139263   131072   64M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      147456   360447   212992  104M 83 Linux
/dev/mmcblk0p3      360448 31116287 30755840 14.7G 83 Linux

Should I simply backup all data on /dev/mmcblk0p3, unmount it, delete it, increase the image size in menuconfig, (say change 104 to 256), build and flash that new image, then recreate the data partition and restore the data?

Will this take automatically take care of repartitioning my /dev/mmcblk0p2 to be 256 MiB

After testing on a spare card, indeed, the process of flashing an image with a modified rootfs size does indeed repartition the rootfs as it sees fit. The process I described above did indeed work as expected.

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