Hi - I'm searching for file system corruption tool, say it inject disk-errors like multiply owned blocks etc. Later an integrity scan process (like e2fsck) will verify on-disk layout and fix these errors. I'd like to read/understand such tools before writing one for an proprietary on-disk file system. Do we have such tools for ext{2,3,4}fs ? Thanks for any help or pointers! -- ---- Cheers, Lakshmipathi.G FOSS Programmer. www.giis.co.in -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/ext3-users/attachments/20140118/e4720acf/attachment.htm>
On 01/18/2014 07:13 AM, Lakshmipathi.G wrote:> Hi - > > I'm searching for file system corruption tool, say it inject disk-errors like > multiply owned blocks etc. Later an integrity scan process (like e2fsck) will > verify on-disk layout and fix these errors. > > I'd like to read/understand such tools before writing one for an proprietary > on-disk file system. > > Do we have such tools for ext{2,3,4}fs ? Thanks for any help or pointers! > >For s-ata drives, you can use hdparm to create a bad sector that will cause an IO error on read. (Write will fix it) Ric
We have a script that adds corruption to ext2/3/4 filesystems and runs e2fsck on it. It definitely could be improved, but it still catches some occasional errors: http://git.whamcloud.com/?p=tools/e2fsprogs.git;a=commit;h=aee44c669bebe29bfdb8a1c86da443234f8bc257 It tries to format the filesystem with different features and options, then adds corruption from both random data and copying parts of the filesystem internally to some other part of the filesystem. It might be useful to corrupt some random bits and bytes in the filesystem also, but it doesn't do that today. There is also fsfuzzer, which writes random data to the filesystem and tries to mount it, but I don't know if that has been tried with e2fsck. The other major question I have is why you are trying to create a new proprietary filesystem? That is really a ten year effort, and you would be much better off to use one of the many existing filesystems. If the current ones don't meet your exact needs, add the missing features you need instead of creating a whole new one from scratch. While I'm a big fan of ext4, there are many other good filesystems out there - XFS, Btrfs, ZFS, and several flash filesystems. Cheers, Andreas> On Jan 18, 2014, at 5:13, "Lakshmipathi.G" <lakshmipathi.g at gmail.com> wrote: > > Hi - > > I'm searching for file system corruption tool, say it inject disk-errors like > multiply owned blocks etc. Later an integrity scan process (like e2fsck) will > verify on-disk layout and fix these errors. > > I'd like to read/understand such tools before writing one for an proprietary > on-disk file system. > > Do we have such tools for ext{2,3,4}fs ? Thanks for any help or pointers! > > -- > ---- > Cheers, > Lakshmipathi.G > FOSS Programmer. > www.giis.co.in > _______________________________________________ > Ext3-users mailing list > Ext3-users at redhat.com > https://www.redhat.com/mailman/listinfo/ext3-users-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/ext3-users/attachments/20140118/e0e2699e/attachment.htm>
> For s-ata drives, you can use hdparm to create a bad sector that willcause an IO error on read. (Write will fix it) Thanks Ric Wheeler. Just looked into hdparm, it has nice option to corrupt sectors but I need to manipulate disk-entries also (like add invalid nlink value in an inode structure etc).> We have a script that adds corruption to ext2/3/4 filesystems and runs > e2fsck on it. It definitely could be improved, but it still catches someThanks Andreas. I was going the script, liked idea to create file system image based on random files. It has minimal option as now of. Will look into fsfuzzer.> The other major question I have is why you are trying to create a new > proprietary filesystem?Sorry, I should have been clearer. I was assigned with a task of creating a framework to corrupt disk-layout on an existing FreeBSD based closed source file system. We have e2fsck like integrity checker, but corrupting disk script needs to be added. Thanks! -- ---- Cheers, Lakshmipathi.G FOSS Programmer. www.giis.co.in