One, Fdisk partitioning tool
Fdisk is an old partition tool from IBM that supports most operating systems, and almost all Linux distributions are equipped with FDISK, including the Linux resuce mode.
Fdisk is an MBR-based partitioning tool, so if you need to use GPT, you cannot partition with Fdisk.
Second, Fdisk is simple and practical
Third, testing
I installed the centos-6.9-x86_64 system in vitual box and added a 10G virtual SATA hard drive to test the following.
1. List partition information
As you can see, there are two SATA hard drives/dev/sda and/dev/sdb. The number of heads, number of sectors, and number of cylinders for both drives are also listed. Among them, the first hard disk has two partitions/dev/sda1,/dev/sda2, the 2nd hard disk does not have the partition.
Start is the start cylinder, end is the ending cylinder, Blocks is the partition capacity (or size), the Id is the partition type Id,system is the partition type.
2. Confirm Partition Information
Below, I use the fdisk/dev/sdb command to format the second SATA hard disk partition, which is an interactive interface:
3. Add Primary partition
Confirm that there are no partitions, add the primary partition below:
4. Add an extended partition
Add an extended partition:
5. Adding logical partitions
Now, with the primary and extended partitions, I add a logical partition to the extended partition:
Note that the partition type for both SDB1 and SDB5 is number 83rd Linux type.
6. Built-in encoding table
The specific ID and System can be viewed through the L or L directives, and the following are some of the coding tables built into Linux:
Of course, you can use the t instruction to modify the partition ID if necessary.
7. Write to the partition table, exit
Finally, save the current partitioning scheme with the W directive:
8. List partition information
OK, now let's look at the new partition information:
RELATED links: linux_fdisk command explanation
Linux Learning Record: Seven, Fdisk partitioning tool