cgsecurity / testdisk

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

Photorec Does Not Stop or Show Any Errors If Target Drive Gets Detached #18

Open wesinator opened 7 years ago

wesinator commented 7 years ago
Version: 7.0
Compiler: GCC 5.3
ext2fs lib: 1.42.13, ntfs lib: libntfs-3g, ewf lib: none, libjpeg: libjpeg-turbo-1.4.2, curses lib: ncurses 6.0
OS: Linux, kernel 4.4.0-53-generic (#74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016) x86_64

While scanning an external drive mounted as /dev/sdc (Whole disk), the drive got detached from the operating system and the device path was removed. The Photorec output continued on as if nothing had happened even though the target disk and its device path were removed.

Expected it to have shown an error and halted the scan upon the target drive being detached from the computer.

cgsecurity commented 7 years ago

For Linux/Unix, it should be possible to stat the device to check if it's still existing.