How to mount a 4 TB hard disk in CentOS 6.X, centos4tb

Source: Internet
Author: User

How to mount a 4 TB hard disk in CentOS 6.X, centos4tb

One task at hand is to back up some of the company's important data locally. It uses Seagate's 4 TB hard drive.

If you directly use the fdisk partition for a 4 TB hard disk, the following warning is displayed:

WARNING: GPT (GUID Partition Table) detected on '/dev/sde'! The util fdisk doesn't support GPT. Use GNU Parted.

The partition result is only 2 TB.


As a result, there is a problem: how to mount a 4 TB hard disk on the system, only one partition.

The parted command can be used to partition a single partition in GPT format greater than 2 TB, or a common MBR partition. The fdisk command cannot be used to partition partitions larger than 2 TB, therefore, fdisk cannot be used to view the GPT format partition divided by parted.


Here we need to use a tool: parted.

Install the parted tool:

yum install -y parted

Command Parameters of the parted tool:

Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...] apply COMMANDs with PARAMETERS to DEVICE. if no COMMAND (s) are given, run ininteractive mode. option:-h, -- help displays the help information-l, -- list lists partition layout on all block devices-m, -- machine displays machine parseable output-s, -- script never prompts the user-v, -- version displays version-a, -- align = [none | cyl | min | opt] alignment for new partitions command: align-check type n check partition N for TYPE (min | opt) alignment 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] print general help, or help on COMMAND mklabel, mktable LABEL-TYPE create a new disklabel (partition table) mkfs NUMBER FS-TYPE make a FS-TYPE file system on partition 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 [devices | free | list, all | NUMBER] display the partition table, available devices, free space, all found partitions, or a participating partition 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 edit set number flag state change the FLAG on partition NUMBER toggle [NUMBER [FLAG] toggle the state of FLAG on partition NUMBER unit set the default UNIT to unit version display the version number and copyright information of GNU Parted
Chinese explanation:

Usage: parted [options] [device [command [options...] options-h display help information-l display the block device operated on by the partition device on all Block devices. If not specified, use the first block device command [options...] check partition to perform a simple check on the partition cp [source-device] source dest copy the source partition on the source-device to the dest partition of the current device mklabel label-type to create a new partition table type, label-type can be: "bsd", "dvh", "gpt", "loop", "mac", "msdos", "pc98 ", or "sun" is generally in msdos format on PCs. If the partition is larger than 2 TB, you need to use a partition table in gpt format. Mkfs partition fs-type creates a fs-type file system in the partition. The fs-type can be: "fat16", "fat32", "ext2 ", "linux-swap", "reiserfs" note that ext3 format file systems are not supported. You can only partition and format them with private commands. Mkpart part-type [fs-type] start end creates a part-type partition. The part-type can be: "primary", "logical ", or "extended" If fs-type is specified, the partition is formatted while the partition is created. Start and end indicate the start position of the partition. The default unit is M. Eg: mkpart primary 0-1 0 indicates the start of the partition-1 indicates the end of the partition, which means to divide the entire hard disk space into the primary partition mkpartfs part-type fs-type start end to create a fs-type part-type partition, it is not recommended that you use mke2fs for formatting after mkpart partitioning is complete. Name partition name sets a name for the partition. This setting can only be used in partition tables of the Mac, PC98, and GPT types, when the name is enclosed in quotation marks, when the select device has multiple hard disks on the machine, select the hard disk resize partition start end to adjust the partition size rm partition delete a partition rescue start end to save a partition unit between stat and end when it is in the previous partition, the unit of the default partition Hour value is M. This parameter changes the default unit, "kB", "MB", "GB ", "TB" move partition start end move partition print display partition table information quit exit parted

After learning about parted, we can complete our task:

1. Run the following command to enter the interactive mode and view the current hard disk partition information:

parted /dev/sdep


2. Delete the existing partition and view the result here. (To write this tutorial, I deleted the hard disk that has just been partitioned. ^ ~ ^ !!)

rm 1p


3. format the hard disk as gpt

mklabel gpt


4. Partition the disk into one area.

mkpart primary 0 -1Ignore

Parted: executing mkpart primary will directly partition (and fdisk needs to be saved)

5. Exit parted.

quit

6. After the partition is completed, you can format the partition:

mkfs.ext4 /dev/sde1


7. Attach a hard disk

mount /dev/sde1 /var/XXX

Finally, we are done.

Scatter flowers !!!!


Scan the following QR code to follow my public account: codemanship)


Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.