storage – 存储诊断与确认恢复
可在不修改数据的情况下检查卷、重试挂载,或明确确认恢复未挂载的 Flash ffat。存储失败通过诊断结果返回;无效参数会抛出 Python 异常。数据保护、备份和恢复的完整规范见 存储、文件系统与数据保护。恢复成功后,可能需要用户选择软复位来发布 Python 挂载。
当前不支持在线格式化 SD,也不支持格式化已挂载卷。用户同意擦除选定卷后,调用方才可传入布尔值 True;不能在遇到错误后自动设置确认参数。
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.
- 参数:
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.
- 参数:
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.
- 参数:
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.