Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intentionally corrupt the file system

Tags:

windows

ntfs

I have to explicitly test the case what my application does if it tries to access some corrupted part of an NTFS file system. I looked around for similar questions but those were about corrupting specific files (i.e. destroy the syntax of an xml file, etc).

I need to create a scenario where chkdsk would report errors in the file system in a specific location.

Does anybody have any idea how I could provoke such a situation to test my application.

Just in case you worry: I wouldn't do that on my production system, I have a VM set up for things like that.

like image 236
klaustopher Avatar asked Nov 28 '11 13:11

klaustopher


People also ask

How do I corrupt a file intentionally?

How to corrupt a file on purpose so it won't open? You can corrupt a Word file or other types of files by renaming, using Notepad, online file corrupter, and file compression tool. If you have mistakenly damaged files that you actually need, use EaseUS file repair tool to fix the damaged files instantly.

What can corrupt a file system?

Filesystems can be corrupted due to unexpected power loss, system crashes and unsafe removal of the drive. After such an incident it is recommended to repair or at least check the filesystem to prevent future data loss. Sometimes a repair is required in order to mount or modify a filesystem.

What causes file system corruption?

File corruption usually happens when there is an issue during the 'save' process. If your computer crashes the file being saved will likely be corrupted. Another cause might be damaged sections of your hard drive or storage media that might have viruses and malware.

What does it mean to corrupt a file?

A data or program file that has been altered accidentally by hardware or software failure or on purpose by an attacker. Because the bits are rearranged, a corrupted file is either unreadable to the hardware or, if readable, indecipherable to the software.


1 Answers

If the concern is about what your app would do when encountering corrupt files, then why bother corrupting the filesystem that contains the files? Why not simply corrupt the files themselves?

The operating system does a lot to ensure that filesystems are robust, I'm not sure that intentionally scribbling garbage on the file system will do anything other than fuzz test the filesystem implementation.

like image 147
ReinstateMonica Larry Osterman Avatar answered Sep 28 '22 05:09

ReinstateMonica Larry Osterman