Rapid partition formatting in Centos is greater than 2 TB large storage capacity

Source: Internet
Author: User
In the production environment, we will encounter a disk with a partition greater than 2 TB (for example, adding a 10 TB storage), because MBR partition tables only support 2 TB disks, therefore, GPT partition tables must be used for disks larger than 2 TB, while multiple VD partitions are used for system installation during raid. However, after the system is installed, all disks cannot be identified, in this case, you need to manually mount the GPT partition. how can I mount a disk larger than 2 TB in linux? I will share this process with you:

In the production environment, we will encounter a disk with a partition greater than 2 TB (for example, adding a 10 TB storage), because MBR partition tables only support 2 TB disks, therefore, GPT partition tables must be used for disks larger than 2 TB, while multiple VD partitions are used for system installation during raid. However, after the system is installed, all disks cannot be identified, in this case, you need to manually mount the GPT partition. how can I mount a disk larger than 2 TB in linux? I will share this process with you:

Tips:

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.

Fdisk does not support GPT Partitioning. we can use parted to operate GPT disks. The parted function is very powerful. it can be used for both command lines and interactions. inputting parted at the prompt will enter interactive mode. if there are multiple disks, run select sdX (X is the disk) to select the disk. you can also use parted/dev/sdX to specify the disk.

[Root @ server ~] # Fdisk-l
Disk/dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065*512 = 8225280 bytes


Device Boot Start End Blocks Id System
/Dev/sda1 × 1 16 128488 + 83 Linux
/Dev/sda2 17 49 265072 + 82 Linux swap/Solaris
/Dev/sda3 50 2610 20571232 + 83 Linux

Disk/dev/sdb: 2190.4 GB, 2190433320960 bytes
255 heads, 63 sectors/track, 266305 cylinders
Units = cylinders of 16065*512 = 8225280 bytes

Disk/dev/sdb doesn' t contain a valid partition table
[Root @ server ~] # Parted
GNU Parted 1.8.1
Using/dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(Parted) select/dev/sdb // select Disk sdb
Using/dev/sdb
(Parted) mklabel gpt // format the MBR disk as GPT
(Parted) mkpart primary 0-1 // divide the entire disk into one partition
(Parted) print

Model: VMware, VMware Virtual S (scsi)
Disk/dev/sdb: 2190 GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 17.4kB 2190 GB 2190 GB primary

(Parted) quit
Information: Don't forget to update/etc/fstab, if necessary.

PS: When a SCSI disk array is attached to a Linux system and the partition size exceeds 2 TB, the mk2fs command cannot be used for formatting, but mkfs is used. the-T largefile parameter must be added when formatting the ext3 command. Otherwise, the formatting process will be very slow. if you add a 10 TB storage, it will be a long process to directly format it in linux, 10 TB, which is estimated to be less than 30 hours.
[Root @ server ~] # Mkfs. ext3-T largefile/dev/sdb1
Try it now. Xtep, flying feeling
[Root @ server ~] # E2label/dev/sdb1/data1 // add (Modify) the/dev/sdb1 label to/data1
[Root @ server ~] # E2label/dev/sdb1 // view the partition label
/Data1
[Root @ server ~] # Mkdir/data1 // create a quota mount point under the/partition
[Root @ server ~] # Mount/dev/sdb1/data1 // manually mount the partition
In this way, the partition is complete and mounted successfully. df? H. The disk size is displayed.
[Root @ server ~] # Df-h
Filesystem Size Used Avail Use % Mounted on
/Dev/sda3 20G 3.9G 15G 22%/
/Dev/sda1 122 M 12 M 104 M 10%/boot
Tmpfs 62 M 0 62 M 0%/dev/shm
/Dev/sdb1 2.0 T 199 M 1.9 T 1%/data1
Finally, you only need to add the following line to fstab to automatically mount the partition.
[Root @ server ~] # Vi/etc/fstab
/Dev/sdb1/data1 ext3 defaults 0 0
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.