INJECT.F2FS(8)

πŸ“¦ version 1.17.0, in arch rolling

πŸ’Ύ inject.f2fs β€” like, the manual page, but make it make sense πŸ’…

okay bestie, so this is inject.f2fs, and it lives in section 8 of the System Manager's Manual (yes, the big scary admin one β€” don't be intimidated, you've got this 🫢).


✨ NAME ✨

inject.f2fs β€” inject a Linux F2FS file system


🌸 SYNOPSIS 🌸

inject.f2fs [ options ] device

πŸ¦‹ DESCRIPTION πŸ¦‹

So inject.f2fs is the tool you use to modify metadata β€” or data, like a directory entry β€” inside an f2fs file system image, offline, and super flexibly. That's the whole vibe. It's giving surgeon energy, but for file systems. πŸ”₯


πŸŽ€ OPTIONS πŸŽ€

  • -d debug level [default: 0] β€” sets how much debugging goodness you want. Specify the level of debugging options, that's it, that's the deal.
  • -V β€” prints the version number and then dips. Bye! πŸ‘‹
  • --mb member name β€” specifies the member name inside a struct that's getting injected. Basically: which field are we poking at, bestie.
  • --val new value β€” the new value to set, but only if mb is a number. Numbers only, no cap.
  • --str new string β€” the new string to set, if mb happens to be a string. Different vibe entirely.
  • --idx slot index β€” tells it which slot gets injected when mb is an array. Pick your fighter.
  • --nid nid β€” specifies which nid is getting injected.
  • --blk blkaddr β€” specifies which blkaddr is getting injected.
  • --sb 0 or 1 or 2 β€” injects the super block. The argument tells it which sb pack gets injected, and 0 chooses the current valid sb automatically (iconic, honestly β€” it just knows). The available mb of sb are:
    • magic β€” magic number.
    • s_stop_reason β€” s_stop_reason array.
    • s_errors β€” s_errors array.
    • feature β€” features.
    • devs.path β€” path in devs array.
  • --cp 0 or 1 or 2 β€” injects the checkpoint. The argument says which cp pack gets injected, and 0 chooses the current valid cp automatically. The available mb of cp are:
    • checkpoint_ver β€” checkpoint version.
    • ckpt_flags β€” checkpoint flags.
    • cur_node_segno β€” cur_node_segno array.
    • cur_node_blkoff β€” cur_node_blkoff array.
    • cur_data_segno β€” cur_data_segno array.
    • cur_data_blkoff β€” cur_data_blkoff array.
    • next_blkaddr β€” fsync dnodes.
    • alloc_type β€” alloc_type array.
    • crc β€” crc checksum.
    • elapsed_time β€” elapsed mount time.
  • --nat 0 or 1 or 2 β€” injects the nat entry specified by nid. The argument says which nat pack gets injected, and 0 chooses the current valid nat automatically. The available mb of nat are:
    • version β€” nat entry version.
    • ino β€” nat entry ino.
    • block_addr β€” nat entry block_addr.
  • --sit 0 or 1 or 2 β€” injects the sit entry specified by blk. The argument says which sit pack gets injected, and 0 chooses the current valid sit automatically. The available mb of sit are:
    • vblocks β€” sit entry vblocks.
    • valid_map β€” sit entry valid_map.
    • mtime β€” sit entry mtime.
  • --ssa β€” injects the summary block or summary entry specified by blk. The available mb of ssa are:
    • entry_type β€” summary block footer entry_type.
    • check_sum β€” summary block footer check_sum.
    • nid β€” summary entry nid.
    • version β€” summary entry version.
    • ofs_in_node β€” summary entry ofs_in_node.
  • --node β€” injects the node block specified by nid. The available mb of node are:
    • nid β€” node footer nid.
    • ino β€” node footer ino.
    • flag β€” node footer flag.
    • cp_ver β€” node footer cp_ver.
    • next_blkaddr β€” node footer next_blkaddr.
    • i_mode β€” inode i_mode.
    • i_advise β€” inode i_advise.
    • i_inline β€” inode i_inline.
    • i_links β€” inode i_links.
    • i_size β€” inode i_size.
    • i_blocks β€” inode i_blocks.
    • i_xattr_nid β€” inode i_xattr_nid.
    • i_ext.fofs β€” inode i_ext.fofs.
    • i_ext.blk_addr β€” inode i_ext.blk_addr.
    • i_ext.len β€” inode i_ext.len.
    • i_extra_isize β€” inode i_extra_isize.
    • i_inline_xattr_size β€” inode i_inline_xattr_size.
    • i_inode_checksum β€” inode i_inode_checksum.
    • i_compr_blocks β€” inode i_compr_blocks.
    • i_addr β€” inode i_addr array specified by idx.
    • i_nid β€” inode i_nid array specified by idx.
    • addr β€” {in}direct node nid/addr array specified by idx.
  • --dent β€” injects the dentry block or dir entry specified by nid.
    • --dots 1 or 2 β€” this one means the "." or ".." directory entry of nid is going to be injected. Cute, right? πŸŽ€

The available mb of dent are:

  • d_bitmap β€” dentry block d_bitmap.
  • d_hash β€” dentry hash.
  • d_ino β€” dentry ino.
  • d_ftype β€” dentry ftype.
  • filename β€” dentry filename, and the corresponding d_hash and namelen are updated implicitly. Sneaky but helpful. ✨
  • --dry-run β€” do not really inject. Look but don't touch, bestie. πŸ™ˆ
⚠️ heads up: this is an offline image-editing tool, and it is genuinely touching raw metadata β€” so --dry-run exists for a reason. Use it. πŸ‘‘

πŸ‘‘ AUTHOR πŸ‘‘

This version of inject.f2fs has been written by Sheng Yong <shengyong@oppo.com>. Shoutout to the author, fr fr. 🫢


🌈 AVAILABILITY 🌈

inject.f2fs is available from git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git. Go get it, it's right there. πŸ’œ


πŸ’– SEE ALSO πŸ’–

mkfs.f2fs(8), fsck.f2fs(8), dump.f2fs(8), defrag.f2fs(8), resize.f2fs(8), sload.f2fs(8), defrag.f2fs(8).

(yes, defrag.f2fs(8) is listed twice β€” that's the original's energy, not mine, I'm just the messenger 😭)


okay that's the whole page, no notes. πŸ’… this one's from f2fs-tools, printed under System Manager's Manual β€” mwah, slay, go inject something responsibly. πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from
  • arch rolling: f2fs-tools 1.17.0-1 Β· GPL-2.0-only AND (GPL-2.0-only OR LGPL-2.1-only)
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms