For the use of hard disks, Linux is not exactly the same as Windows. Windows is partitioned, formatted and ready to use, with a separate drive letter for each partition. When Linux is partitioned and formatted, it needs to be loaded into a tree-like directory of Linux for access.
When installing a Linux system, you can use the partition tool for the graphics window, but after installing the system, only the Linux commands are available. The following small series for the grand prize detailed how to use Fdisk for disk partitioning.
Fdisk is a command partitioning tool under Linux, although not parted powerful, but simple to use, its syntax format is as follows:
[[Email protected] ~] #fdisk [-1] [-v] devicename
Examples are as follows:
Creating a partition for/dev/sdb requires creating two partitions, one for the primary partition, 25% for the entire hard disk size, and the other for the logical partition, which is 75% of the size of the entire hard disk. The following are the steps:
1. In the Virtual Terminal window, enter the following command to open/dev/sdb with Fdisk;
[[Email protected] ~] #fdisk-1/dev/sdb
2. At the prompt, enter the following command to complete the creation of the primary partition;
Command (M for help): N #输入n开始创建一个新分区
Command Action
1 logical (1-4)
P #输入p创建一个主分区
Partition number (1-4): 1 #主分区号为1
First cylinder (1-32635,default 1) Direct Enter, set start position is 1
Using default value 1
Last cylinder or+size Or+sizem or +sizek (1-19581,default): +67g partition size 67GB
3. At the prompt, enter the following command to complete the creation of the extended partition;
Command (M for help): N #输入n开始创建一个新分区
Command Action
1 logical (5 or over)
P Primary Partiton (1-4) e #输入e创建一个扩展分区
Partition number (1-4): 2 #扩展分区号为1
First cylinder (1-32635,default 1) Direct Enter, set start position is 8148
Using default value 8148
Last cylinder or+size Or+sizem or +sizek (8148-32635,default 32635); Direct carriage return, which is used to divide the remaining space into an extended partition
4. At command (M for help): prompt, enter the following command to complete the creation of the logical partition as follows
Command (M for help): N #输入n开始创建一个新分区
Command Action
1 logical (5 or over)
P Primary Partiton (1-4) 1 #输入1创建一个逻辑分区
First cylinder (8148-32635,default 8148) Direct Enter, set start position is 8148
Using default value 8148
Last cylinder or+size Or+sizem or +sizek (8148-32635,default 32635); Direct enter to divide the extended partition space into a logical partition
5. Complete the creation of all hard disk partitions, at command (M for help): prompt, enter the following command to save the exit:
Command (M for help): W input w Save to eject
Note: Several common FDISK commands
N: Create a new partition;
P: Displays the current partition status;
D: Delete a partition;
Q: Do not save the disk to exit;
W: Save to withdraw;
C: Switch the DOS boot identity.
AC qq:2881064152 Bun
How Linux uses Fdisk for disk partitioning