cgsecurity / testdisk

TestDisk & PhotoRec
https://www.cgsecurity.org/
GNU General Public License v2.0
1.58k stars 195 forks source link

Photorec Recovery Output to FAT32 Destination Does Not Properly Handle Maximum Filesize #9

Open wesinator opened 8 years ago

wesinator commented 8 years ago

The maximum size for a single file in a FAT32 filesystem is 4294967295 bytes. It seems that if you are recovering files to a location formatted with this filesystem (such as a USB thumb drive), Photorec will not properly detect the maximum filesize limit.

I have noticed two things that seem to happen when a Photorec output file reaches the maximum FAT filesize:

The free space on the destination will continue to shrink even though the file has been maxed out, as if photorec continues allocating data to the filesystem without checking if the current file allocation is available and can still be written.

In some cases it seems as though Photorec will no longer find any more files to recover until the existing maxed file is deleted from the destination , even though there are still other files of that format to be recovered.

There should probably be a check done if the recovery destination is on a FAT32 filesystem so that a recovery stream stops when it reaches the maximum file size, and a warning is shown.

cgsecurity commented 8 years ago

PhotoRec 7.1-WIP for Windows is now compiled using cygwin instead of mingw, so it may have fixed this problem. Do you have the problem with latest 7.1-WIP ? Which version of PhotoRec (Linux, Windows 32-bit, Windows 64-bit...) are you using ?

wesinator commented 7 years ago

This was on Ubuntu 16.04 64-bit Linux with version 7.0-1.