Skip to content

docker/build-rootfs-image.sh: fix: size rootfs image from apparent size - #234

Open
papamoose wants to merge 1 commit into
LibreChat-AI:mainfrom
papamoose:fix/du_apparentsize
Open

papamoose wants to merge 1 commit into
LibreChat-AI:mainfrom
papamoose:fix/du_apparentsize

Conversation

@papamoose

@papamoose papamoose commented Sep 18, 2026

Copy link
Copy Markdown

…ze, not allocated blocks (fixes mkfs.ext4 on ZFS data roots)

build-rootfs-image.sh sized the ext4 image from plain du, which on a compressed data root (e.g. ZFS) reports compressed sizes, the image ends up ~30% too small and mkfs.ext4 -d fails. Switching to du --apparent-size fixes it.

Before:

> [codeapi-sandbox sandbox-rootfs-image 7/7] RUN ... build-rootfs-image.sh /sandbox-rootfs /sandbox-rootfs.img:
29.87 __populate_fs: Could not allocate block in ext2 filesystem while writing file "magic.mgc"
29.87 mkfs.ext4: Could not allocate block in ext2 filesystem while populating file system

After:

#70 [sandbox-rootfs-image 7/7] RUN ... build-rootfs-image.sh /sandbox-rootfs /sandbox-rootfs.img
#70 33.42 e2fsck 1.47.0 (5-Feb-2023)
#70 34.05 resize2fs 1.47.0 (5-Feb-2023)
#70 34.18 Built ext4 rootfs image at /sandbox-rootfs.img (1.5G)
#70 DONE 34.4s

…ze, not allocated blocks (fixes mkfs.ext4 on ZFS data roots)
@papamoose papamoose changed the title docker/build-rootfs-image.sh: fix: size rootfs image from apparent si… docker/build-rootfs-image.sh: fix: size rootfs image from apparent size Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant