Partitioning larger than 2T using the parted tool under Linux

Source: Internet
Author: User

A key word

Transfer from http://dngood.blog.51cto.com/446195/647702/

limitations of MBR and 2TB
When using Fdisk to create a partition, we can only create a partition of 2TB size, if your disk (array) is larger than 2TB, only by dividing multiple partitions to make full use of disk capacity, which is less than the 2TB partition of friends, but for the use of more than 2TB partition ( For example, 5TB partition) Friends will encounter problems, to break through this limit, we first understand the next MBR (Master Boot Record) and GPT (GUID Partition Table).


MBR
The master boot record, which is also called the boot sector, is the first sector that must be read when the computer accesses the hard disk, and its three-dimensional address on the hard disk is (cylinder, head, sector) = (0,0,1).

MBR is produced by a partitioner (such as fdisk,parted), which does not depend on any operating system, and the hard drive boot program can also be changed to enable multi-system booting.

The structure of the master boot record lets you know that it contains only a 64-byte hard disk partition table. Because each partition information requires 16 bytes, it is possible to identify up to 4 primary partitions for a hard disk with MBR-type partition structure (the Disk volume label type is MS-DOS). Therefore, it is not possible to get more than 4 primary partitions for a hard disk with this partition structure. You need to draw out the extended partition here. An extended partition is also a primary partition (Primary partition), but it differs from the primary partition in that it can theoretically be divided into countless logical partitions, each with an extended boot record (EBR) similar to the MBR structure.
In the MBR partition table, up to 4 primary partitions or 3 primary partitions + one extended partition, which means that the extended partition can only have one, and then subdivided into multiple logical partitions.
On a Linux system, the hard disk partition is named SDA1-SDA4 or HDA1-HDA4 (where a means that the hard disk number may be a, B, C, and so on). On an MBR hard disk, partition number 1-4 is the primary partition (or extended partition), and the logical partition number can only start at 5.
In the MBR partition table, the maximum capacity of a partition is 2T, and the starting cylinder for each partition must be within the first 2T of the disk. You have a 3T hard drive, you have to divide it into 2 partitions at least, and the starting sector of the last partition is in the first 2T space of the hard disk. If the hard disk is too large, you must use GPT instead.



GPT
The globally unique identity partition table (GUID Partition table, abbreviation: GPT) is the partition structure of an entity hard disk. It is part of the EFI (Extensible Firmware Interface standard) to replace the master boot Record partition table in the BIOS. However, because the MBR partition table does not support partitions larger than 2.2TB (2.2x1012 bytes), there are some BIOS systems that replace MBR partitioned tables with GPT partitioned 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 master boot record also stores the system's boot program). However, in GPT hard disks, the location information of the partitioned table is stored in the GPT header. For compatibility reasons, however, the first sector of the hard disk is still used as an MBR and then the GPT header.

GPT disk partitioning style supports a maximum volume of 18 compared to the style of MBR disk partitioning that supports a maximum volume of 2 TB (terabytes) and a maximum of 4 primary partitions per disk (or 3 primary partitions, one extended partition and unlimited logical drives) EB (exabytes) and there is no upper limit on the number of partitions per disk, only limited by the operating system (because the partition table itself needs to occupy a certain amount of space, initially planning the hard disk partition, the space left to the partition table determines the maximum number of partitions, the IA-64 version of Windows limited to a maximum of 128 partitions, This is also the minimum size of the partition table as specified by the EFI standard). Unlike MBR partitioned disks, critical platform operational data is located in partitions, not in non-partitioned or hidden sectors. In addition, the GPT partition disk has a backup partition table to improve the integrity of the partitioned data structure.


EFI
The Extensible Firmware Interface (English name extensible Firmware Interface or EFI) is a personal computer system specification used to define the software interface between the operating system and the system firmware, as an alternative to the BIOS upgrade scheme. The Extensible Firmware Interface is responsible for the power-on self-test (POST), the connection operating system, and the interface that connects the operating system to the hardware.
EFI was originally developed by Intel and is now being promoted and developed by the UEFI Forum.


