LinuxCommandLibrary

reiserfsck

Check and repair ReiserFS filesystems

SYNOPSIS

reiserfsck [options] device
reiserfsck [--check | --fix-fixable | --rebuild-tree | --rebuild-sb | --journal-reset] [options] device

PARAMETERS

-a, --auto-check
    Automatically fix fixable problems without asking for user confirmation.

-f, --force
    Force checking even if the file system is marked clean or mounted. Use with extreme caution.

-r, --rebuild-tree
    Rebuild the entire file system tree from scratch. This is a drastic, potentially data-losing operation used for severely corrupted file systems.

-y
    Assume 'yes' to all questions asked by reiserfsck.

-n
    Assume 'no' to all questions asked by reiserfsck.

--check
    Perform a consistency check only; do not attempt to fix any errors found.

--fix-fixable
    Fix problems that are not structural and are considered safe to correct automatically.

--journal-reset
    Reset the file system journal. Use with caution as it can lead to data loss if the file system was not cleanly unmounted.

--rebuild-sb
    Rebuild the superblock of the file system. Use when the superblock is corrupted.

--scan-devices
    Scan all block devices for ReiserFS partitions. Requires root privileges.

--check-lost-found
    Check and clean up entries in the lost+found directory.

--clean-attributes
    Cleans unknown or corrupted file system attributes.

-p
    Display a progress bar during the operation.

-j JOURNAL_DEVICE, --journal-dev JOURNAL_DEVICE
    Specify an external journal device if the ReiserFS file system uses one.

-o SB_OFFSET, --offset SB_OFFSET
    Specify the offset to the superblock in cases where it's not at the default location.

DESCRIPTION

reiserfsck is a utility designed to check and repair ReiserFS file systems. It is an essential tool for maintaining the integrity of ReiserFS volumes, especially after an improper shutdown, power failure, or system crash. The command works by analyzing the file system's metadata, tree structure, and journal to detect and correct inconsistencies, lost blocks, and other errors that could lead to data corruption. It can be used in different modes, ranging from a simple check to an interactive repair process. While ReiserFS is less common in modern Linux distributions compared to ext4 or XFS, reiserfsck remains crucial for systems still utilizing this file system. It's generally recommended to unmount the file system before running reiserfsck to ensure data consistency and prevent further damage during the repair process.

CAVEATS

Always unmount the ReiserFS file system before running reiserfsck, especially for repair operations. Running on a mounted file system can lead to severe data corruption and loss.
The --rebuild-tree option is a very destructive operation and should only be used as a last resort when the file system is heavily corrupted. It can result in significant data loss.
It's highly recommended to back up critical data before attempting any repair operation with reiserfsck.
ReiserFS is an older file system; consider migrating to a more modern and actively maintained file system like ext4 or XFS if possible, as development on ReiserFS has largely ceased.

EXIT CODES

reiserfsck typically returns an exit code indicating the result of its operation:
0: No errors found.
1: File system errors corrected.
2: File system errors, but system should be rebooted to fully apply corrections.
4: File system errors uncorrected, requiring manual intervention.
8: Operational error during reiserfsck execution.

USAGE CONTEXT

reiserfsck is often run automatically by the generic fsck utility at boot time if a ReiserFS partition is detected and marked as 'dirty' (e.g., after an unclean shutdown). It can also be invoked manually for proactive checks or emergency repairs on unmounted ReiserFS volumes.

HISTORY

ReiserFS was developed by Hans Reiser and his company Namesys, first released in 2001. It was notable for being the first journaling file system to be included in the Linux kernel mainline. reiserfsck is the accompanying utility for checking and repairing ReiserFS file systems.
While initially gaining some popularity, its adoption waned, particularly after the development of ext3/ext4 and XFS, and due to the legal issues involving Hans Reiser. Development on ReiserFS largely ceased, making reiserfsck an older tool for a legacy file system, though still essential for those systems that continue to use ReiserFS.

SEE ALSO

fsck(8), mount(8), umount(8), mkfs.reiserfs(8), debugreiserfs(8)

Copied to clipboard