I need to corrupt ext3 file system (for testing purposes) to some repairable state. How that can be done?
Asked
Active
Viewed 3,259 times
7
-
3How repairable do you want it? All data recoverable, or just back to a functional filesystem? – DerfK Feb 01 '11 at 13:53
-
Also see the other answers on http://stackoverflow.com/questions/140253/how-can-i-simulate-ext3-filesystem-corruption . – Anon Dec 10 '16 at 07:46
4 Answers
2
'mkswap /dev/ext3_dev' or 'dd if=/dev/zerro of=/dev/ext3_dev bs=1024 skip=1000 count=300'
alvosu
- 8,357
- 24
- 22
0
Well, create ext3 on lvm and shrink lvm, mkfs.ext3 without umounting, some lowlevel tool to delete inodes...
Ency
- 1,201
- 1
- 19
- 26
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
- 5
- 7