MBR partitioning under Linux

Source: Internet
Author: User

MBR Partitioning

Let's talk about how to make an MBR partition for a new hard disk to add to the server, so why is it called MBR partition? We'll talk later.

Do the MBR partition, using the system comes with the fdisk tool. first look at what fdiskis, enter "fdisk"at the command line, as follows:

The above is information about fdisk and related help information.

Then take a look at the partition in the system, enter the command "Fdisk-l" can be. As follows:

It is found that there is a device /dev/sdbin the system, the size is 8589M, we have not partitioned it. Let's make a partition for it.

We enter the partition mode by command "Fdisk/dev/sdb" , as below,

Then we can type "M"to see the Help command, as follows:

These commands are the commands we want to use when partitioning. After understanding the basic commands, let's start partitioning, type "n", as follows:

This lets us choose whether to divide a primary partition or an extended partition. So let's split the main partition, type "P", as follows:

This is where we name the main partition, named 1 . Type 1, as follows:

This starts assigning a size to the primary partition. Note that the size unit here is cylinder, which is the magnetic column. Some versions are not in this unit, but

This is not important, because the basic steps are the same. The range you can type is 1~1044, and if you do not type, the default is 1. Then we'll type 1, as follows:

The starting point of the size is 1, how much does it stop? For example, if you want to assign a 500M size to the primary partition, simply type "+500m" . As follows:

This way, the allocation of the primary partition is completed. Then we can look at the existing partition table, type "P", we can see the main partition we completed, as follows:

From there we can see the main partition we just finished, and we can see that it occupies a 522081 block of data. If you want to continue partitioning, type n, as follows:

Let's do an extended partition this time, type e, as follows:

is still named. Because the primary partition and the extended partition name are 1~4. Just 1 has been assigned to the main partition, so let's name the extended partition 2 .

Type as follows:

is not very familiar with Ah, with just the same steps, but here the scope becomes 66~1044. Let's use the default bar, press enter directly, as follows:

This time we are going to assign 1000M size to it, then type "+1000m", as follows:

In this way, a partition is completed again. Let's take a look at what the partitions are, type p , as follows:

Did you see the two partitions we just made? The next one is the extended partition.

Of course, the extended partition cannot write data, and it needs to join the logical partition. So let's create a logical partition.

Similarly, type n, which indicates the continuation of the partition, as follows:

This discovery has an l option because we just created the extended partition, and the extended partition has only one. Because we're either behind the extended partition.

Create a logical partition or continue creating the primary partition. Type l, as follows:

We found that the magnetic column is still starting from the zero, and the magnetic column is starting from The zero when we just created the extended partition. This means that the logical partition is actually in the extended partition

Part of it. Using default, continue as follows:

This time we give it 1000M, directly to the size of the extended partition allocated to run out. As follows:

Well, our logical partitioning has also been created. Here's a look at a few partitions, type p, as follows:

You can see that the logical partition name is just sdb5.

Be aware that the above is just the partition table we created, and the real partition hasn't started yet. It's like we build a house and draw the blueprints first. So you can also

Modify. Now I want to change, I think the extension partition is too small, want to re-modify its size. How does it work?

Just delete the extended partition and then repartition it. (All logical partitions under the extended partition are automatically and jointly deleted)

Remember what we just named the extended partition? For the number 2 right, then type "D" , as follows:

Then type 2, as follows:

Let's see if it's really deleted, type p, as follows:

The extended partition was deleted along with the logical partition. Let's start the partition again. Type n, as follows:

Still choose to create an extended partition, type e, as follows:

Name again as 2, as follows:

By default, press the enter key, as follows:

This time we choose the remaining size to give the extended partition, type 1044, as follows:

The rest of us can continue to build logical partitions, and I don't have to map the demo. The steps are exactly the same as above.

What happens when we're all zoned out? For example, here is my completed partition table:

Note that the above is just a partition table, the next thing we want to do is to write this partition table to disk, and then it will take effect.

Simply type w and you can write to the disk to take effect. As follows:

Is there any success in our zoning? Use "Fdisk-l" to see it, as follows:

How, is not we just do partition Ah! It worked. This is the basic procedure for MBR partitioning.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Why is MBR partition called?

OK, the basic steps to understand, I would like to say that the MBR partition. This is the title of one of the above partitioning methods. Know can. In fact, this is the traditional partitioning

Method. The characteristics of this method are:

(1) Limited zoning. The primary partition plus the extended partition can only have up to 4 , and the extended partition can have up to 1 .

(2) The primary and extended partitions are named by the ordinal 1~4 , and the logical partitions are named after 5 and subsequent numbers.

(3) The maximum capacity of a single partition is 2TB.

The above is the characteristics of this partition, it can be said that its shortcomings. Correspondingly, there is another partitioning method to solve this problem. In the following article.

Note: Not that the partition is complete, the hard drive is ready to use. Partitioning is only the first step, and it has to be formatted and mounted before it can be used. We'll start with partitioning here.

MBR partitioning under Linux

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.