fdisk Common command parameters
-b< partition size;: Specifies the size of each partition;-L: Lists the partition table health of the specified peripheral device;-s< partition number;: Outputs the specified partition size to the standard output, The unit is a chunk;-u: With the "-L" parameter list, the number of partitions is substituted by the number of columns to represent the starting address of each partition;-V: Displays version information
commonly used commands show:
View the new disk information
[[email protected] omc]# fdisk-l
Operation of one disk
[[email protected] omc]# fdisk/dev/sda2
Enter p to list the current partition of the disk:
Enter n
create a new disk partition, first set up two primary disk partitions:
Confirm that the partition was established successfully:
Then create a logical partition:
Confirm that the extended partition was established successfully:
To establish two logical partitions on an extended partition:
Confirm that the logical partition was established successfully:
Note: The disk number of the primary and extended partitions is 1-4, which means that there are up to 4 primary partitions or extended partitions, and the logical partition starts with a disk number of 5, so there is no SDB4 in this experiment.
Finally, the partition operation is saved:
After the partition is established, we also need to format the partition to use the disk in the system.
To establish the ext2 partition on SDB1:
[Email protected] ~]# MKFS.EXT4/DEV/SDB1
Set up two directories /oracle
and /web
mount the newly created two partitions to the system:
[[email protected] ~]# mkdir/oracle[[email protected] ~]# mkdir/web[[email protected] ~]# Mount/dev/sdb1/oracle[[email Protected] ~]# Mount/dev/sdb6/web
View partition Mount conditions
If you need to automatically mount the boot every time you need to modify /etc/fstab
the file, add two lines of configuration:
The Linux fdisk command is detailed