Unable to Read Micro SD Card

  • Be sure to checkout “Tips & Tricks”
    Dear Guest Visitor → Once you register and log-in:

    This forum does not automatically send notices of new content. So if, for example, you would like to be notified by mail when Steve posts an update to his blog (or of any other specific activity anywhere else), you need to tell the system what to “Watch” for you. Please checkout the “Tips & Tricks” page for details about that... and other tips!

    /Steve.

Davourak

New member
Oct 22, 2020
4
0
I have a 128 GB micro SD card that I was using in a smartphone. I took it out and used it in a card reader, as I wanted to backup all its data and transfer some of it to a new card.
However, part way through the copying, it stopped reading the card, after copying about 5 MB of data (out of many GB).
Now I cannot read the card at all. It is seen by the computer but it will not mount, as the OS says that the partition is unknown in Disks on Ubuntu. The same in gparted. I.e. they can see that there is a 128 GB partition, but have no idea what type it is.
So what can be done to read the data from the card? To at least get the partition type recognised properly again, so I can copy data from it. I don't need to use the card again after I get the data, it is a few years old.
Apologies if this is posted in the wrong place.
 

JulioHM

Active member
Oct 25, 2020
37
15
Definitely sounds like the filesystem got corrupted. Did you turn off the smartphone before ejecting the card? I mean, a complete shutdown. Just pulling it out with the OS still running might cause corruptions like this.

I would try running a low level tool, like fsck. Maybe Spinrite? If nothing helps, you might be out of luck, and the card could be physically damaged. Those puppies are small and sensitive even to small static electric discharges from our own body.
 

Davourak

New member
Oct 22, 2020
4
0
Definitely sounds like the filesystem got corrupted. Did you turn off the smartphone before ejecting the card? I mean, a complete shutdown. Just pulling it out with the OS still running might cause corruptions like this.

I would try running a low level tool, like fsck. Maybe Spinrite? If nothing helps, you might be out of luck, and the card could be physically damaged. Those puppies are small and sensitive even to small static electric discharges from our own body.
This is what I tried and the result:

$ sudo fsck /dev/sdh1
fsck from util-linux 2.34
e2fsck 1.45.5 (07-Jan-2020)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdh1

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
 

DiskTuna

Well-known member
Jan 3, 2021
93
10
Netherlands
File system issue is a possibility but often the problem lies deeper, ranging from purely physical issue like corrosion, to firmware, corrupt translation table, broken controller or degraded NAND.

Do not attempt repair, instead try extract data.

If data on it is important see if you can image the card using ddrescue. Imaging from Windows if card may be possible too if card is detected with correct capacity in disk management and physically okay. If imaging hangs, these USB connected flash drives don't respond well to (soft) resets, power cycling is only practical way to continue. Treat the SD Card as if it may fail any minute, so imaging needs to be done with some sense of urgency.

Try data extraction from image file using good file recovery software.

diskmansd.png


Good file recovery software: ReclaiMe, R-Studio, DMDE. IMO ReclaiMe is easiest to use, DMDE is most inexpensive but tad harder to use. I pick those because they're (or the pro version they're derived from) tried and tested on a daily basis in many data recovery labs.

If that all does not work, remaining option is recovery directly from NAND which can be a pain in the bottom with MicroSD and not a DIY thing.

This is all assuming data on the card wasn't encrypted.
 
Last edited:
  • Like
Reactions: doopy
G

george496

Guest
hello,

Restart or reboot of the device often resolves SD card won't read error on phone, PC or Mac. First unplug the SD card reader from your phone or computer. Restart and then reconnect the SD card via card reader. Check if you phone or computer is able to read the SD card.
 

Dave New

Active member
Nov 23, 2020
29
7
I've had cheap SD cards fail, because they were actually smaller than stated on the label. If you look at the empty card with a PC, it looks like all the space is there, but once you cross the actual capacity barrier, the address lines 'wrap' and overwrite the boot block, thus destroying the controller firmware and the whole thing becomes unreadable. Hopefully this isn't the case with your card, but I thought I'd alert folks to this possibility.

