jfs_fsck
Check and repair JFS filesystems
SYNOPSIS
jfs_fsck [-p] [-f] [-n] [-y] [-v] [-b blocksize] [-j journal_dev] [-J journal_addr] [-d] device
PARAMETERS
-b blocksize
Specify filesystem block size (default auto-detect)
-d
Dump debugging info to jfsdebug.log
-f
Force check even if filesystem marked clean
-j journal_dev
External journal device
-J journal_addr
Starting address of external journal
-n
Open read-only; no modifications
-p
Automatic (preen) repair without prompts
-v
Verbose output
-y
Assume yes to all repair prompts
DESCRIPTION
jfs_fsck is the filesystem consistency checker for the Journaled File System (JFS), originally developed by IBM for AIX and ported to Linux. It scans the filesystem structure on a specified device, verifies metadata integrity including inodes, directories, block allocation maps, and journal logs, and repairs detected inconsistencies.
Like other fsck variants, it is typically run during boot if the filesystem is marked dirty or manually on unmounted filesystems. JFS's journaling ensures quick recovery from crashes by replaying log transactions. jfs_fsck can perform forward recovery using the journal, validate extents, fix bad blocks, and reconstruct allocation structures.
In automatic mode, it prompts for repairs unless using preen (-p) or yes (-y) flags. Verbose output aids diagnosis. It supports external journals for multi-device setups. Always unmount the filesystem first and backup data, as repairs can lead to data loss in severe cases. Essential for JFS maintenance on Linux systems using this enterprise-grade filesystem.
CAVEATS
Always unmount filesystem before use; backup data first as repairs may cause loss. Not for mounted filesystems. Run as root. May require multiple passes for complex errors.
EXIT CODES
0: no errors; 1: repaired; 2: damaged, manual fix needed; 4: errors left; 8: operational error; 16: usage error; 32: syntax error
JOURNAL RECOVERY
Automatically replays commit records from external or inline journal during check
HISTORY
Developed by IBM for OS/2 and AIX in 1990s; Linux port by IBM, Steve Best et al. in 2001. Maintained in jfsutils package; stable since kernel 2.4 integration.
SEE ALSO
fsck(8), mkfs.jfs(8), jfs_tune(8), jfs_logdump(8), jfs_debugfs(8)