UEFI
is developed by EFI1.10, its owner is no longer intel, but an international organization called Unified EFI form, contributors have Intel,microsoft,ami, and several manufacturers, belonging to open source, the current version is 2.1.

Second, the use of parted tools

Transferred from: http://www.cnblogs.com/einyboy/archive/2012/09/12/2681669.html

File System Limitations:
The following information is derived from: Wikipedia
Ext3
Block size maximum file size Maximum file system size
1KiB 16GiB 2TiB
2KiB 256GiB 8TiB
4KiB 2TiB 16TiB
8KiB 16TiB 32TiB

Ext4
Extents
Ext4 introduced the extent file storage method to replace the block mapping mode used by EXT2/3. Extent refers to a series of contiguous block blocks, which can increase the efficiency of large archives and reduce the fragmentation of files. The single extent supported by the EXT4 is up to 128mb[1 in a single block 4KB system. 4 extent can be stored in a single inode, and more than four extent will be indexed in htree manner.
Maximum file Size-TiB (for 4k block filesystem)
Maximum volume capacity 1 EiB

Xfs
The maximum supported file size is 263 = 9 x 1018 = 9 exabytes, and the maximum file system size is exabytes.

Reiserfs
Maximum file size 8 TiB
Maximum volume capacity (TiB)

Disk partitioning method greater than 2T

Since the MBR partition table supports only 2T disks, disks larger than 2T must use GPT partitioned tables, as follows:

The

GPT-formatted disk is equivalent to the original MBR disk in the original reserved 4 partition table 4*16 bytes, leaving only the first 16 bytes, similar to the extended partition, the real partition table after 512 bytes, GPT disks do not have a limit of four primary partitions.
But Fdisk does not support GPT, and we can use parted to operate on GPT disks. The
parted feature is powerful and can be used either at the command line or interactively
at the prompt to enter parted into interactive mode, and if there are multiple disks, we need to run select SDX x as disk for disk selection

Parted>
Parted>select SDB assumes that the disk is SDB
Parted>mklabel GPT to format MBR disks as GPT
#parted >mklabel msdos to convert GPT disks to MBR disks
Parted>mkpart Primary 0 100 divides a primary partition with a starting position of 0 and a size of 100M
Parted>mkpart Primary 100 200 divides a primary partition with a starting position of 100M and a size of 100M
#parted >mkpart Primary 0-1 divides the entire disk into a single partition
Parted>print Printing the current partition
Parted>quit exit

More commands for parted:

Check number do a simple check on the file system
CP [From-device] from-number to-number Copy file system to another partition
Help [COMMAND] prints general help, or help on
COMMAND
Mklabel Label-type Create a new Disklabel (partition
Table
MKFS number Fs-type make a Fs-type file system on
Partititon number
Mkpart Part-type [Fs-type] START END make a partition
Mkpartfs part-type fs-type START END make a partition with a file system
Move number START END move partition number
Name Number name name partition number as name
Print [free| Number|all] Display the partition table, a
partition, or all devices
Quit Exit Program
Rescue start END Rescue a lost partition near START
and END
Resize number START END Resize partition number and its file
System
RM Number Delete Partition number
Select Device Choose the DEVICE to edit
Set number flag state change the FLAG on partition number
Toggle [Number [FLAG]] toggle the state of FLAG on partition
Number
Unit unit Set the default unit to unit
Version displays the current version of the GNU

Ext3 file system is not supported in parted, so if you want to use it, exit parted to format

Mkfs.ext3/dev/sdx1

Because Fdisk does not support GPT disks, do not use fdisk-l to see the area where the X disk was just divided.
Command-line mode:
After converting the hard disk to a GPT disk, execute the following command

PARTED/DEV/SDX Mkpart Primary 0 #划分一个起始位置为0大小为100M的主分区

PARTED/DEV/SDX Mkpart primary XFS 0-0 #划分所有空间

Third, instance operation

Environment

Host: IBM x3850 X5

os:rhel5.4 x64

Storage: IBM v3500

Storage Connection mode: iSCSI

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.