Also, some card manufacturers have actually had cheap knockoffs make it into big-box stores in retail packaging. For a failed famous-manufacturer compact flash card, their tech support had me read the little numbers on the edge of the card. Wherein he announced, "That's a counterfeit." To their credit, they replaced it with a real card, when I sent the bad one in.

I used to also have SanDisk micro-SD cards fail in Samsung phones, until at the suggestion of the Samsung rep at Best Buy, I tried using Samsung-branded cards. They were the same price and speed, and I've not a single card fail in any of my family's phones since. With the latest generation phones, they come with so much base memory, I've not felt the need to add more card-based memory.
 
  • Like
Reactions: DiskTuna

DiskTuna

Well-known member
Jan 3, 2021
93
10
Netherlands
I've had cheap SD cards fail, because they were actually smaller than stated on the label. If you look at the empty card with a PC, it looks like all the space is there, but once you cross the actual capacity barrier, the address lines 'wrap' and overwrite the boot block, thus destroying the controller firmware and the whole thing becomes unreadable. Hopefully this isn't the case with your card, but I thought I'd alert folks to this possibility.

Also, some card manufacturers have actually had cheap knockoffs make it into big-box stores in retail packaging. For a failed famous-manufacturer compact flash card, their tech support had me read the little numbers on the edge of the card. Wherein he announced, "That's a counterfeit." To their credit, they replaced it with a real card, when I sent the bad one in.

I used to also have SanDisk micro-SD cards fail in Samsung phones, until at the suggestion of the Samsung rep at Best Buy, I tried using Samsung-branded cards. They were the same price and speed, and I've not a single card fail in any of my family's phones since. With the latest generation phones, they come with so much base memory, I've not felt the need to add more card-based memory.

Yes, these fake cards are 'rather common' in the sense that a significant portion of data loss cases I see are caused by these. Sad fact is these can not be recovered.

More common scenario seems (rather than the 'wrap scenario'):

Fraction of advertised memory is actually present but enough to accommodate file system meta data + some actual data. Firmware is modified so that when you write data to non existing NAND the card reports all went well. In effect you can save photos (in camera for example) to non existing space while file system meta data keeps being updated since that resides in actually existing NAND memory.

Move the card to a card reader to extract the photos can also be done without an error message. But as soon as non existing NAND is addressed for read the card simply returns zeros.

Same kind of fraud but perhaps more obvious takes place with USB flash drives. Example advertised as 1 TB portable USB SSD at Amazon for ridiculously low price vs output of ChipGenius (only 32 GB!!!):

FakeTBSSD.jpg
 

DiskTuna

Well-known member
Jan 3, 2021
93
10
Netherlands
Didn't we learn the need for firmware signing and validation from Bad USB? I guess when the devices costs pennies to make there is no opportunity for anything that might add an extra penny or two to the costs. ☹️
Yeah, modified, or configured or whatever you want to call it.

In data recovery, manipulating firmware is actually quite common and useful.
 

rfrazier

Well-known member
Sep 30, 2020
300
96
I think somebody recommended for me to use Photorec once on a wonky memory card. I think it worked. I think that one is a Windows program. I also seem to remember ddrescue for Linux, and a few variants on that. Maybe gddrescue. Not sure about that one. It's been a long time. Obviously, on this forum, you can try a SpinRite Level 2 on the card if you can get it into a card reader that SR can talk to. Also, try a different card reader and a different cable if one generates failures. As @Steve has pointed out, running a Level 2 SpinRite on memory devices a couple of times a year has therapeutic value. That's harder to do on a bunch of memory cards than it is for hard drives. And it's hard to track that for hard drives. See my burn in procedure below. Windows CHKDISK may not be the best thing to start off with for data recovery since it will orphan any erroneous files it finds.

No idea what to do if your card is counterfeit. There may be nothing you can do.

Here are some thoughts for problem prevention with new cards. Buy name brand cards. I like Samsung. I think Sandisk is good, and Kingston, and Patriot. It's been a while since I studied the market, and I don't know who's bought whom. If you're going to be hitting the card with lots of writes (like in a Raspberry Pi), go for the extreme endurance or pro version. If it's a major maker which is reputable, look for a 2 year, 3 year, or 5 year warranty. Buy your cards from a reputable brick and mortar vendor, even if by mail. I've started shying away from buying memory cards and batteries on Amazon or Ebay. Sometimes things from those sources are counterfeit. It's a big problem. Sometimes they are returned and resold. I don't ever want a USED memory storage device. Sources I would gravitate toward include Best Buy, Target, Walmart, Office Max / Office Depot, Staples, Adorama, B & H Photo, etc.

This is easy to say, hard to do. Don't trust memory cards. I used to teach electronics at DeVry University. I told my students don't trust memory cards and memory sticks. Have a backup of your content. Caveat, even now, though, I have some photos on camera's that I haven't moved off. When I do move them off to my PC, they get backed up online that evening with JungleDisk via AWS that @Steve mentioned years ago. I don't necessarily recommend that for new users, but I'm still using it.

I like to burn in memory devices including memory cards, USB sticks, and SSD's before trusting them. The trouble I go to increases with the amount of data storage. At a minimum, I'm going to format the card and run a Windows CHKDISK on it. You can do this by right clicking on the card in Windows File Explorer (at least in Windows 7), properties, tools, check for errors. UNCHECK the automatically fix errors box and CHECK the search for bad sectors box. This makes sure each sector is read. This process is NON DESTRUCTIVE, and can be used with a card with data. As the instructions in SpinRite say for Level 2, this "brings the drive's attention to each sector" and alerts the controller to any anomalies it doesn't like. A SpinRite Level 2 would do something similar, but would try to correct errors. Hopefully there are none for a new card. The reason I uncheck the automatically fix errors box is that this tends to orphan files which are found to be in error.

By the way, you don't HAVE to format big cards with EXFAT. If you want to use a card with Linux for example, you can format with NTFS or FAT32. You may wish to use FAT32 for Android devices. You may have to use an external utility to do so. Make sure it's reputable. This article talks about that.


If the card is bigger, say over 32 GB or 64 GB, I go to a bit more trouble. I will do a SpinRite Level 4 on it. Yes, I said Level 4. It will read, invert, write, read, invert, write the card. Yes it uses up 2 full write cycles. But, then I know every memory cell has been thoroughly tested and the controller should have reset all it's magic error correction. Before the SpinRite, I fill the device with random data. In that case, it uses 3 write cycles. See below. If doing SpinRite is not practical, IE rebooting with a card reader on a port that works, I have an alternative method.

Years ago, I wanted to do some of this type of testing on a HDD. But, it works for SSD's and memory devices too. I Googled something like generate file with random data. I get pages such as this for Linux:


And commands such as this:

dd if=/dev/urandom of=target-file bs=1M count=1000

I don't remember exactly what I did years ago. But, it was similar to that. That command will generate an output file with 1 GB of random data. By changing the count, I generated files of 1 MB, 2 MB, 4 MB, 8 MB, 16 MB, 32 MB, 64 MB, 128 MB, 256 MB, 512 MB, 1 GB, 2 GB, 4 GB, and 8 GB. I keep them hanging around on my PC for when I want to do testing of storage devices. So, I would copy as many of these as I can to the memory card, USB stick, SSD, or even HDD to fill it up completely. For what it's worth, I just did this to a 2 TB SSD. Took a while. If you highlight all the random data files in Windows Explorer, select copy, then paste them into the memory card, Windows will offer to rename them as many times as necessary to make the copies. Just keep doing this over and over. Note that a 32 GB card, for example, won't have 32 GB of available space after formatting. So, I couldn't just copy 4 of the 8 GB files. Once the card is full of random data, I run the CHKDISK on it with the search for bad sectors box turned on. As an alternative, you can run SpinRite Level 2 or Level 4 after storing the data. A fill with data procedure plus a SpinRite Level 2 will only use up one write cycle. A fill with data procedure plus a SpinRite Level 4 will use up 3 write cycles.

Crossing my fingers so as to not jinx myself. Using these procedures, I rarely have failed memory cards. But wait, there's more. As mentioned above, you should run a SpinRite Level 2 or this CHKDISK search for bad sectors a couple of times per year. A solid state memory device can leak away it's data within a year if it's never powered on and allowed to do it's housekeeping. After testing, erase most or all the random data AND empty the trash if it's relevant for such devices on your PC. Initial writes to the card may be slow until its controller has had a chance to do the block erases necessary to write new data. Always try to leave at least 10 % of a memory device empty so it can do housekeeping. Once you're through testing, you may wish to format the card in the camera or whatever you want to use it in just to make sure that device is happy.

Hope you find this info useful.

May your bits be stable and your interfaces be fast. :cool: Ron
 

DiskTuna

Well-known member
Jan 3, 2021
93
10
Netherlands
FWIW, if we talk counterfeit memory cards and USB flash drives, chkdsk will not do you much good. These report 'all is well' even for non existing NAND memory. Same for SpinRite, it will get an OK even for non existing memory. An interesting experiment would be where SR actually writes and reads back and then compares. Anyway, there's nothing you can do other than modify the firmware to reflect actual amount of NAND in case of a counterfeit card. But then keep in mind that components on these are the cheapest of the cheapest and you'll probably never have a reliable storage device.

Also, how a card is formatted is often 'dictated' by device it's used in. A camera won't be able to work with an NTFS formatted card. exFAT is somewhat optimized for NAND (compared to FAT/FAT32).

With regards to overprovisioning: There's no need for that, it's done already at the firmware level.

With regards to housekeeping: Few devices, cameras such as Sony and Canon (if full format option is offered) as well as Android already support the TRIM equivalent for SD Cards (ERASE) so with this in mind it's best to let the device the card will be used in take care of formatting (and send accompanying ERASE command) as it is beneficial to the firmware housekeeping.

So, know that NAND memory is factory tested but if there's any rituals you'd like to perform for peace of mind then go for it.

With regards to recovery: yes ddrescue is a great idea as I already mentioned. If you're on the Windows platform I'd rather use the excellent and free R-Photo rather than PhotoRec. For non photo recovery consider I'd consider DMDE, demo recovers upto 4000 files and offers TestDisk like features and for $40 or so you have a lifetime license.
 

SeanBZA

Active member
Oct 1, 2020
33
5
Testdisk and Photorec are very useful in Linux,and I have used them before for this. Not a point and click experience, but usable enough if you read the instructions and follow them.
 

Ralph

Active member
Sep 24, 2020
38
3
I recently purchased a couple High Endurance micro SD cards, Samsung and Sandisk. They were all 32GB and I decided to run a level 4 Spinrite pass before putting them to work. I've made a habit of running Spinrite on flash drives, especially the higher capacity ones. I never ran Spinrite to micros before. The micro slot in my laptop doesn't work so I tried 2 adapters I had, an older Sandisk SD to USB A, and a newer Anker SD/ micro to USB B. Since my laptop is USB C only I had to use another adapter to plug them in. A lot of adapters there! Anyway, I was finally able to get a 32GB micro to work with the Sandisk adapter using a micro to SD adapter. The Anker would just hang Spinrite when scanning for devices using both slots, SD and micro. The level 4 ran about 4.5 hours and there were no noticeable retry pauses which I always get with flash drives. I tried a 64GB micro next and it didn't work. I haven't run enough tests to be sure, but it seems like the adapter has a lot to do with if Spinrite will work or not. Almost all my micro SD cards are Sandisk and more recently a couple Samsungs. I will probably have to get a true adapter for USB C to eliminate all those adapters which are possibly or probably a problem.

So far I've only got to run Spinrite on one micro, but unless I happened to get an exceptionally good one to work, it seems the error rate on micros is far less than all the flash drives I've tested to date. Any suggestions on a micro SD to USB C adapter would be welcome. I'll do some research in the mean time since I am now curious if micro SDs in general have better error rates than flash drives. I use a lot of flash drives and even though everything on them is backed up I would rather use one I am reasonably sure I can trust. Many have at least some encrypted data so 1 bad bit will be a problem.
 

SeanBZA

Active member
Oct 1, 2020
33
5
I bought a cheap USB3 hub, which also has a card reader built into it, so you might want to go look for this, I bought a unit branded Orico, which works well, and which is fast as well. At least USBC to USB3 adapters are common.