I am working on a embedded debian linux device. Owing to the power being pulled at any time resulting in a sudden power loss, we have set FSCKFIX from "no" to "yes" in the /etc/default/rcS file. Without this I have encountered errors where the system drops to a terminal waiting for the user (on a serial term) to manually run fsck to repair the disk (since the device has no terminal in normal operation this effectively bricks the box). Also the card has been made RO, being remounted RW as needed for updates, but that is not related to my problem I don't think.
I have been trying to make a unit test for this which will corrupt the sdcard, then we should be able to put the card back into the embedded device and it should repair and boot itself as normal.
Initially I have been only interested in reliably generating the failure I sometimes see with FSCKFIX=no, ie dropping to a terminal to fix the card manually via fsck. I tried the suggestions here and here, but those methods either make the card completely unbootable or seem to be ignored/fixed and the system boots normally without kicking me to a terminal to run fsck. So it seems I need to damage the disk in a very specific way to force fsck to need manual intervention with FSCKFIX=no. Can anyone tell me how to do this ????
Cheers.