Picomite(2) How to Format drive "B:"


Author Message
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1456
Posted: 03:18pm 01 Feb 2025      

Hi all,



the manual says on p37
  Quote  DRIVE "A:/FORMAT"
Reformat the Flash Filesystem (drive A:) to its initial state.

Shouldn't this also apply to drive B:? Drive A: is pretty full, so I don't want to test it for A:. Of course I can format the SD card in the PC, but that takes more effort.

The syntax for formatting also seems a bit unusual to me ...?
Any ideas?
Michael

matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9805
Posted: 03:24pm 01 Feb 2025      

  Quote  Shouldn't this also apply to drive B:


No. Deliberately not. FatFS has the capability but it is disabled for safety reasons

twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1456
Posted: 03:34pm 01 Feb 2025      

Many thanks for the quick response!
Regards
Michael

Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 503
Posted: 09:18pm 01 Feb 2025      

  matherp said  
  Quote  Shouldn't this also apply to drive B:


No. Deliberately not. FatFS has the capability but it is disabled for safety reasons


Hm... I don't think it is a bad idea! If the pico mite is a fully self contained computer, it MUST be possible to format drive B...

Couldn't you implement a security question?

Greetings
Daniel

Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7341
Posted: 09:35pm 01 Feb 2025      

Sorry, but FORMAT is always a bad idea and should only ever be done if it's a new drive, some file system calamity has happened or you need to partition drives. FORMAT isn't even a good idea on "proper" computers with an OS and often needs protection.

The Pico isn't really a true stand-alone computer even if it appears to be one.

It's so easy to move the SD card to a PC to mess with it if you really need to.

bfwolf
Regular Member

Joined: 03/01/2025
Location: Germany
Posts: 51
Posted: 09:53pm 01 Feb 2025      

  matherp said  
  Quote  Shouldn't this also apply to drive B:


No. Deliberately not. FatFS has the capability but it is disabled for safety reasons


I understand Peter's reasons and agree with him!

It is really not a good idea to format SD cards using the "standard means". Even formatting SD cards using the standard format tool in Windows is not recommended!

Instead, this tool should be used: (Windows and Mac)
https://www.sdcard.org/downloads/formatter/
or for Linux:
https://www.sdcard.org/downloads/sd-memory-card-formatter-for-linux/

Background: SD cards consist of NAND flash memory chips and a controller that manages them. This controller implements an "FTL" (Flash Translation Layer), which emulates a magnetic data carrier with arbitrarily writable blocks. In fact, the NAND flash memory chips consist of larger erasable sectors that contain 2^n writable blocks. In addition, these erasable sectors become defective over time due to many deletion processes. To avoid this, the FTL carries out "wear leveling" to stress the sectors evenly. The FTL also detects defective sectors and then replaces them with reserve sectors. The strategy used is optimized for the FAT file system. However, a different cluster size is usually used than the one that Windows' own formatting tool would choose, for example.

The SD Association's formatting tool reads special information on the SD card (via special registers) to determine the optimal cluster size!

Formatting an SD card with Windows' own formatting tool (which was designed for magnetic data storage devices) works, but is not optimal and affects the performance and lifespan of the card!

What you can do safely with the Windows formatting tool is "quickformat", because this only initializes the FAT.