Killed an SD card trying to delete Raspbian and install OctoPrint Image

What is the problem?
I used the Raspberry Pi instructions to format a 64 GB microSD card in FAT32 and load NOOBS on it. I then used it to load Raspbian on a Raspberry Pi 2. I then realized I needed a fresh microSD card to try out OctoPrint so I started to try and recover this microSD card back to a single FAT32 partition. I am not sure exactly what I tried first, but reading on the Internet I found the diskpart command and Disk Management in Windows 10. I lt and used diskpart first to view and clean the card, but diskpart could only see the '2.something" GB FAT32 partition, so that is all that it worked on. The Linux partition was still there as far as I could tell, but diskpart did not show it in a list of partitions on that card. After I cleaned the card, I tried for format it in diskpart, but it only formatted the small partition that Windows recognized. At this point I had a 2.something GB FAT32 partition, and I realized that the OctoPtint image creates a Linux partition when it loads and changes the size of the FAT32 partition to compensate, so I loaded the OctoPrint image on the card thinking that the image will use the full capacity of the card, but it only used the 2.something GB FAT32 partition. Next I found Win10 Disk Management and I looked at the SD card there and saw only the 2.something partition existing on the card. No free space and no other partitions. Everything else was simply gone. I deleted the FAT32 partition thinking this might then show me 64 GB of free space, but it did not. At this point on my Win10 computer this microSD card does not register at all. When I plug it into a reader in a USB port it shows up as "No Media"

Can anyone offer solutions, or a tool that will definitely allow me to see the full volume and all the partitions and free space on it?

What did you already try to solve it?

See above

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, what kind of hardware precisely, ...)

SanDisk Ultra 64 GB microSD card, Win10 Sony Vaio Laptop

I never install NOOBS, to be honest. Start over with the OctoPi image, then use Etcher instead. You don't need to format anything.

A screenshot of the card attached to windows in disk management would be helpful. You could also try https://gparted.org/ to see if it is able to assist in this situation.

2 Likes

I achieved great results with this tool

Jneilliii, thanks for the question. It caused me to discover my issue. Did you ever have that “didn’t scroll down far enough in disk manager” problem? I was looking at the disk manager entry for an empty HSB data card reader, when my card was shown below that, and not in the window view yet. I see it now and I have formatted it into one 59.48 GB exFAT partition. Now to go reformat it to FAT32 with guiformst.exe. Thanks for setting my brain straight with a simple question.

Outsourcedguru. Thanks for the help. I got it working. I actually tried what you recommended when all I could see was a 2.22 GB FAT32 partition and when I used Etcher to load the OctoPrint image all it used was that 2.22 GB of space because it created the Linux partition and reduced the FAT32 partition down to MB size. I originally used this card to play with an RP without OctoPrint on it, so I installed NOOBS to get to Raspbian. Thanks for your response.

Etcher is supposed to flash over whatever is on the disk, hence the suggestion.

But that earlier suggestion to use gparted is also another good one—that one can do almost anything and it comes with a live boot option.

Yes, I kind of figured out that Etcher does that because when I used it to put the OP image on the 60 GB FAT32 partition the result was still a 21 MB FAT32 partition. Maybe my first attempt worked and I didn’t know it. I am new to just about anything other than Windows and I last did programming in college in 1980. It is good to know a community is out there to offer so much help in no time at all. Thanks to everyone.

Do yourself a favor and create a gparted live bootable CD or USB drive (dedicated to this). You just end up booting to this on your Mac/Windows computer, fix up some failing microSD or adjust the partition sizes, shrink them, expand them, whatever. It won't change your existing PC one bit.

A similar alternative is to use a Live Boot Ubuntu Desktop CD/USB since it includes gparted on it. The USB version will boot up in under two minutes.

You can then even copy/paste/edit files on that 2nd partition back to your computer's drive if you'd like. (It's a shame that Microsoft/Apple have purposely chosen not to support the ext4 partition type otherwise you could do this natively on your laptop.)

Thanks Outsourced, I will do that. I agree about MS and Apple. They can be more supportive with little effort on their parts.

Any update on your success? I have damaged an SD card in a similar way once.

I used a USB card reader (Transcend) to plug the card into the PC and used the text based partition manager (diskpart, run as admin) of Windows 10 to get it sorted. The GUI programs all didn't show anything existing. Diskpart did.

Be VERY careful with the program, it's able to wipe your active Windows partition if you're not careful.

So I just selected the drive with "select disk X" where X was the SD card connected and then used the command "clear" to wipe all data from the SD card. After that, I unplugged the reader and plugged it into a different plug, and the regular GUI programs picked up the card again.

I hope something like this will help you as well. I had some good results with balena Etcher to put OctoPrint on the SD card afterwards.

Most of the time the partition just didn't get a drive letter assigned or the whole disk is marked as offline.
Sometimes no partition is detected so you have to create a new one.
You can deal with those and other problems here: