How do I format a stubborn MicroSD card?

I have a 256 GB MicroSD card that I cannot seem to get formatted. I have tried to use the tools available to me inside Fedora Silverble, both command line and graphical tools. It does show up in the file manager as two distinct entries: system-boot and writable.

How can I force nuke the card?

What happens if you write a new partition table using the CLI tools?

If it fails, please share the command and the full output from the command.

1 Like

I do like GParted. Just watch out that you select the correct disk first :wink:

Just to add to what @dalto and @ilikelinux posted you can use gparted to change the partition table then format it as well.

Normally, I use Gnome Disks to do that

  • select the drive, unmount any mounted partitions
  • select the 3 dots menu
  • format disk, without overwrite with zero
  • repeat with overwrite with zero if above failed
    Create partitions / format as filesystems if want.

If that still cannot format the card, the next I will suspect the card is Fake and use GitHub - AltraMayor/f3: F3 - Fight Flash Fraud to test.

1 Like

In KDE partition manager, you can right click a device and “create new partition table”. This helped me fix a USB storage device that works well on my Linux PC, but not on someone else’s Windows PC.

He uses Silverblue alias Gnome.

For whatever reason, gparted nor Disks can get the job done. The SD card has two partitions. I select both partitions, click the delete button, gparted throws up a couple of messages for each of the partitions informing me that the kernel cannot be informed of the changes because it’s in use. At which point, the SD card goes back to the screen showing the two partitions again.

Doubtful the card is fake, due to it being SanDisk bought from Walmart. It previously worked fine before I created it for use with Raspberry Pi.

SD cards aren’t centennal, just ware out even good quality …

Failing SD cards are switching to read-only mode. SD cards and SD-sized adapters (for microSD cards) have physical lock switches - used to inform card reader to work in read-only mode. Arrowlike triangle points to the direction where switch is in locked position.
Run dmesg -W and plug-in the card, that output should tell us whether the card is writeable or not.

It’s a month old and barely used.

Here is what I received when I ran the command you suggested.

[95722.960407] mmc0: cannot verify signal voltage switch
[95723.424559] mmc0: cannot verify signal voltage switch
[95723.556195] I/O error, dev mmcblk0, sector 526336 op 0x1:(WRITE) flags 0x103000 phys_seg 1 prio class 2
[95723.556201] Buffer I/O error on dev mmcblk0p2, logical block 0, lost async page write
[95723.557064] I/O error, dev mmcblk0, sector 533840 op 0x1:(WRITE) flags 0x103000 phys_seg 3 prio class 2
[95723.557066] Buffer I/O error on dev mmcblk0p2, logical block 938, lost async page write
[95723.557068] Buffer I/O error on dev mmcblk0p2, logical block 939, lost async page write
[95723.557069] Buffer I/O error on dev mmcblk0p2, logical block 940, lost async page write
[95723.557718] I/O error, dev mmcblk0, sector 533912 op 0x1:(WRITE) flags 0x103000 phys_seg 1 prio class 2
[95723.557719] Buffer I/O error on dev mmcblk0p2, logical block 947, lost async page write
[95723.558343] I/O error, dev mmcblk0, sector 533976 op 0x1:(WRITE) flags 0x103000 phys_seg 1 prio class 2
[95723.558344] Buffer I/O error on dev mmcblk0p2, logical block 955, lost async page write
[95723.558945] I/O error, dev mmcblk0, sector 534088 op 0x1:(WRITE) flags 0x103000 phys_seg 1 prio class 2
[95723.558946] Buffer I/O error on dev mmcblk0p2, logical block 969, lost async page write
[95723.559559] I/O error, dev mmcblk0, sector 534104 op 0x1:(WRITE) flags 0x103000 phys_seg 1 prio class 2
[95723.559560] Buffer I/O error on dev mmcblk0p2, logical block 971, lost async page write
[95723.560199] I/O error, dev mmcblk0, sector 534352 op 0x1:(WRITE) flags 0x103000 phys_seg 1 prio class 2
[95723.560201] Buffer I/O error on dev mmcblk0p2, logical block 1002, lost async page write
[95723.560840] I/O error, dev mmcblk0, sector 534384 op 0x1:(WRITE) flags 0x103000 phys_seg 1 prio class 2
[95723.560842] Buffer I/O error on dev mmcblk0p2, logical block 1006, lost async page write
[95723.561898] I/O error, dev mmcblk0, sector 534408 op 0x1:(WRITE) flags 0x103000 phys_seg 5 prio class 2
[95723.562654] I/O error, dev mmcblk0, sector 534544 op 0x1:(WRITE) flags 0x103000 phys_seg 2 prio class 2

You not have at least 3 Month of Garantie of such a product? Walmart should be able to substitute.

Unplug the card, reboot, run dmesg -W and then insert the card, try to format it. Also try different SD adapter, if you’re using one.

Erase all partitions by formatting to empty with gnome-disk-utility, eject, unplug it, reboot and start again reformatting the SD card … complicated but sometimes just does the trick.

gparted cannot delete a partition that is mounted. It may show a ‘key’ image next to the partition name. Fedora by default mounts usb devices when connected, so if the sd card is in a usb device the partitions are likely mounted.

Use the mount command to see what is mounted. Once identified you can use the umount command to unmount that partition. For example, if mount shows you that /dev/sdd1 is mounted at /run/media/USER/xxxx then to unmount it simply run sudo umount /dev/sdd1. Repeat for each partition on that device then gparted will be able to manage it.

Gparted is also able to unmount partitions in some cases. Highlight the partition name then click on “partition” at the top then “unmount”

Gnome-disk-utility … select storage device, click top right corner button, select format disk, option no partition (empty) and OK. Works on Windows console diskpart command, I use console tools with ease on Linux but simple GUI tools do everyday jobs. Why sometimes you need to eject and reboot has something to do with modern hardware memory cache features.