---
name: "inject.f2fs"
section: "8"
platform: "linux"
package: "f2fs-tools"
version: "1.17.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/inject.f2fs"
---

# inject.f2fs(8)

inject a Linux F2FS file system

## NAME

inject.f2fs - inject a Linux F2FS file system

## SYNOPSIS

**inject.f2fs** \[ *options* \] *device*

## DESCRIPTION

**inject.f2fs** is used to modify metadata or data (directory entry) of f2fs file system image offline flexibly.

## OPTIONS

- **-d** *debug level \[default:0\]*

  Specify the level of debugging options.

- **-V**

  Print the version number and exit.

- **--mb** *member name*

  Specify the member name in a struct that is injected.

- **--val** *new value*

  New value to set if *mb* is a number.

- **--str** *new string*

  New string to set if *mb* is a string.

- **--idx** *slot index*

  Specify which slot is injected if *mb* is an array.

- **--nid** *nid*

  Specify which nid is injected.

- **--blk** *blkaddr*

  Specify which blkaddr is injected.

- **--sb** *0 or 1 or 2*

  Inject super block, its argument means which sb pack is injected, where 0 choses the current valid sb automatically. 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*

  Inject checkpoint, its argument means which cp pack is injected, where 0 choses 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*

  Inject nat entry specified by *nid*, its argument means which nat pack is injected, where 0 choses 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*

  Inject sit entry specified by *blk*, its argument means which sit pack is injected, where 0 choses 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**

  Inject 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**

  Inject 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**

  Inject dentry block or dir entry specified by *nid*.

  - **--dots** *1 or 2*

    The option means the "." or ".." directory entry of *nid* is going to be injected.

- 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 corresponding d\_hash and namelen are updated implicitly.

- **--dry-run**

  Do not really inject.

## AUTHOR

This version of **inject.f2fs** has been written by Sheng Yong \<shengyong@oppo.com\>.

## AVAILABILITY

**inject.f2fs** is available from git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git.

## SEE ALSO

**[mkfs.f2fs(8)](/mkfs.f2fs/8.md),** **[fsck.f2fs(8)](/fsck.f2fs/8.md),** **[dump.f2fs(8)](/dump.f2fs/8.md),** **[defrag.f2fs(8)](/defrag.f2fs/8.md),** **[resize.f2fs(8)](/resize.f2fs/8.md),** **[sload.f2fs(8)](/sload.f2fs/8.md),** **[defrag.f2fs(8)](/defrag.f2fs/8.md).**
