Partition Method larger than 2 TB in Linux

Source: Internet
Author: User
Tags print print

Format and mount a hard disk larger than 2 TB in Linux, partition method larger than 2 TB in Linux, Linux GPT partition...

First, we will introduce two types of partition tables:

MBR Partition Table: (MBR meaning: Master Guide record)

Maximum supported volumes: 2 TB (T; terabytes, 1 TB = 1024 GB)

Limit on partitions: a maximum of four primary partitions or three primary partitions can be added with an extended partition.

GPT Partition Table: (GPT meaning: guid partition table)

Maximum supported volume: 18eb, (E: exabytes, 1eb = 1024 TB)

Each disk supports a maximum of 128 partitions.

Use parted to create a partition with a size greater than 2 TB

1, parted/dev/SDB
You can enter P to print the disk information, view the partition information, and find the start and end positions.

2. mklabel GPT
Set the partition type to GPT.

3, mkpart primary 0% 100%
Primary indicates the primary partition type. 0 indicates the start position of the partition, and 100% indicates the end position of the partition. The same command is: mkpart primary 0-1 or: mkpart primary 0 xxxxxx.

4, print
Print the current partition and check whether the partition settings are correct.
5, quit
Then exit with the quit command.

6,Mkfs. ext3/dev/sdb1

Format the disk. If ext4 is supported, you can choose to format it to ext4, and the problem occurs again when formatting it to ext3. The default block size of ext3 is 4 kb, and the maximum size is 8 TB. During formatting, the size of the specified block is 8 K, which can support up to 16 TB of space. Command: mkfs. ext3-B 8192/dev/sdb2

7. Mount/dev/sdb1/home/

Mount to the/Home Directory

8. automatically mount partitions

After a new partition is created in the system, because the mount Mount fails after the service is restarted, you need to write the partition information to the/etc/fstab file for permanent mounting.
, Edit/Etc/fstabAdd: Enter the red content
/Dev/sdb1 (disk partition)/Home (Mount directory) ext3 (File Format) defaults 0 0
Save and exit. After restart,/dev/sdb1 will be automatically mounted to the/mnt/ABC directory.


Case

The partition table used by fdisk is MBR and Master Boot Record, that is, the Master Boot Record.

The 0-side, 0-side, and 1-sector of the hard disk are the primary boot sectors. fdisk will write 512 bytes of records here, that is, MBR records.

MBR Partition Table: (MBR meaning: Master Boot Record, Master Boot Record)

Maximum supported volumes: 2 TB (T; terabytes, 1 TB = 1024 GB)

Limit on partitions: a maximum of four primary partitions or three primary partitions can be added with an extended partition (unlimited logical drives are supported in the extended partition)

GPT Partition Table: (GPT meaning: guid partition table)

Maximum supported volumes: 18eb, (E: exabytes, 1eb = 2 (10) Pb = 1024pb, 1pb = 2 (10) TB = 1024 TB)

Each disk supports a maximum of 128 partitions.

Certificate -----------------------------------------------------------------------------------------------------------------------------------

Usage of disks larger than 2 TB in Linux: GPT Disk

Two partition tables
MBR Partition Table: (MBR meaning: Master Guide record)
Maximum supported volumes: 2 TB (T; terabytes, 1 TB = 1024 GB)
Limit on partitions: a maximum of four primary partitions or three primary partitions can be added with an extended partition (unlimited logical drives are supported in the extended partition)
GPT Partition Table: (GPT meaning: guid partition table)
Maximum supported volume: 18eb, (E: exabytes, 1eb = 1024 TB)
Each disk supports a maximum of 128 partitions.

Although the fdisk command is interactive and convenient, it cannot be operated on disks larger than 2 TB. What if we want to use disks larger than 2 TB? You can convert a disk to the GPT format.

GPT-format disks are equivalent to 4*16 bytes of four partition tables in the original MBR disk, with only the first 16 bytes left, similar to extended partitions, the real Partition Table is 512 bytes later, and the GPT disk does not have the limit of four primary partitions.
However, fdisk does not support GPT. We can use parted to operate GPT disks.
The parted function is very powerful. It can be used in both the command line and interactive mode.
Enter parted at the prompt to enter interactive mode. If there are multiple disks, run select sdx as the disk to select the disk.
Parted>
Parted> select SDB assume that the disk is SDB.
Parted> mklabel GPT format the MBR disk as GPT
Parted> mklabel msdos converts a GPT disk to an MBR disk.
Parted> mkpart primary 0 100 divide a primary partition with a starting position of 0 and a size of MB.
Parted> mkpart primary 100 200 divide a primary partition with a starting position of m and a size of m
Parted> Print print current Partition

Ext3 file systems are not supported in parted, so if you want to use it, You need to exit parted for format.
Mkfs. ext3/dev/sdx1
Because fdisk does not support GPT disks, do not use fdisk-L to view the partitions allocated to disk X.
Command Line Mode:
After converting a hard disk to a GPT disk, run the following command:
Parted/dev/sdx mkpart primary 0 100 divide a primary partition with a starting position of 0 and a size of MB
 
