storage – Diagnostics and Confirmed Recovery

[中文]

Inspect a volume without modifying it, retry mounting without formatting, or explicitly confirm recovery of an unmounted Flash ffat. Storage failures return diagnostic results; invalid arguments raise Python exceptions. See Storage, Filesystems and Data Protection for the complete data-protection, backup and recovery contract. A successful recovery may require a user-selected soft reset to publish the Python mount.

Online SD formatting and formatting a mounted volume are not supported. Confirmation must be the literal boolean True after the user has approved erasing the selected volume; callers must not set it automatically after an error.

Functions

storage.status(volume=...)

Return non-destructive status and recovery guidance for flash or sd. Storage faults are represented in the result, not by rebooting the board.

Parameters:

volume – “flash” (default) or “sd”.

storage.retry(volume=...)

Retry mounting without formatting or erasing any data, including when board policy disables automatic mounting. Check ok and operation_error; after success, soft_reset_required requests an explicit soft reset to publish the Python mount.

Parameters:

volume – “flash” (default) or “sd”.

storage.format(volume=..., *, confirm=...)

Explicitly initialize an unmounted flash data/FAT partition named ffat. This destroys files and requires the literal confirm=True after user approval and any required backup. Mounted volumes, legacy vfs, open handles, quarantined writers and online SD formatting are not supported. Check ok, operation_error and soft_reset_required; failure never triggers automatic reboot or another format.

Parameters:
  • volume – “flash” (default); “sd” returns an unsupported operation result.

  • confirm – Must be the boolean True; omission, False and truthy strings are rejected before any write.