Linux formatted disk command linux mkfs directive: MKFS Use Rights: MKFS [-v] [-t Fstype] [fs-options] Filesys [blocks] [-l lable] said Ming: The establishment of the Linux file system on specific partition parameters: device: The hard drive to check partition, for example:/dev/sda1-v: Detailed display mode-T: A given file system type, Linux pre Set value of EXT2-C: Before making a filing system, check if the partition has a bad track-L Bad_blocks_file: Add the block data with bad rails to bad_blocks_file inside block: given BL Ock Size-L: Establish lable Supplemental notes: The     MKFS itself does not perform the work of establishing the file system, but rather invokes the relevant program to execute it. For example, if you specify Ext2 in the "-T" parameter, then          MKFS invokes MKE2FS to establish the file system. When used, such as omitting the specified number of blocks argument, MKFS will automatically set the number of blocks appropriate. Example: Build a Msdos file system on the/DEV/HDA5 and check if there are bad tracks, and list the procedures in detail: mkfs-v-t msdos-c/dev/hda5 & Nbsp; mfks-t Ext3/dev/sda6 //will SDA6 partition format to ext3 format mkfs-t ext2/dev/sda7 //format SDA7 partition into ext2 format extended knowledge: Mkfs Use example [ Root@localhost beinan]# mkfs-t file system storage device NOTE: Here the file system is to be specified, such as ext3; reiserfs; ext2; fat32; msdos. Equipment such as the partition of a hard disk, floppy disk, optical drive, etc... ... Before you format the partitions, you need to know how to view the hard disk partitions, and to format them in a targeted way; for example, use fdisk -l to see: Linux View Disk partitions, file systems, usage commands and related tools introduction For example, I would like to format a mobile U disk in a partition; The panorama should be: [root@localhost beinan]# fdisk-l disk/dev/hda:80.0 GB, 80026361856 bytes 255 heads, 6 3 Sectors/track, 9729 cylinders Units = cylinders of 16065 * (8225280) bytes Device Boot &nb Sp; start end blocks id system/dev/hda1 * 1 765 6144831 7 hpfs/ntfs/dev/hda2 766 2805 16386300 c w95 FAT32 (LBA)/dev/hda3 2806 9729 55617030 5 extended/dev/hda5 2806 3825 8193118+ 83 linux/dev/hda6 3826 5100 10241406 83  LINUX/DEV/HDA7 5101 5198 787153+ 82 linux Swap/solariS/dev/hda8 5199 6657 11719386 83 linux/dev/hda9 6658 7751 8787523+ 83 linux/dev/hda10 7752 9729 15888253+ 83 Linux disk/dev/sda:1035 MB, 1035730944 bytes 256 heads, sectors/track, cylinders Units = cylinders of 16128 *, 8257536 bytes De Vice Boot start end blocks id system/dev/sda1 1 201568+ 83 linux/dev/sda2 26 125 806400 5 extended/dev/sda5 26 50 201568+ 83 linux/dev/sda6 51 76 200781 83 linux We can see that there are SDA this device, so you can use Fdisk-l/DEV/SDA specifically to show his partition situation; For example, I want to format the/DEV/SDA6 partition as Ext3 file system: [root@localhost beinan]# mkfs-t ext3 /dev/sda6 mke2fs 1.37 (21-mar-2005) filesystem label= OS Type:li Nux block size=1024 (log=0) Fragment size=1024 (log=0) 50200 inodes, 200780-Blocks 10039 blocks (5.00%) reserved for the Super User-A-block=1 Maximum filesystem blocks=67371008-Block groups 8192 Per group, 8192 fragments/Group 2008 inodes per group superblock backups stored on blocks:8193, 24577, 40961, 57345, 73729 Writing inode tables:done creating journal (4096 blocks): Done writing superblocks and filesystem accounting Info rmation: Note: direct return here; done This filesystem'll be automatically checked every-mounts or 180 days,&nbs P Whichever comes. use tune2fs-c or-i to Overr IDE. So the format is good, Sda6 is now the ext3 file system, we can load the partition with mount, and then use the file system; [Root@localhost beinan]# Mkdir /mnt/sda6 [root@localhost beinan]# chmod 777/mnt/sda6 [root@localhost beinan]# Mount/dev/sda6 Nbsp;/mnt/sda6 Of course you can also format the partition into other file systems; For example, we format the/dev/sda6 as Ext3, ext2, REISERFS, FAT32, MSDOS file system, and the command format is as follows: [root@localhost beinan]# mkfs-t ext3 /dev/sda6 [root@localhost beinan]# mkfs-t ext2 /dev/sda6 [root@localhost beinan]# mkfs-t reiserfs /dev/sda6 [root@localhost beinan]# mkfs-t FAT32 /dev/sda6 [Root@lo Calhost beinan]# mkfs-t msdos /dev/sda6 ... 2) mkfs.ext3 mkfs.reiserfs mkfs.ext2 mkfs.msdos m introduction of Kfs.vfat mke2fs; After we have said a mkfs tool, we'll introduce MKFS.EXT3 mkfs.reiserfs mkfs.ext2 Mkdosfs mkfs.msdos mkfs.vfat, in fact mkfs in the execution of the command Time, is also called this tool, this is the main reason I introduced mkfs first; by filename, we know what file systems these tools support; [Root@localhost beinan]# MKFS.EXT3 /dev/sda6 Note: Format the device into Ext3 file system [root@localhost beinan]# Mke2fs-j & NBSP; /DEV/SDA6 Note: Format the device into Ext3 file system [root@localhost beinan]# MKFS.EXT2  /DEV/SDA6 Note: Format the device into ext2 file system root@localhost beinan]# mke2fs  /DEV/SDA6 Note: Format the device into ext2 file system [root@localhost beinan]# mkfs.reiserfs /dev/sda6 Note: Format the device into Reiserfs file system [root@localhost beinan]# Mkfs.vfat /dev/sda6 Note: Format the device into FAT32 file system [root@localhost beinan]# Mkfs.msdos /dev/sda6 Note: Format the device into a FAT16 file system, Msdos file system is FAT16; [root@localhost beinan]# Mkdosfs /dev/sda6 NOTE: Format the device into FAT16 file system, with mkfs.msdos ...
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service