Linux disk Partitioning Method larger than 2 TB

Source: Internet
Author: User
Article Title: linux disk Partitioning Method larger than 2 TB. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

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 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 100 M and a size of M.

# Parted> mkpart primary 0-1 divides the entire disk into one partition.

Parted> print current Partition

Parted> quit

More parted commands:

Code

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 partition NUMBER as name

Print [free | NUMBER | all] display the partition table,

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 GNU

Ext3 file systems are not supported in parted, so if you want to use it, You need to exit parted for format.

Code

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:

Code

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

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.