1,将一个块设备格式化为fat32的工具有
mkfs.fat32(linux自带该工具)
newfs_msdos(android平台上可以使用该工具)
newfs_msdos -F 32 /dev/block/ram0 -s 8192 -O android -L zhiliao(-F 32的含义是将其格式化为fat32格式,/dev/block/ram0是要被格式化的设备,-s 8192是设备的大小,8192表示的是8192个sector,每个sector大小为512Byte,-O android的含义是fatimg oem的名字,-L zhiliao的含义是盘符在PC端显示的名称)
2,newfs_msdos详细解释
option | description |
-N | Don't create a file system: just print out parameters |
-B boot | Get bootstrap from file. |
-F FAT-type | FAT type (one of 12, 16, or 32). |
-I volid | Volume ID. |
-L label | Volume label (up to 11 characters). |
-O OEM | OEM string (up to 8 characters). The default is "BSD 4.4". |
-S sector-size | Number of bytes per sector. |
-a FAT-size | Number of sectors per FAT. |
-b block-size | File system block size (bytes per cluster). |
-c cluster-size | Sectors per cluster. |
-e dirents | Number of root directory entries (FAT12 and FAT16 only). |
-f format | Specify a standard (floppy disk) format |
option | description |
-h heads | Number of drive heads. |
-i info | Location of the file system info sector (FAT32 only). |
-k backup | Location of the backup boot sector (FAT32 only). |
-m media | Media descriptor (acceptable range 0xf0 to 0xff). |
-n FATs | Number of FATs. Acceptable values are 1 to 16 inclusive |
-o hidden | Number of hidden sectors. |
-r reserved | Number of reserved sectors. |
-s total | File system size. |
-u track-size | Number of sectors per track. |