Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 01:03 08 Feb 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Picomite(2) How to Format drive "B:"

Author Message
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1364
Posted: 03:18pm 01 Feb 2025
Copy link to clipboard 
Print this post

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
causality ≠ correlation ≠ coincidence
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9512
Posted: 03:24pm 01 Feb 2025
Copy link to clipboard 
Print this post

  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: 1364
Posted: 03:34pm 01 Feb 2025
Copy link to clipboard 
Print this post

Many thanks for the quick response!
Regards
Michael
causality ≠ correlation ≠ coincidence
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 431
Posted: 09:18pm 01 Feb 2025
Copy link to clipboard 
Print this post

  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: 7106
Posted: 09:35pm 01 Feb 2025
Copy link to clipboard 
Print this post

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.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
bfwolf
Newbie

Joined: 03/01/2025
Location: Germany
Posts: 26
Posted: 09:53pm 01 Feb 2025
Copy link to clipboard 
Print this post

  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.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2025