Transferred from: http://blog.csdn.net/andyhooo/article/details/5321584
[Email protected] ~]#mkfs [-t file System format] Install file nameOptions and Parameters:-T: can take the file system format, such as Ext3, ext2, VFAT, etc. (System support will be effective)Example one: Please format the/dev/hdc6 you made in the previous episode as the Ext3 file system [[email protected] ~]#mkfs-t ext3/dev/hdc6MKE2FS 1.39 (29-may-2006)Filesystem label=<== here refers to the name of the partition slot (label) OS Type:linuxBlock size=4096 (log=2)The size of the <==block is set to 4K Fragment size=4096 (log=2)251392 inodes, 502023 blocks <== the Inode/block amount determined by this 25101 Blocks (5.00%) reserved for the Super Userfirst data block=0maximum filesystem blocks=51589939216 block groups32768 blocks Per group, 32768 fragments per group15712 inodes per groupsuperblock backups stored on blocks:32768, 98304, 163840, 2293 294912Writing inode tables:donecreating Journal (8192 blocks): Done <== has a journal writing superblocks and filesystem accounting information:donethis filesystem would be automatically checked Every mounts or180 days, whichever comes first. Use Tune2fs-c or-i to override. # this creates the Ext3 file system we need! It's a simple understanding! [[email protected] ~]# Mkfs[tab][tab] mkfs Mkfs.cramfs mkfs.ext2 MKFS.EXT3 mkfs.msdos mkfs.vfat# Press two [tab] to find the MKFS supported file format as shown above! can format Vfat Oh! |
Mkfs is actually a CI, in fact, as shown in the table above, when we use "mkfs-t ext3 ...", the system will call MKFS.EXT3 this command to do a formatted action! If the result is as shown in the above table, then bird Brother this system supports the file system format chemical has "Cramfs, Ext2, Ext3, Msdoc, vfat" and so on, and the most commonly used should be ext3, VFAT two! VFAT can be used in the Windows/linux shared USB with the CD.
Example: Format the/DEV/HDC6 as a vfat format that Windows can read! Answer: Mkfs-t vfat/dev/hdc6 |
In the example formatted as EXT3, we can find that there is a lot of information in the results, because we do not specify the details of the file system, so the system uses the preset values to format the rows. One of the more important parts is the file system's label, the size of the block, and the number of inode numbers. If you want to specify these things, you have to understand the EXT2/EXT3 utilities, that is, MKE2FS this command!
Mke2fs [-B Block Size] [-I block size] [-L-target] [-CJ] device Options and Parameters: -B: You can set the size of each block, currently supports 2048, 4096 bytes three;- I: How much capacity is given to an inode? -C: Check the disk is wrong, only next to the-C, will be quick to read the test; if you-c-c two times, it will be very slow ~-l: The back side can be called the title (label), this label It's useful! The E2label directive talks about ~-j : MKE2FS is EXT2, plus-j, and journal is the main activity. |
MKE2FS is a very detailed but troublesome instruction! Because there are too many parts in the area! Now let's go through the following assumptions:
- The target of this file system is set to: vbird_logical
- My block is specified as 2048 size;
- Each 8192 bytes allocates an inode;
- Built as Journal's Ext3 file system.
The beginning of formatting/DEV/HDC6 results in the following:
[[email protected] ~]# mke2fs-j-L" vbird_logical "-B 2048-i 8192/dev/hdc6 mke2fs 1.39 (29-may-2006) filesystem Label=vbird_logicalos type:linuxblock size=2048 (log=1) Fragment size=2048 (log=1) 251968 inodes, 1004046 blocks50202 blocks (5.00%) reserved for the Super Userfirst data block=0ma Ximum filesystem blocks=53791948862 Block groups16384 blocks per group, 16384 fragments per group4064 inodes per Groupsupe Rblock backups stored on blocks:16384, 49152, 81920, 114688, 147456, 409600, 442368, 802816Writing inode tables:d Onecreating Journal (16384 blocks): donewriting superblocks and filesystem accounting Information:done# comparison, with the above example with a preset value of the results, what is the difference ah? |
The various options/parameters used in the actual MKE2FS can also be used in the "Mkfs-t ext3 ... "Back, because the utility is the same!" It is important to note that the-B,-I and-J options, especially the-J option, mke2fs use ext2 to format the file format when it is not specified-j, and if you add-j, format it ext3 journaling Stem Yo!
In fact, if there are no special needs, the use of "mkfs-t ext3 ..." is not only easy to remember, but also very useful!
"Go" linux mkfs/mke2fs format