Home > Article > Operation and Maintenance > What is the command to create a disk partition in linux
The command to create a disk partition in Linux is fdisk. The specific method is: 1. Enter root and check the partition status of all disks; 2. Execute the command [fdisk /dev/sdc] to partition the sdc disk; 3. Enter n and p in order to create the primary partition.
The command to create a disk partition in Linux is:
fdisk 磁盘
(Recommended tutorial: linux tutorial)
Method for disk partitioning:
1. Enter root;
2. Enter (this command will display all disks that are not partitioned)
fdisk -l
3. To partition the sdb, enter the command:
fdisk /dev/sdc
to partition the sdc disk, then enter m to view the help, and finally enter p to view the partitions of the disk. Condition.
4. Enter n to create a new partition, as shown in the figure:
5. According to the prompt in the picture above, enter p to create a primary partition. You will be prompted to create the ID number of the primary partition. A maximum of 4 primary partitions can be created on a disk.
6. Enter 1 according to the prompts. It will help you create a partition directory of /dev/sdc1. At this time, you will be prompted for the starting and ending positions of the partition. The first cylinder represents the starting position, and the last cylinder represents the ending position
7. Finally, you can enter p to view The situation of the partition just now:
#8. Enter w to save the changes and exit.
The above is the detailed content of What is the command to create a disk partition in linux. For more information, please follow other related articles on the PHP Chinese website!