File System Management partition and file system creation

Source: Internet
Author: User

For a mechanical disk, the first is the low-level format of the manufacturer (the process of dividing the track), then need to create a partition (according to the cylinder division), and finally through the advanced format (formatted to use the file system), and then mount (the device associated to the root file system), then the normal use of this disk device

Partition command: Fdisk

This command is an interactive command

fdisk-l [device] to view partitions on all disk devices (or a disk device) of the current system, the output resembles:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/76/25/wKioL1ZL9AOCNKwHAAArn2nkHvs330.png "title=" w]~] Ieu~scpmq9 ' W3cnes0j.png "alt=" Wkiol1zl9aocnkwhaaarn2nkhvs330.png "/>

As you can see, the partitions are divided according to the cylinder surface.

Fdisk device implements partition-related operations on a unit

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/76/28/wKiom1ZL9CvSS3W0AAA8yTQQsPQ759.png "title=" q$ Ehsvzq ' 0@FKYKT6GLEPVC.png "alt=" Wkiom1zl9cvss3w0aaa8ytqqspq759.png "/>

After entering interactive mode, use the M subcommand to view relevant commands and help that can be used

N: Create a new partition

P: Create primary partition

E: Create an extended partition

The primary partition can have up to four, the extended partition can have only one, and the logical partition may have multiple

D: Delete partition

L: Show all types of partitions

T: Modify the partition type

Q: Do not save exit

W: Save exit

For a disk that is in use, the kernel may not be recognized immediately after it is saved, so you need to notify the kernel to reread the partition table

Partprobe command: The default is to reread all devices

Partprobe device: Re-reading a specified

The PARTX command is used on REDHAT6, but Paerprobe is still compatible

Cat/proc/parttions View the partitions that the current kernel has identified


After you create the partition, you can format the new partition (creating the file system)

Although the file system is a function of the kernel, creating a file system requires the use of user-space programs

MKFS command

MKFS [-v] [-t fstype] [fs-options] filesys [blocks]

-V: Output details

-T: Specifies the type of file system created (view the file system types supported by the current kernel: cat/proc/filesystems)

Blocks: How many disk blocks are used

MKFS can create multiple types of file systems, and actually use the-t option after it invokes command creation such as MKFS.EXT3 under the/sbin/directory


MKE2FS: Create/EXT2/EXT3/EXT4 Series File system (default to EXT2 type)

MKE2FS [-C |-l filename] [-B block-size] [-F fragment-size] [-G blocks-per-group] [-G number-of-groups] [-I by Tes-per-inode] [-I inode-size] [-j] [-j jour-nal-options] [-K] [-N number-of-inodes] [-n] [-M Reserved-block  S-percentage] [-O creator-os] [-O feature[,...] ] [-Q] [-R Fs-revision-level] [-e extended-options] [-v] [-f] [-l Volume-label] [-M last-mounted-directory] [-S] [-T Fs-type] [-T Usage-type] [-U UUID] [-v] device [Blocks-count]


-T: File system type (Common-t EXT4)

-j: Created as Ext3

-B: Specify the disk block size (1024,2048,4096 one of them, in bytes)

-G: How many disk blocks are included in each block group

-I: How many bytes each inode occupies

-L: Set the volume label

-N: Number of inode created

-G: Number of block groups created

-I: How much disk space does an inode correspond to?

-S: Only modify the Superblock and GDT tables ( useful in cases where all backup superblock are corrupted, one of the repair methods )

This article is from the "Zxcvbnm Xuan ye" blog, please be sure to keep this source http://10764546.blog.51cto.com/10754546/1713954

File System Management partition and file system creation

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.