Peterborough Linux User Group (Canada) Forum

Linux & Android => Support => Topic started by: Jason on November 23, 2019, 02:53:18 PM

Title: Corrupted micro-SD card that can't be read
Post by: Jason on November 23, 2019, 02:53:18 PM
I've gotten myself into an odd situation.

I'm still working on the NextCloud presentation. After many setbacks, I managed to get NC working locally on my laptop and I discovered a "bug" in the documentation.

I wanted to try it on my Raspberry Pi 3B. I was using Berryboot to install Ubuntu on it and decided to change course. So I just cancelled the install using the cancel button and turned off the Pi by unplugging it. In hindsight, I should have looked for a way to shutdown Berryboot.

The microSD card is now corrupted. I can't even get gparted (inside Ubuntu 18.04.3) to read it so I can't reformat it or even create a new partition table. It errors out trying to recognize the drive (retry, cancel, ignore).

I just wondered if anybody has run across this and how to fix it in Linux. I did a brief search and only saw Windows tools. I don't have Windows installed on my only computer that has an SD card reader.

I tried the Gnome Disks application as well. You can see the error messages for both below.
Title: Re: Corrupted micro-SD card that can't be read
Post by: fox on November 23, 2019, 05:48:53 PM
Could you do it from a terminal? Alternatively, try to write something to it with Etcher?
Title: Re: Corrupted micro-SD card that can't be read
Post by: ssfc72 on November 23, 2019, 08:41:57 PM
I had the same problem with a micro SD card a few weeks ago.  I never was able to find a way to reformat the SD card.

The only thing that would even see the SD card was the Disks program in the MInt Cinnamon distro.  I tried to format the card from the tools in the Disks program, but it refused to format the card. :-(

The sd card was in my cell phone and as far as I know it was working and I never removed the SD card without the phone being powered off.

edit - The 16 GB SD card shows up as being 2 TB, when the card is recognised???
Title: Re: Corrupted micro-SD card that can't be read
Post by: Jason on November 24, 2019, 06:00:28 AM
Quote from: fox on November 23, 2019, 05:48:53 PM
Could you do it from a terminal? Alternatively, try to write something to it with Etcher?

I don't know what command to use from a terminal. I've used cfdisk before but never with an SD card. Not sure if it works the same way. As for Etcher, it doesn't see the card at all.

I'll look online to see if you can use fdisk or cfdisk in Linux with SD cards. But I think the problem is that it can't read the card at all - it seems to be entirely confused. When I got gparted to load after hitting retry probably 25 times or more, it said the partition table didn't exist. When I tried to create it, ended up getting the same error with the same three options. So I think the partition table is corrupted but in such a bad way that even the drive meta-information can't be read (size of the drive, filesystem, etc). I recall having issues with USB drives like this in Windows but always when I went into Linux, I could reformat them and that fixed it.

It could just be that it was a failing SD card and it happened to quite at that particular time. I'll probably have to give up a Linux solution down and try Windows utilities. I don't do much on the laptop so it's not too huge a deal to install Windows on it and reinstall Ubuntu.
Title: Re: Corrupted micro-SD card that can't be read
Post by: Jason on November 24, 2019, 06:01:47 AM
Quote from: ssfc72 on November 23, 2019, 08:41:57 PM
The only thing that would even see the SD card was the Disks program in the MInt Cinnamon distro.  I tried to format the card from the tools in the Disks program, but it refused to format the card. :-(

I had the same thing when I tried to format it in Disks. It sees it but won't format. It generates the error message you see in the second screenshot (click it to see the full-sized version).