7

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

4 Answers4

2

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

alvosu
  • 8,595
0

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

Ency
  • 1,271
0

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

poige
  • 9,730
  • 3
  • 28
  • 53
0

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

slashdot
  • 651