For some weird reason, updating Raspberry Pi OS keeps breaking my system. For the second time since setting up my Raspberry Pi 4 (8GB RAM), my microSD card has been corrupted and cannot run the OS. When this happened last time, I was able to format the SD card and reinstall the OS. However, the same thing has happened again today. Both times, this issue came up after installing updates to Pi OS and shutting down the system. Has this happened to anyone else? If yes, how did you fix the problem? Is the only solution simply to stop updating Pi OS until the issue gets resolved?
"Updating" is not breaking your system. Your comment,
It's an old, 16GB microSD card I had lying around reveals the most likely source of your problem. It's well-known and extensively documented that there is a wearout mechanism associated with SD media. Wear leveling is a technique to mitigate wearout, but it is not uniformly implemented.
Consequently, all SD cards should be considered perishable - and some perish more quickly than others. This is likely due to the fact that wear leveling is not required by the SD Association - at least not for all device classes - instead this is left as a marketing decision for each individual manufacturer.
I'm always reluctant to plug a specific manufacturer, but I will say that in my personal experience I cannot recall a single failure of a SanDisk brand flash memory card. I am sure there are other reliable brands, but I cannot name them.
If you're committed to using your present card, you may find this memory card formatter from the SD card association useful - here's a link to download it. You may also consider running
fsck in an effort to diagnose & repair your existing SD card. Here's a detailed procedure for running
fsck - you can even run this procedure on your Raspberry Pi after you've installed a reliable SD card :)