apple/containerization

[Bug]: Support a partial last block group to avoid expanding the EXT4 filesystem size

Open

#647 geöffnet am 3. Apr. 2026

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (1 zugewiesene Person)Swift (278 Forks)batch import
help wanted

Repository-Metriken

Stars
 (8.542 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 9T 15h) (21 gemergte PRs in 30 T)

Beschreibung

I have done the following

  • I have searched the existing issues
  • If possible, I've reproduced the issue using the 'main' branch of this project

Steps to reproduce

Create an EXT4 filesystem with 160 MiB:

container volume create -s 160M size-test
stat -f%z ~/Library/Application\ Support/com.apple.container/volumes/size-test/volume.img

Current behavior

When creating an EXT4 filesystem, the requested size is expanded to the nearest block group boundary. A filesystem whose requested size falls between two block group boundaries ends up larger than requested - 256 MiB:

268435456

Expected behavior

The fix is to support a partial last block group so the filesystem uses exactly the requested size - 160 MiB:

167772160

Environment

N/A

Relevant log output

N/A

Code of Conduct

  • I agree to follow this project's Code of Conduct

Related to https://github.com/apple/containerization/pull/640.

Contributor Guide