File Recovery – Why Deleted Files Are Not Actually Deleted from Hard Drive

file-recovery

From an article on file recovery I read, that when a file is deleted on your computer, only a pointer to the file is deleted and the space occupied by the file is marked as free to use. Is the only reason for this to recover "deleted" files or are there any other reasons why the space occupied isn't actually deleted (bits set to zero)?

Best Answer

The reason to prefer unlinking instead of zeroing a file is performance. It's far easier to simply zero a variable in the filesystem data structre rather than start overwriting an entire file. In modern filesystems unlinking the file takes a constant amount of time regardless of file size, whereas the time spent overwriting a file is proportional to file size.