Skip to content

Traverse ext4 file sytem and restore deleted files

Notifications You must be signed in to change notification settings

niemandkun/pyext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pyext v0.0-prealpha2

Pyext allows to open Ext4 image, traverse directories tree and restore deleted files. For more info about Ext4 and how it works see Ext4 page at Ext Wiki.

Launch shell

Run in terminal: python3 pyext.py PATH_TO_IMAGE to launch shell. You should have Python 3.4 or greater to be installed. No additional dependencies are required.

To get help in pyext shell:

  • Enter help to see a list of all available commands.
  • Enter help [command] to get detailed help about command.

Restore files

To restore deleted files run python pyext.py --restore PATH_TO_IMAGE. To specify output directory where rescued files will be stored use --output PATH_TO_RESTORED or -o PATH_TO_RESTORED. All files that script can restore will be saved to this directory. Pyext can not restore original file name for deleted files, therefore it uses deletion time as filename. So, you can find your file content by the time when file was deleted from disk.

Tests

To run tests enter in terminal: python3 run_tests.py To check code coverage, you can use coverage tool:

coverage run run_tests.py
coverage report

Shell commands

  • cd - change working directory
  • ls - print directory content
  • cat - print file content
  • stat - print filesystem or file info
  • help - print help
  • exit - close shell and exit

cd

usage: cd [directory]

Change current working directory. If no arguments given, change working directory to /.

ls

usage: ls [directory]

List all entries in directory. Same as *nix's ls.

cat

usage: cat [file]

Print content of file. It will try to read file as utf-8 encoded by default. If it fails, file will be shown as a byte stream.

stat

usage: stat [file]

Print file status. If no arguments given, display file system info.

help

usage: help [command]

Print help for command. If no arguments given, shows all available commands.

exit

usage: exit

Close pyext and return to system shell.

About

Traverse ext4 file sytem and restore deleted files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages