0

So, my phone has this error (it turns off randomly), and because of that, my 32GB microsd card got corrupted. Is there any way to fix de microsd card or recover the data on it?

I put the sd card on the pc through an USB adapter, and it only shows 32MB:

I put the sd card on the pc through an USB adapter, and it only shows 32MB

I tried CHKDSK command on windows but it didn't work.

edwinksl
  • 23,789
JCAguilera
  • 101
  • 1
  • 2

3 Answers3

4

First things first:

If you want your data. DON'T do any writing to the card as you try the rescue.

I just happened to have the same problem on a friends PC with an external HDD which got its volume entries corrupted and was also only showing a few MB instead of 60 GB. This happened because he did not safely remove the drive from his PC. If your card is really broken then nothing except a professional rescue service will be of any help to get your data.

Step 1: open a terminal window

Simply press ctrl+alt+t to open a terminal window.

Step 2: acquire testdisk

testdisk is available in the normal Ubuntu repositories so simply install it by:

sudo apt-get install testdisk

Step 3: rescuing your data via testdisk

Insert your SD-card into your card-reader or plug in the drive you want to rescue and fire up teskdisk with:

sudo testdisk

Then you will see the following in your terminal window:

testdisk main screen

Here you can choose to create a log file which I highly recommend for eventual troubleshooting. Simply press enter and you will see the next in your terminal, where you can choose the drive you want to rescue:

testdisk drive selcetion

Of course you see my drives in the screen-shot so you have to navigate to the corresponding drive with the up and down arrow key and then select at the bottom proceed with the left and right arrow key and hit return.

Next you will see is the file-system selection like in the next screen-shot:

testdisk file system selection

In most cases it tells you in the hint at the bottom which file-system type to select, do so or set it to the corresponding type of your drive. Then hit return again to proceed.

In the next menu (see screen-shot) select 'Advanced' and you should be able to see the full partitions (maybe a second partition on your card). Select it and select 'List' files and back them up.

testdisk rescue options

You should then see the directory structure you had on your drive like in the next screen-shot:

testdisk directory listing

See the red ones on the screen-shot; these are deleted files you can choose to hide by pressing h. Now navigate to the files/directories you want to rescue by pressing up and down arrow key (you can switch directories with enter or go upward by selecting the .. entries.

To make a selection of which files you want to copy/rescue press : which will mark the corresponding row green or press c to copy a single file. For copying the selection press shift+c. In both cases you will then be prompted with another directory view where you can navigate to a place to save your data/files. Navigate to where you want to have this data and press shift+c again to start copying.

Step 4: cleaning your SD-card

After you have all your data rescued its time to clean up the SD-card so you can use it again to full capacity. To do this just enter the following in your terminal (make sure you select the right volume for your card which was sdb in your screen-shot so I take that for my example here)

sudo dd bs=4m if=/dev/zero of=/dev/sdb

This may take a while to run but after that there is nothing on the SD-card at all so you should be able to use it with your reader and simply format it again.

Zanna
  • 70,465
Videonauth
  • 33,355
  • 17
  • 105
  • 120
1

When the SD card was formatted for file storage, a small portion was reserved for configuration files. That small portion is the 32 mb empty space that you can see there. I don't have enough info on your problem, but it sounds like you have a problem similar to this HowToGeek article. The Raspberry Pi in said article has the same issue as you. To quote from the article,

When I went to reformat the card only 64MB out of the original capacity was available and even when I went into Disk Management in Windows the best I could do is dump the contents of the inaccessible (and presumably Linux-filled) partition. This left me with a tiny Windows accessible partition and a big phantom partition I can’t do anything with.

I should assume that you are using Windows to view your card's files on the SD reader. If so, then it is more than likely that your missing 32 GB of space is a Linux-formatted partition, which Windows cannot see. If that is case, you can get an Ubuntu LiveCD, boot it up on your computer, run the LiveCD without installing, and transfer the files to your Windows machine. Then, you can reformat the SD card, while still in the LiveCD.

Hope it helps!

~ P

0

If the SD card claims that it's only 32 GB large then there's nothing you can do about that with software alone – Ubuntu/Linux or any other operating system.

If you need the data that might still be on the card contact a professional data rescue company who might be able to inspect the memory modules on the SD card without having to rely on the (apparently faulty) memory controller chip on the card.

If you don't care about the data and just want a working 32-GB SD cards, please edit your question to clarify that. There's also a comment to your question with a link dealing with that.

David Foerster
  • 36,264
  • 56
  • 94
  • 147