From d90a037fd6a8ed007cad9bc048a75764135d5682 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sun, 23 Feb 2025 13:24:01 +0100 Subject: [PATCH] pmb.install.format: set bytes-per-inode to 16384 (MR 2558) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- pmb/install/format.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmb/install/format.py b/pmb/install/format.py index ef59cd0e..9573ba1f 100644 --- a/pmb/install/format.py +++ b/pmb/install/format.py @@ -161,9 +161,9 @@ def format_and_mount_root( # recovery zip code (see 'grep -r mkfs\.ext4')! mkfs_root_args = ["mkfs.ext4", "-O", "^metadata_csum", "-F", "-q", "-L", root_label] if not disk: - # pmb#2568: tell mkfs.ext4 to make a "big" filesystem with - # enough indoes that we don't run into "out of space" errors - mkfs_root_args = [*mkfs_root_args, "-T", "big"] + # pmb#2568: tell mkfs.ext4 to make a filesystem with enough + # indoes that we don't run into "out of space" errors + mkfs_root_args = [*mkfs_root_args, "-i", "16384"] elif filesystem == "f2fs": mkfs_root_args = ["mkfs.f2fs", "-f", "-l", root_label] elif filesystem == "btrfs":