EXT3GREP(8)
β¨ NAME β¨
ext3grep β the ext3 file recovery tool, aka the thing you google at 3am after you hit delete and immediately regretted every choice you've ever made π
π«Ά SYNOPSIS π«Ά
ext3grep [OPTIONS] FILE ...
π DESCRIPTION π
okay so listen. ext3grep is a simple tool made for literally anyone who accidentally deletes a file on an ext3 filesystem and then, like, five seconds later, realizes they absolutely did want that file. we've all been there bestie. this is the recovery arc. π¦
π OPTIONS π
--superblockβ prints the contents of the superblock in addition to everything else. and if you didn't specify any action at all? then this option is just implied, no need to ask. β¨--printβ prints the contents of a block or an inode, if there's any to print.--lsβ prints directories, one line per entry. wanna filter that output? the FILTERS section below has the deets π--acceptFILE β accepts file as a legal filename. you can use this one multiple times, go off. β οΈ but heads up: if you change any--accept, you must remove BOTHstage*files! both of them. not one. both. π€--journalβ prints the contents of the journal.--show-path-inodesβ shows the inode of every single directory component in paths. the whole trail. π
π Filters:
--groupgid β only show/process files owned by process group gid.--directoryβ only show/process process directory inodes.--afterdtime β only show/process entries deleted on or after dtime.--beforedtime β only show/process entries deleted before dtime.--deletedβ only show/process deleted entries.--allocatedβ only show/process allocated inodes/blocks.--unallocatedβ only show/process unallocated inodes/blocks.--reallocatedβ does not suppress entries with reallocated inodes. an inode counts as 'reallocated' when the entry is deleted but the inode is allocated β and also when the file type in the dir entry and the inode are different. two ways to qualify, iconic behavior honestly.--zeroed-inodesβ does not suppress entries with zeroed inodes. linked entries get shown always, no matter what you do with this option. periodt.--depthdepth β processes directories recursively, going up till a depth of depth.
β‘ Actions:
--inode-to-blockinode_num β prints the block that contains inode inode_num.--inodeinode_num β shows info on inode inode_num. if you're also using--lsand the inode is a directory, then the filters apply to the entries of that directory. and if you don't use--ls? then--printis implied. π€--blockblock_num β shows info on block block_num. if you're also using--lsand the block is the first block of a directory, then the filters apply to entries of that directory. if you don't use--ls, then--printis implied. same deal as above, bestie.--histogram=[atime|ctime|mtime|dtime|group]β generates a histogram based on the given specs. usingatime,ctimeormtimewill change the meaning of--afterand--beforeto those times. π--journal-blockblock_num β shows info on journal block block_num.--journal-transactionseq β shows info on the transaction with sequence number seq.--dump-namesβ writes the paths of files to stdout. this implies--lsbut suppresses its output. lowkey sneaky, highkey useful.--search-startstr β finds blocks that start with the fixed string str.--searchstr β finds blocks that contain the fixed string str.--search-inodeblock_num β finds inodes that refer to block block_num.--search-zeroed-inodesβ returns allocated inode table entries that are zeroed.--inode-dirblock-tabledir β prints a table for directory path dir of directory block numbers found, and the inodes used for each file. π--show-journal-inodesinode_num β shows copies of inode inode_num that are still chillin' in the journal.--restore-filepath β will restore file path. path is relative to the root of the partition and does not start with a/β it has to be one of the paths returned by--dump-names. the restored directory, file or symbolic link gets created in the current directory as./path. π«Ά--restore-allβ same as--restore-filebut it attempts to restore everything. using--afteris highly recommended, because trying to restore super old files will only result in them getting hard linked to a more recently deleted file, and that just pollutes the output. messy. don't do that to yourself. π--show-hardlinksβ shows all inodes that are shared by two or more files.--version,-[vV]β prints the version information and exits.--helpβ prints a help message and exits.
π EXAMPLES π
restoring all the files from the ext3 partition/file /backup/sda1:
ext3grep --restore-all /backup/sda1
listing the files owned by GID 1000 on /backup/sda1:
ext3grep --ls --group 1000 /backup/sda1
finding all files containing the string Critical_report in their name on /backup/sda1:
ext3grep --dump-names /backup/sda1 | grep 'Critical_report'
π LIMITATIONS π
do NOT attempt to use ext3grep for recovery from a mounted filesystem.
Ever.
no, not even then. π
ext3grepsometimes runs out of memory spare on 32-bit architectures and crashes. it is highly recommended that you runext3grepin a 64-bit environment when you're dealing with large filesystems β though this is seen as a bug. π
ext3grep cannot recover files if there are no remnants of them. no remnants, no recovery, that's just how it is bestie. π§
some files that ext3grep recovers may have trailing null bytes β just scrape them off like the burnt bits on toast. π
π₯ SEE ALSO π₯
π AUTHOR π
ext3grep was written by Carlo Wood <carlo@alinoe.com>.
this manual page was written by Rich Ercolani <rercola@acm.jhu.edu>, for the Debian project (but it may be used by others). it may be distributed under the same terms as ext3grep, the GNU General Public License, either version 2 or (at your option) any later version. β
and that's the whole page, bestie β this was version 0.8.0, dated 2008-09-14, and honestly? she ate. π β¨π¦
π¦ where this page comes from
- debian bookworm: ext3grep 0.10.2-5 Β· GPL-2.0-or-later
- debian trixie: ext3grep 0.10.2-6 Β· GPL-2.0-or-later
- ubuntu jammy: ext3grep 0.10.2-5 Β· GPL-2.0-or-later
- ubuntu noble: ext3grep 0.10.2-5 Β· GPL-2.0-or-later
- ubuntu questing: ext3grep 0.10.2-6
- ubuntu resolute: ext3grep 0.10.2-6build1 Β· GPL-2.0-or-later
- ubuntu stonking: ext3grep 0.10.2-6build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms