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 successfully mounted, and the size of the disk is displayed using df-h.
[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