I need to corrupt ext3 file system (for testing purposes) to some repairable state. How that can be done?

link|improve this question
1  
How repairable do you want it? All data recoverable, or just back to a functional filesystem? – DerfK Feb 1 '11 at 13:53
feedback

4 Answers

up vote 2 down vote accepted

'mkswap /dev/ext3_dev' or 'dd if=/dev/zerro of=/dev/ext3_dev bs=1024 skip=1000 count=300'

link|improve this answer
if=/dev/null won't do as much as /dev/zero – poige Feb 1 '11 at 13:06
of course /dev/zerro – alvosu Feb 1 '11 at 13:24
feedback

Well, create ext3 on lvm and shrink lvm, mkfs.ext3 without umounting, some lowlevel tool to delete inodes...

link|improve this answer
feedback

I'd write simple C-program for that doing a number of random seeks & destroy.

link|improve this answer
feedback

How about just 'fsck' the filesystem while it is mounted, and you are writing some thing to it. This should work pretty consistently.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.