Disk Formatting mke2fs

Source: Internet
Author: User

Commands: Mke2fs, MKFS.EXT2, MKFS.EXT3, MKFS.EXT4


MKE2FS Common options are:


-B partition sets the size of each data chunk footprint, currently supports 1024, 2048, and 4096 bytes per block

-I set the inode size

-N Sets the number of inode, sometimes using the default inode count, so you have to customize the inode number

-C before formatting the disk to detect whether there is a problem, plus this option will be very slow

-L PRESETS the label of the partition label

-J create EXT3 format partition, if you use MKFS.EXT3, you don't have to add this option.

-T is used to specify what type of file system it can be ext2, ext3, or EXT4

-M format, specifies the percentage of the disk that is reserved to the administrator, and is only for the MKE2FS command

[Email protected] ~]# mke2fs-t EXT4/DEV/SDB5

MKE2FS 1.41.12 (17-may-2010)

File System label =

Operating system: Linux

Block size =4096 (log=2)

Chunked size =4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

66384 inodes, 265056 blocks

13252 blocks (5.00%) reserved for the Super user

First block of data =0

Maximum filesystem blocks=272629760

9 Block groups

32768 blocks per group, 32768 fragments per group

7376 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376

Writing Inode table: complete

Creating Journal (8192 blocks): complete

Writing Superblocks and FileSystem accounting information: Complete

This filesystem'll be automatically checked every mounts or

Whichever comes first. Use Tune2fs-c or-i to override.

Specifies that the file system format is EXT4 and that the command is equivalent to MKFS.EXT4/DEV/SDB5. One of the indicators in the example above is that "block size = 4096" Here involves a "block" concept. When the disk is formatted, the size of each block is pre-defined, and then all of the space is divided into one small block, and the data is stored in a block of the write. Ext File system default block size is 4096 that is 4k. When formatting, you can specify a block size of 1024, 2048, 4096 (which are multiplied). Although you can specify a block size of more than 4096 when you format it, you cannot mount it properly once you have more than 4096.

Specify the block size:

[Email protected] ~]# mke2fs-t ext4-b 8192/DEV/SDB5

Warning:blocksize 8192 not usable in most systems.

MKE2FS 1.41.12 (17-may-2010)

Mke2fs:8192-byte blocks too big for system (max 4096)

Do you want to continue anyway? (y,n) Y //Specify block size of 8192 will prompt, block value setting is too large, we directly input y forced formatting.

Warning:8192-byte blocks too big for system (max 4096), forced to continue

File System label =

Operating system: Linux

Block size =8192 (log=3)

Chunked size =8192 (log=3)

Stride=0 blocks, Stripe width=0 blocks

66336 inodes, 132528 blocks

6626 blocks (5.00%) reserved for the Super user

First block of data =0

Maximum filesystem blocks=150976512

3 Block Groups

65528 blocks per group, 65528 fragments per group

22112 inodes per group

Superblock backups stored on blocks:

65528

Writing Inode table: complete

Creating Journal (4096 blocks): complete

Writing Superblocks and FileSystem accounting information: Complete

This filesystem would be automatically checked every mounts or

Whichever comes first. Use Tune2fs-c or-i to override.

You can use-l to specify a label. The label will be used when the disk is mounted, or it can be written to the configuration file.

[Email protected] ~]# mke2fs-t ext4-l test-b 8192/DEV/SDB5

Command: E2label

This command is used to view or modify the label of a partition

[Email protected] ~]# E2LABEL/DEV/SDB5

TEST

[Email protected] ~]# E2LABEL/DEV/SDB5 TEST123

[Email protected] ~]# E2LABEL/DEV/SDB5

TEST123


Disk Formatting mke2fs

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.