Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Case Analysis of creating Partition larger than 2TB in MBR and GPT Partition format

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

MBR and GPT partition format to create more than 2TB partition example analysis, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

A key word

Limitations of MBR and 2TB

When using fdisk to set up partitions, we can only build partitions of 2TB size at most. If your disk (array) is larger than 2TB, you can only make full use of disk capacity by dividing multiple partitions. This has no effect on friends who use less than 2TB partitions, but for those who use larger 2TB partitions (such as 5TB partitions), they will encounter problems. It is necessary to break this limit. Let's first take a look at MBR (Master Boot Record) and GPT (GUID Partition Table).

MBR

The master boot record (Master Boot Record, abbreviation: MBR), also known as the master boot sector, is the first sector that must be read when the computer is booted to access the hard disk. Its three-dimensional address on the hard disk is (cylinder, head, sector) = (0mem0jin1).

MBR is generated by partition programs (such as Fdisk,Parted), which does not depend on any operating system, and the hard disk bootloader can be changed to achieve multi-system boot.

As you can see from the structure of the master boot record, it contains only a 64-byte hard disk partition table. Because each partition information requires 16 bytes, for a hard disk with MBR partition structure (whose disk volume label type is MS-DOS), a maximum of 4 primary partitions can be identified. Therefore, for a hard disk with this partition structure, it is impossible to get more than 4 main partitions. Here we need to draw out the extended partition. Extended partition is also a kind of primary partition (Primary partition), but it differs from primary partition in that it can theoretically be divided into numerous logical partitions, each of which has an extended boot record (EBR) similar to MBR structure.

In the MBR partition table, there are up to 4 primary partitions or 3 primary partitions + 1 extended partition, which means that there can be only one extended partition, which can then be subdivided into multiple logical partitions.

In Linux systems, the hard disk partition is named sda1-sda4 or hda1-hda4 (where a means the hard disk number may be a, b, c, and so on). On the MBR hard drive, partition number 1mur4 is the primary partition (or extended partition), and the logical partition number can only start with 5.

In the MBR partition table, the maximum capacity of a partition is 2T, and the starting cylinder of each partition must be within the first 2T of the disk. You have a 3T hard drive, which is required to be divided into at least two partitions, and the starting sector of the last partition should be located in the first 2T space of the hard drive. If the hard drive is too large, you must use GPT instead.

GPT

The global unique identification partition table (GUID Partition Table, abbreviated: GPT) is the partition structure of a physical hard disk. It is part of EFI (Extensible firmware Interface Standard) to replace the master boot record partition table in BIOS. However, because MBR partition tables do not support partitions with a capacity larger than 2.2TB (2.2 × 1012 bytes), some BIOS systems replace MBR partition tables with GPT partition tables in order to support large-capacity hard disks.

