How Linux uses Fdisk for disk partitioning

Source: Internet
Author: User

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

Related Article

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.