Repository navigation
feat(ext4): create jbd2-journaled images - #13
Merged
Merged
Conversation
Every image of at least 8 MiB now carries a jbd2 journal, as mke2fs writes one, so the guest kernel recovers a crashed VM by replaying the journal on mount instead of needing e2fsprogs in the guest. The journal is created once by the constructors and never touched again: the builder never replays or checkpoints; the kernel is the only writer after create. The on-disk form mirrors mke2fs: inode 8, mode 0600, extent-mapped contiguous blocks sized by ext2fs_default_journal_size (4 MiB under 128 MiB, a growing ladder above; verified against mke2fs at 64 MiB and 256 MiB), a v2 journal superblock with big-endian fields and no checksum features, s_journal_inum = 8, and the s_jnl_blocks[17] backup with s_jnl_backup_type set. reserve_inodes now skips already- allocated low inodes so inode 8 is not double-counted. The sizing estimate adds the journal so recommended images have room for tree plus journal. Assisted-by: Claude Code: GLM 5.3 Assisted-by: Claude Code: Opus 5.5 Signed-off-by: Luca Stocchi <lstocchi@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every image of at least 8 MiB now carries a jbd2 journal, as mke2fs writes one, so the guest kernel recovers a crashed VM by replaying the journal on mount instead of needing e2fsprogs in the guest. The journal is created once by the constructors and never touched again: the builder never replays or checkpoints; the kernel is the only writer after create.
The on-disk form mirrors mke2fs: inode 8, mode 0600, extent-mapped contiguous blocks sized by ext2fs_default_journal_size (4 MiB under 128 MiB, a growing ladder above; verified against mke2fs at 64 MiB and 256 MiB), a v2 journal superblock with big-endian fields and no checksum features, s_journal_inum = 8, and the s_jnl_blocks[17] backup with s_jnl_backup_type set. reserve_inodes now skips already- allocated low inodes so inode 8 is not double-counted. The sizing estimate adds the journal so recommended images have room for tree plus journal.
this resolves #5