Linux entry notes: 7. fdisk partitioning tool, linuxfdisk
I. fdisk partitioning Tool
Fdisk is a legacy partitioning tool from IBM that supports the vast majority of operating systems. fdisk is installed in almost all Linux distributions, including in Linux resuce mode.
Fdisk is an MBR-based partitioning tool. Therefore, if GPT is required, fdisk cannot be used for partitioning.
Ii. Use the fdisk command
Iii. Test
I installed the CentOS-6.9-x86_64 SYSTEM IN THE Vitual Box and added a 10G virtual SATA hard disk, test as follows.
1. List partition information
We can see that there are two SATA hard drives/dev/sda and/dev/sdb. The number of cores, slice, and cylinder of the two hard disks are also listed. The first hard disk has two partitions:/dev/sda1,/dev/sda2, and 2nd hard disks have no partitions.
Start is the Start cylindrical, End is the End cylindrical, Blocks is the partition capacity (or size), Id is the partition type ID, and System is the partition type.
2. Confirm partition information
Below, I use the fdisk/dev/sdb command to format and partition the second SATA hard disk, which is an interactive interface:
3. Add a primary Partition
If no partition is found, add the primary partition below:
4. Add extended partitions
Add an extended partition:
5. Add logical partitions
Now, with primary partitions and extended partitions, I add a logical partition to the extended partition:
Note that the partition types of sdb1 and sdb5 are both of the 83 Linux type.
6. built-in encoding table
The specific id and System can be viewed through the l or L commands. The following are some built-in encoding tables in Linux:
Of course, if necessary, you can use the t command to modify the partition id.
7. Write to the partition table and exit
Finally, use the w command to save the current Partition Scheme:
8. List partition information
Now let's check the new partition information:
Link: linux_fdisk command details