Detailed usage:
Parted [Option]... [device [Command [parameter]...]
Apply the command with "parameter" to "device ". If no "command" is provided, it is run in interactive mode.
Option:
-H, -- help displays this help information
-I, -- Interactive prompts users when necessary
-S, -- script never prompts users
-V, -- version display version
Command:
Check minor performs a simple check on the file system.
Minor is the partition number used by Linux.
In the msdos disk tag, the primary partition number is 1-4, and the logical Partition Number starts from 5.
CP [from-device] From-minor to-minor copies the file system to another partition.
Minor is the partition number used by Linux. In the msdos disk tag
The partition number is 1-4, and the logical partition starts from 5. Device is usually/dev/hda or/dev/SDA
Help [command] print common help information or command information
Mklabel label type
To create a new disk tag (Partition Table), the "tag type" is any of the following: Aix, BSD, GPT, Mac, dvh, msdos, sun, loop
The mkfs minor file system type is created in minor.
Minor is the partition number used by Linux. In the msdos disk tag, the primary partition number is 1-4, and the logical Partition Number starts from 5.
"File system type" is any of the following: ext3, ext2, FAT32, fat16, HFS, JFS, Linux-swap, NTFS, reiserfs, HP-UFS, sun-UFS, XFS
Mkpart partition type [file system type] Start Point termination point to create a partition.
"Partition type" is one of the main partitions, logical partitions, and extended partitions. "file system type" is any of the following: ext3, ext2, FAT32, fat16, HFS, JFS,
Linux-swap, NTFS, reiserfs, HP-UFS, sun-UFS, XFS. The "Starting Point" and "ending point" are in megabytes. A negative value indicates that the count starts from the last segment of the disk.
Mkpart creates a partition instead of creating a new file system. The file system type can be used to set the appropriate partition ID.

Mkpartfs partition type file system type Start Point End Point create a partition with a file system, "partition type" is one of the main partitions, logical partitions, extended partitions, "starting point"
And the "termination point" are in megabytes. A negative value indicates that the count starts from the last segment of the disk.
Move minor start point stop point move the Partition Number minor. Minor is the partition number used in Linux. In the msdos disk tag, the primary partition number is 1-4,
Logical partitions start from 5. The "Starting Point" and "ending point" are in megabytes. A negative value indicates that the count starts from the last segment of the disk.

Name minor name: Name the partition numbered minor as "name". Minor is the partition number used by Linux. In the msdos disk tag
The partition number is 1-4, and the logical partition starts from 5. Name is any word you need

Print [minor] print the partition table or partition
Quit exit Program
Rescue start point termination point to save the lost partitions near "Start Point" and "End Point"
The ending point of resize minor changes the size of the file system in the partition where the number is minor. Minor is the partition number used by Linux. On the msdos Disk
In the tag, the primary partition number is 1-4, and the logical Partition Number starts from 5. The "Starting Point" and "ending point" are in megabytes. Negative value indicates the end of the Disk
Start to count.
Rm minor deletes the Partition Number minor. Minor is the partition number used by Linux. In the msdos disk tag, the primary partition number is 1-4, and the logical Partition Number starts from 5.

Select device select device to edit
Set minor indicates the ID of the shard whose status changes to minor. Minor indicates the partition number used by Linux. In the msdos disk tag, the primary Partition Number
The value range is 1-4, and the logical partition starts from 5. The "flag" is any of the following: Start, root, swap partition, hide partition, raid, LVM, LBA,
HP-service, palo. Status: On, off

 

 

 

 

 

 

 

Linux disk Partitioning Method larger than 2 TB

 

Because MBR partition tables only support 2 TB disks, GPT partition tables must be used for disks larger than 2 TB. The specific method is as follows:

GPT-format disks are equivalent to 4*16 bytes of four partition tables in the original MBR disk, with only the first 16 bytes left, similar to extended partitions, the real Partition Table is 512 bytes later, and the GPT disk does not have the limit of four primary partitions.

However, fdisk does not support GPT. We can use parted to operate GPT disks.

The parted function is very powerful. It can be used in both the command line and interactive mode.

Enter parted at the prompt to enter interactive mode. If there are multiple disks, run select sdx as the disk to select the disk.

Code

Parted>

Parted> select SDB // assume that the disk is SDB

Parted> mklabel GPT // format the MBR disk as GPT

# Parted> mklabel msdos // convert a GPT disk to an MBR Disk

Parted> mkpart primary 0 100 // divide a primary partition with a starting position of 0 and a size of MB.

Parted> mkpart primary 100 200 // divide a primary partition with a starting position of 100 m and a size of m

# Parted> mkpart primary 0-1 // divide the entire disk into one partition

Parted> Print // print the current Partition

Parted> quit // exit

For your security, please only open the URL with reliable source

Open website {
Function onclick ()
{
Function onclick ()
{
Share. safelink. Close (); Return false;
}
}
} "Href =" http://writeblog.csdn.net/# "> cancel

From: http://hi.baidu.com/52xjm/blog/item/a945accaa3262b90c817683b.html

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.