The Linux fdisk command is detailed

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.