On Thu, 2025-03-13 at 16:47 -0700, Dave Close wrote:
I have been trying to create an SDcard to use with an Raspberry Pi. The card is created using the rpi-imager program on Fedora (41) and that program reports the creation as successful. Later, after mounting the ext4 partition on the card under Fedora and doing two or three minutes of exploration, I encounter a bad block. So I unmount the partition and use e2fsck to locate any bad blocks and mark them:
e2fsck -y -c /dev/sdb2
But after that when I try to remount the partition, it seems that e2fsck has destroyed the filesystem!
If it failed during write, your e2fsck is just removing the bad sectors not magically repairing what ought to be there. You can only repair a filesystem if you can read failing data and replace it with undamaged data. And it sounds like the failures are in important places if that's happening.
You could have a cascading failure (not just static errors, but increasing ones). Some cards can self-repair, so you mightn't notice problems until the failures become severe, and external repair attempts could fight with internal ones.
A failing card is unreliable, it's not worth the grief.