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

Not enough space on connected USB drive when recovering (Windows Version, ophotorec) #99

Open
leotulipan opened this issue Apr 23, 2021 · 4 comments

Comments

@leotulipan
Copy link

Latest pre-compiled Win x64 Version-

Restoring to a standard (FAT32) External empty 512GB HDD from the local 2568GB SSD in Win10

I get "There is not enough space left! Please free disk space and/or choose another destination"

which is related to PSTATUS_ENOSPC switch/case here
https://github.com/cgsecurity/testdisk/blob/master/src/qphotorec.cpp
https://github.com/cgsecurity/testdisk/blame/master/src/phrecn.c

It might be related to the old open issue #9

image

as I only selected doc, pdf and zip as the file options I am guessing some >4GB zip/tmp file is being written and I cannot skip this part.

  • Is there any option to skip such a file?
  • Is there a switch to only restore files < 20MB as I am not interested in the large ones (but I need ZIP to get back small lost DOCX and XLSX files)
  • I know that maybe reformatting the external drive to NTFS might help with file size limits, but still for me this counts as a bug as there is ample space and a bit more info in the popup might also help in debugging this issue
@cgsecurity
Copy link
Owner

https://github.com/cgsecurity/testdisk_documentation/blob/master/photorec.rst now contains
"Avoid choosing a FAT32 filesystem for the destination as it doesn't handle file over 4 GB.".
See https://www.cgsecurity.org/testdisk.pdf for the generated pdf

I don't plan to implement customizable file size limits.

What do you suggest to replace "There is not enough space left! Please free disk space and/or choose another destination" ?
""There is not enough space left! Please free disk space and/or choose another destination (Avoid FAT32)" ?

@leotulipan
Copy link
Author

Thanks for the prompt reply Christophe,

let me start by saying I really appreciate the software and was already able to rescue a lot of data!

As more and more less tech-savvy people start using tools like this, and as external USB HDD are often pre-formatted FAT this is a real issue and was even confusing to me. If I had used an (internal) drive with ext4 on Linux I wouldn't have even noticed.

I am not a C programmer (html, js, php mostly), so excuse for only giving suggestions and not offering a PR

  • Idea 1 Before starting: Check the filesystem of the selected destination and offer the "4GB FAT" warning at selection when the user presses "c" for current directory
  • Idea 2 Show the filesize (and extension/file group it belongs to) in human readable form (K/M/G bytes) that failed to save.
  • Idea 3: You could add "Note: If you are restoring to a FAT/FAT32 filesystem, files larger than 4GB cannot be saved. See FAQ for more"
  • Idea 4: Manage that text string centrally, so the response is the same in ophotorec, phrenc (and possible testdisk) for that error
    log_critical("Cannot write to file %s: %s\n", file_recovery.filename, strerror(errno));

    case PSTATUS_ENOSPC:

    https://github.com/cgsecurity/testdisk/blob/master/src/qphotorec.cpp#L858

@leotulipan
Copy link
Author

@cgsecurity I just retried the steps - this time with an NTFS formatted 65GB drive.
After the restore of 207 files (about 1GB) it hangs again with not enough space?
Any idea why this happens (latest 64bit version of photorec under win10 was used)

@LMG7
Copy link

LMG7 commented Jul 16, 2021

@leotulipan were you able to find a solution? I and using a NTFS HDD and am getting the same message :/

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

No branches or pull requests

3 participants