From the previous study, we know that the disk can be divided into multiple partitions, each partition can be advanced format after the formation of a file system. So how do you create partitions in a Linux system?
Use the FDISK command to create a partition
The syntax format is: fdisk [-l] Device file name ( cannot add number )
-L: Displays the contents of all partitions on the specified hard disk. Without the device, all the partition contents of all the devices on the system are displayed.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/37/F7/wKioL1OxdfCBfZgFAACraipTq48233.jpg "title=" F.png " alt= "Wkiol1oxdfcbfzgfaacraiptq48233.jpg"/>
You can use it to create partitions without any options.
Use the Fdisk device file name (cannot add numbers)
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/37/F8/wKiom1OxeBqi64e9AAHocgHlK-g925.jpg "title=" ff.png "alt=" Wkiom1oxebqi64e9aahocghlk-g925.jpg "/>
Where these subcommands represent the following meanings:
P: Displays all partitions above the current hard drive, including those not saved.
N: Indicates the creation of a new partition
D: means to delete a partition
W: Save and exit
Q: Do not save exit
T: Modify the partition type
L: Displays all the partition types supported by this drive
After you create a partition, how do you see all the partitions on the disk?
Use the DF command to display the usage of all partitions on the disk
DF [-AIHP] [partition]
If not partitioned, displays the usage of partitions on the entire disk
-A: Displays all file system usage, including system-specific/proc and other file systems
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/37/F8/wKiom1Oxe3Ty7gMWAACj4YBHJbQ342.jpg "title=" A.png " alt= "Wkiom1oxe3ty7gmwaacj4ybhjbq342.jpg"/>
-I: Inodes is displayed instead of hard disk capacity
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/37/F8/wKiom1Oxe-SDmqqjAABg1F_VlWI138.jpg "title=" I.png " alt= "Wkiom1oxe-sdmqqjaabg1f_vlwi138.jpg"/>
-H: Displays the size in the form of Gbyte,kbyte,mbyte
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/37/F7/wKioL1OxfHijlX0GAAB9v3aG7s4241.jpg "title=" H.png " alt= "Wkiol1oxfhijlx0gaab9v3ag7s4241.jpg"/>:
-P: Data is displayed on the same line
When we use the FDISK command to create a partition, using the DF command is not showing the contents of the new partition, because the new partition is not recognized by the kernel at this time, only the next restart or manually forced reread partition table can be displayed.
Manually forcing the Read partition table (/proc/partition) to use the Partprobe command allows the kernel to reread the partition table.
Du: Displays the size of the directory and subdirectories
-S: Displays only the size of the specified directory and does not show the size of the subdirectories
-H: Displays the size in the form of Gbyte,kbyte,mbyte
This article from the "Linux Learning Path" blog, declined reprint!