How to partition a disk larger than 2 TB in centos

Source: Internet
Author: User
During work, we often encounter disks larger than 2 TB. Since MBR partition tables only support 2 TB disks, GPT partition tables must be used for disks larger than 2 TB, we will divide multiple VD IDs to install the system during raid, but the system cannot identify all disks after automatic installation. The Administrator sometimes asks to manually mount the partitions, this document describes how to manually mount a disk larger than 2 TB in linux. The specific method is as follows: a GPT-format disk is equivalent to a 4 p retained in the original MBR disk at work. We often encounter a disk larger than 2 T in the partition, because MBR partition tables only support 2 TB disks, GPT partition tables must be used for disks larger than 2 TB. During raid, multiple VD partitions are used for system installation, however, after the system is automatically installed, the system cannot identify all disks. administrators sometimes need to manually Mount partitions. This document describes how to manually mount a disk larger than 2 TB in linux.
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, you can also use parted/dev/sdX to specify the corresponding hard disk.
Enter the parted command in the command line.

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
After completing these steps, you can mount them like other partitions,
To format the hard disk, follow these steps:
Partprobe re-reading the partition information
Mkfs. ext3/dev/sdb1 format the hard disk
E2label/dev/sdb1/data1 add (modify) The/dev/sdb1 label to/data1

E2label/dev/sdb1 can view partition labels

Create a quota mount point under the/partition, that is, create a folder to mount the partition
Mkdir/data1
Mount/data1/data1 or mount/dev/sdb1/data1 to manually mount the partition
In this way, the partition is successfully mounted, and the size of the disk is displayed using df-h.
Add the following line to fstab to automatically mount the partition,
Vi/etc/fstab
/Dev/sdb1/data ext3 defaults 0 0
Save and exit.
Restart the server and test whether the system can automatically mount a disk larger than 2 TB.
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.