In the MBR hard disk, the partition information is stored directly in the master boot record (MBR) (the system's boot program is also stored in the master boot record). However, in the GPT hard disk, the location information of the partition table is stored in the GPT header. However, for compatibility reasons, the first sector of the hard disk is still used as the MBR, followed by the GPT header.

Compared with the MBR partition style that supports a maximum volume of 2 TB (Terabytes) and up to 4 primary partitions per disk (or 3 primary partitions, 1 extended partition and unlimited logical drive), the GPT partition style supports a maximum volume of 18 EB (Exabytes) and there is no upper limit on the number of partitions per disk, which is only limited by the operating system (because the partition table itself takes up a certain amount of space, when the hard disk partition was originally planned The space left for the partition table determines the maximum number of partitions you can have, and the IA-64 version of Windows limits a maximum of 128 partitions, which is the minimum size of the partition table specified by the EFI standard. Unlike MBR partitioned disks, critical platform operation data is located in partitions, not in non-partitioned or hidden sectors. In addition, GPT partition disks have backup partition tables to improve the integrity of the partition data structure.

EFI

Extensible firmware interface (English name Extensible Firmware Interface or EFI) is a personal computer system specification, which is used to define the software interface between operating system and system firmware, as an alternative to BIOS upgrade scheme. The extensible firmware interface is responsible for power-on self-test (POST), connecting to the operating system, and providing an interface between the operating system and hardware.

EFI was originally developed by Intel and is now promoted and developed by UEFI Forum.

UEFI

Is developed on the basis of EFI1.10, its owner is no longer Intel, but an international organization called Unified EFI Form, contributors are Intel,Microsoft,AMI, and other major factories, belonging to open source, the current version 2.1.

Create a partition larger than 2TB

Both MBR and GPT are partition formats, in which the maximum partition of MBR is less than or equal to 2TB, while the partition of GPT has no restriction of 2TB. The theoretical maximum partition is 18 EB!

Now we know that to create a partition larger than 2TB, we cannot use the partition table in MBR format, but to use the partition table in GPT format, our most commonly used fdisk partition tool can not help, we need to use the Parted partition tool under linux!

The test environment is:

Dell R710 2u server

Cpu 2 * XEON 5606

Mem 16G

Disk 6*1TB sas 7200rpm

Raid raid level 5 perc 6i card

Rhel 6 64bit, create a 4TB size partition

The following is the official start of zoning:

1 before using parted partition, let's use fdisk-l to check the hard disk information!

2 We know the information above / dev/sdb 4.6TB, now use the parted command, as shown in the following figure.

3 after entering the parted, perform the 11 steps of 2, 3, 4, 5, 6 and 7, 8, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11 steps, there is an explanation below!

5 quit is used to exit the parted environment, and the message prompts you to update / etx/fstab!

7 parted is done here!

The / dev/sdb1 file system is formatted as EXT4 below:

1 execute mkfs.ext4 / dev/sdb1 and enter all the way!

Add the UUID of / dev/sdb1 to / etc/fstab,/dev/sdb1 and mount it in the / data directory!

3 introduce the Parted command in detail

[root@abintel] # parted-- help

Usage: parted [option]. [device [command [parameter].].]

Apply a command with parameters to the device. If no command is given, it runs in interactive mode.

Options:

-h,-- help displays this help message

-I,-- interactive prompts the user if necessary

-s,-- script never prompts the user

-v,-- version display version

Command:

Check MINOR to do a simple check on the file system

Cp [FROM-DEVICE] FROM-MINOR TO-MINOR copies the file system to another partition

Help [COMMAND] print general help information, or information about COMMAND

Mklabel label type creates a new disk label (partition table)

Mkfs MINOR file system type creates a file system of type "file system type" in MINOR

Mkpart partition type [file system type] start point end point create a partition

Mkpartfs partition type file system type start point end point create a partition with a file system

Move MINOR start and end points move the partition numbered MINOR

Name MINOR name names the partition numbered MINOR "name"

Print [MINOR] print partition table, or partition

Quit exit program

Rescue starting point and ending point saves the lost partition near the "starting point" and "ending point"

Resize MINOR start and end points change the size of the file system in the partition numbered MINOR

Rm MINOR deletes the partition numbered MINOR

Select device Select the device to edit

The set MINOR flag status changes the flag of the partition numbered MINOR

Be careful

Mklabel label-type must be of the following types:

* bsd

* loop (raw disk access)

* gpt

* mac

* msdos

* pc98

* sun

Example: (parted) mklabel gtp or (parted) mklabel msdos

Mkpart (create a new partition)

Format: mkpart part-type fs-type start end

Create a new partition

Part-type is one of the following types: primary (primary partition), extended (extended partition), and logical (logical partition).

Fs-type to specify the file system, such as ext4.

Start and end are the exact locations where the new partition begins and ends. 0 for start and end,-1 for end, either mb or GB!

After reading the above, have you mastered the method of instance analysis of creating partitions larger than 2TB in MBR and GPT partition formats? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report