Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

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

4 Answers 4

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'

share|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

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

share|improve this answer

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

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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