SdFat's SDformatter example doesn't erase card

When I use the E command to erase, it says it's erasing, and gives me two dots on the line below, but then examining the card with HxD, all kinds of ghost stuff is left. The card is a small 256MB microSD. I'm using an 8MHz Pro Mini powered with 5V, and the SD module is the standard version with voltage translation. It's the latest version of SdFat.

Can anyone, maybe even @fat16lib, suggest why the erase is failing, or what I can do to get it to work?

Edit: I should say that the Read/Write example works perfectly. So the wiring is correct and there's no phantom write protection. And the formatter obviously thinks it's erasing the card. Could it be using the wrong erase command?

Erasing only removes records from the table. There is no physical destruction of data.

No, I don't think that's right. The Erase function is supposed to return the card to the fully erased state.

A fancy camera does that too - so stills and video can be written in real time without the need to pre-erase the flash. I've confirmed with my Canon DSLR's "low level" format that it does exactly that on the full-size 1GB card I normally use in it. However, it does not erase the little microSD card. So the problem is almost certainly that the card doesn't execute the erase command properly, but just pretends to. It is a no-name card.

So I just did the SDformatter example Erase on an 8GB Transcend microSD card, and it worked perfectly. So to me that confirms the little card is the problem.

Learn the functions of the FAT file system. The file erase function works with the file directory, and the format function completely erases all data.

To be more precise, you need to look at how these functions are implemented in the Arduino library.

If the file removal function cleared everything, there were no data recovery programs, data can be recovered even after multiple formatting, the recovery method by domain orientation, yes, it is very, very expensive, but it is quite possible ( on magnetic media)

I'm talking about the CMD38 low-level command sent to the card by the Arduino. It has nothing to do with the file system. This is what cameras send when they do a low-level format. Windows and Mac are not able to send the command because the SD card reader (built-in or external USB) isn't coded to send the command. This is where an Arduino does a superior job. Instead of overwriting the entire card with zeros or FFs, it just erases the flash memory in a few seconds.

I find the Arduino SD and SdFat libraries to be so unreliable as to be almost useless, and I'm not alone in that assessment. I've used them extensively, and experienced error rates orders of magnitude higher than say, linux with uSD cards on the lowliest of RPi microcontrollers.

I gave up on Arduino + SD card years ago, and don't recommend it to anyone.

I'm your supporter in this, if you have access to the network then SQL, SQL & SQL

I'm a little behind in modern technology. Previously, to erase a byte, you had to send the command to erase that byte 6 times (29EE series). It was fast, of course, but not incredibly fast.

The SdFormatter example can do a low level erase if the SD card supports it.

Here is an example for a 2 GB card:

This program can erase and/or format SD/SDHC/SDXC cards.

Erase uses the card's fast flash erase command.
Flash erase sets all data to 0X00 for most cards
and 0XFF for a few vendor's cards.

Cards up to 2 GiB (GiB = 2^30 bytes) will be formated FAT16.
Cards larger than 2 GiB and up to 32 GiB will be formatted
FAT32. Cards larger than 32 GiB will be formatted exFAT.

Warning, all data on the card will be erased.
Enter 'Y' to continue: Y

Card size: 2.03 GB (GB = 1E9 bytes)
Card size: 1.89 GiB (GiB = 2^30 bytes)
Card will be formated FAT16

Options are:
E - erase the card and skip formatting.
F - erase and then format the card. (recommended)
Q - quick format the card without erase.

Enter option: E

Erasing
................
All data set to 0x00
Erase done

SdFat use CMD38 so it is very fast and all data is set to all ones or all zeros depending on the type flash.

Many small cards still do not support fast block erase.

Thanks very much. Yes, that explains the problem I was having. The little 256MB cards just don't support the erase function. But I confirmed that Erase works fine for my 1GB and larger cards.

I want to emphasize how much better erasing cards is than overwriting them. Overwriting leaves all the sectors as containing valid data, which must give the wear leveling algorithm fits, if the SD card uses wear leveling. And it takes forever. Erasing is very fast, and leaves all sectors as, uh, erased. And the much-touted SD Association's formatter running on your computer can't erase. So your Arduino is actually a much more capable option when you need to wipe a card.