e2undo - Linux


e2undo is a powerful command-line tool that allows users to undo or restore changes made to Ext2 or Ext3 filesystems. It provides a mechanism to recover from accidental deletions, modifications, or other data loss situations.


e2undo [-backup-file <file>] [-blocksize <size>] [-c|-d] [-f] [-n] [-u] [<device> | <filesystem>]


  • -backup-file : Specifies the backup file to restore from.
  • -blocksize : Sets the block size for the filesystem.
  • -c: Checks the integrity of the filesystem and undoes any invalid changes without writing back to the device.
  • -d: Does a dry run and shows the changes that would be made without actually performing them.
  • -f: Forces the operation even if there are errors.
  • -n: Turns off journal checking.
  • -u: Undoes the last undo operation.


Undo a recent deletion:

e2undo /dev/sda1

Restore from a backup file:

e2undo -backup-file ~/backups/ext2.img /dev/sdb1

Check filesystem integrity without making changes:

e2undo -c /dev/sdc1

Dry run to preview changes:

e2undo -d /dev/sdd1

Common Issues

  • Error: fsck failed with exit code: This can occur if the filesystem is corrupted beyond repair. Try using fsck to attempt repairs.
  • Error: Backup file not found: Ensure the specified backup file exists and is accessible.
  • Error: Device not found: Verify that the specified device or filesystem is accessible.


Merge with findfs command:

findfs -bce | xargs -n1 e2undo -c

This command chain checks the integrity of all Ext2/Ext3 filesystems on the system.

Related Commands

  • fsck: Repairs filesystem errors.
  • dumpe2fs: Dumps filesystem metadata.
  • mke2fs: Creates a new Ext2/Ext3 filesystem.