pmb.install.format: set bytes-per-inode to 16384 (MR 2558)

After setting "-T big", we still saw some images failing with "out of
space" errors in bpo, such as "v24.12:samsung-espresso10:xfce4".

I've looked at /etc/mke2fs.conf to figure out what exactly gets
configured with "-T big". What I did not realize is that the inode
ratio gets bigger by going from small -> big, big -> huge, but with a
larger ratio FEWER inodes will be created (see man mkfs.ext4, -i
bytes-per-inode).

In /etc/mke2fs.conf in Alpine edge:

	[defaults]
	…
		blocksize = 4096
		inode_size = 256
		inode_ratio = 16384

	[fs_types]
	…
		small = {
			blocksize = 1024
			inode_ratio = 4096
		}
		floppy = {
			blocksize = 1024
			inode_ratio = 8192
		}
		big = {
			inode_ratio = 32768
		}
		huge = {
			inode_ratio = 65536
		}
		news = {
			inode_ratio = 4096
		}
	…

So I've tried out half the ratio value we get with "big" now, 16384.
With that we finally seem to have:

* Enough inodes for small UIs (console, none) as well as big UIs with
  lots of files (xfce4, plasma-desktop, ...)

* We don't directly specify an inode count (-N) anymore as we did
  earlier, which had problems with small images as the inode count would
  be too large for the given image size (pmb#2572).

Test builds with various images:

Filesystem              Inodes      Used Available Use% Mounted on
master:postmarketos-trailblazer:none:
/dev/installp2           35440      5111     30329  14% /mnt/install
master:postmarketos-trailblazer:console:
/dev/installp2           47232      8713     38519  18% /mnt/install
master:pine64-pinebookpro:plasma-desktop:
/dev/installp2          276352    100607    175745  36% /mnt/install
v24.12:samsung-espresso10:xfce4:
/dev/installp2           80960     51150     29810  63% /mnt/install

So the most Use% I could get is 63% with this, leaving a nice margin for
the future.
This commit is contained in:
Oliver Smith 2025-02-23 13:24:01 +01:00
parent 06957b2173
commit d90a037fd6
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -161,9 +161,9 @@ def format_and_mount_root(
# recovery zip code (see 'grep -r mkfs\.ext4')! # recovery zip code (see 'grep -r mkfs\.ext4')!
mkfs_root_args = ["mkfs.ext4", "-O", "^metadata_csum", "-F", "-q", "-L", root_label] mkfs_root_args = ["mkfs.ext4", "-O", "^metadata_csum", "-F", "-q", "-L", root_label]
if not disk: if not disk:
# pmb#2568: tell mkfs.ext4 to make a "big" filesystem with # pmb#2568: tell mkfs.ext4 to make a filesystem with enough
# enough indoes that we don't run into "out of space" errors # indoes that we don't run into "out of space" errors
mkfs_root_args = [*mkfs_root_args, "-T", "big"] mkfs_root_args = [*mkfs_root_args, "-i", "16384"]
elif filesystem == "f2fs": elif filesystem == "f2fs":
mkfs_root_args = ["mkfs.f2fs", "-f", "-l", root_label] mkfs_root_args = ["mkfs.f2fs", "-f", "-l", root_label]
elif filesystem == "btrfs": elif filesystem == "btrfs":