Welcome to the Power Users community on Codidact!
Power Users is a Q&A site for questions about the usage of computer software and hardware. We are still a small site and would like to grow, so please consider joining our community. We are looking forward to your questions and answers; they are the building blocks of a repository of knowledge we are building together.
Why can't I change any data on this micro SD card or format it?
I have an old microSD card that I'm trying to wipe. I've backed up all the files to somewhere else, and now I'm trying to clear the card.
However, I can't seem to change anything on the card.
When I plug it into my computer, I can move around files and delete them normally — or, you'd think so, at first glance. The changes last as long as I have the card plugged in, but as soon as I eject it and check it again, all the changes I've made have reverted themselves.
This started happening while I was sorting files on the card; at some point, the changes just stopped applying after I ejected the card. The files were moving and being saved in their new spots, and then all of a sudden writing to the card stopped taking.
When trying to delete the files, I also noticed something else odd happening. I'm pretty sure I don't have 1.8 billion files on the card:
Checking the properties of the card, there are 6,116 files on the card.
Since just deleting the files from the file manager system didn't seem to be working, I went to try to format the disk. I selected "wipe", and it warned me that it would delete all data on the disk:
Interestingly, here it says the card is using 24 GB, whereas when I checked the properties in the file manager it said 15.4 GB was used.
And, then, when I confirm that I want to wipe it, I run into an error:
What is going on with this SD card? Why can I read data from it, but not be able to delete files or format the card? (I've confirmed that the card does not have a physical lock.) What does the "Failed to probe the device '/dev/sda' (udisks-error-quark, 0)" error mean?
I'm running Ubuntu 22.04.2, and I'm using an SD-to-USB adapter since my computer doesn't have an SD card (or micro SD card) slot. I've confirmed that I can write to other cards with the same adapter.
The SD card in question is a generic "Mixza" microSD card.
How can I wipe this card, short of physically destroying it?
1 answer
When the controller of a flash medium detects a problem it often goes read only. This is a defence mechanism so that it preserves your data and prevents any further deterioration in the flash by further writes. For example, the controller may have decided the flash has reached the end of its write lifetime and the flash can no longer be relied upon to store data correctly, so it prevents further writing.
In this situation the devices appears to be accessible as normal, but any writes are ignored. This can cause filesystems to become confused, since the filesystem thinks a write has succeeded but in fact the data is unchanged. Depending on how data is cached, the filesystem may have either the old data (which is on the medium) or an updated version in cache, which will be replaced by the old data when it is evicted from cache. This can be the source of strange behaviour and sometimes machine freezes.
If the card goes this way, it's life is over. The thing to do is copy the files off it onto new media while you can. Then you can only throw the card away - if the data is sensitive, physically destroy it (cut it up) first.
1 comment thread