1 Star 0 Fork 4.9K

fish / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
format.md 5.33 KB
一键复制 编辑 原始数据 按行查看 历史
NEEN 提交于 2021-03-12 17:59 . !197 Docs Update version 1.0.1

format

Command Function

This command is used to format a disk.

Syntax

format <dev_inodename> <sectors> <option> [label]

Parameter Description

Table 1 Parameters

Parameter

Description

dev_inodename

Indicates the device name.

sectors

Indicates the size of the allocated memory unit or sector. The value 0 indicates that the parameter is null. (The value must be 0 or a power of 2. For FAT32, the maximum value is 128. If the parameter is set to 0, a proper cluster size is automatically selected. The available cluster size range varies depending on the partition size. If the cluster size is incorrectly specified, the formatting may fail.)

option

Indicates the formatting option for selecting the file system type. The options are as follows:
  • 0x01: FMT_FAT
  • 0x02: FMT_FAT32
  • 0x07: FMT_ANY
  • 0x08: FMT_ERASE (not supported by the USB flash drive)

Other values are invalid. The system will automatically select the formatting mode. If the low-level formatting bit is 1 during the formatting of a USB flash drive, an error message is printed.

label

Indicates the volume label name. This parameter is optional, and the value is a string. If null is specified for this parameter, the previously set volume label name is cleared.

Usage

  • The format command is used to format a disk. You can find the device name in the dev directory. A storage card must be installed before the formatting.
  • This command can be used to format only the USB flash drive, SD card, and MMC, but not the NAND flash and NOR flash.
  • The sectors parameter must be set to a valid value. An invalid value may cause exceptions.

Example

Enter format /dev/mmcblk0 128 2.

Output

Formatting result

1
https://gitee.com/fish_neil/docs.git
git@gitee.com:fish_neil/docs.git
fish_neil
docs
docs
master

搜索帮助