Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FUSE Support #72

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

FUSE Support #72

wants to merge 11 commits into from

Conversation

Maxqia
Copy link
Contributor

@Maxqia Maxqia commented Mar 9, 2020

Unix has a great variety of tools that work on directories and I think it would be best if I could just mount my partitions directly and use already existing tools like QDirStat, find, and rsync to find and recover all of the files I need.

Right now it works okay, but definitely needs some polish.
TODO

  • directory listing
  • full reads
  • partial reads
  • fix permissions (x)
  • file name conflicts?
  • handle case of not having fusepy installed
  • consider fuse low level api instead? (x)
  • cli documentation
  • clean print statements
  • import ordering? is that a thing?
  • port to python3 and python-fuse
  • test on corrupted disk images
  • does it eat memory? probably should check

If you're going to be working on this or have suggestions, let me know.

@Lazza
Copy link
Owner

Lazza commented Feb 7, 2021

I am afraid that this would require to edit also other classes in the future, if support for file systems other than NTFS is added.

Would it be possible to integrate a "basic" FUSE layer on top of the generic RecuperaBit data structures?

I guess this would be a bit problematic for the partial reads, maybe a specific method for that would be needed.

Also, it seems that the logging is being replaced with exceptions that would break the mass recovery if one file has problems. Do I understand it correctly?

@Maxqia
Copy link
Contributor Author

Maxqia commented Feb 7, 2021

Hello!
The fuse code mainly tries to stick within the existing data structures.
The main change outside of the new fuse code is that I split get_content() in the File class into the functions open(), close(), and read().
I think these would be reasonable functions to implement in any new filesystem implementation.
I overlooked the exceptions problem, I'd probably need to implement better error handling in new get_content() function.
I used exceptions because I wanted FUSE to give a I/O error when RecuperaBit couldn't read a file.
Thanks for the feedback!

@mirh
Copy link

mirh commented Feb 20, 2021

Unix has a great variety of tools that work on directories and I think it would be best if I could just mount my partitions directly and use already existing tools

And why would FUSE be needed for that?
Or better yet: isn't FUSE awful for performance?

@Lazza
Copy link
Owner

Lazza commented Feb 21, 2021

Thanks for the feedback!

Thank you for contributing this idea and parts of an implementation. Actually, sorry for taking long to give the feedback.

I used exceptions because I wanted FUSE to give a I/O error when RecuperaBit couldn't read a file.

In theory, RecuperaBit should not crash or give errors if it can't read a file, it should be transparent (e.g. by truncating it).

Anyhow, I think the FUSE implementation might be a good addition, similar to what is found in Disk Drill or other tools. However, given that there are some other issues with the program (mainly performance, save file management and TUI) to be fixed first, I'd wait before trying to merge any of this in the code.

@Maxqia Maxqia changed the title WIP: FUSE Support FUSE Support Feb 26, 2021
@Maxqia
Copy link
Contributor Author

Maxqia commented Feb 26, 2021

Hey, it should be pretty much done now. I don't have any way of testing the code fully right now, but it works with a non-corrupted NTFS partition.

@Lazza
Copy link
Owner

Lazza commented Mar 15, 2021

Thanks for all this work! I'll need to find the time to review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants