Disk mount in Linux and use parted to mount disks larger than 2T

Source: Internet
Author: User

The normal mount disk under Linux is fdisk, but Fdisk does not support GPT partitioning (the MBR partition table supports only 2T disks), so the disks to be mounted larger than 2T have to use parted for GPT disk operations!

Parted is powerful and can be used for both command lines and interactivity, and entering parted at the prompt enters interactive mode, and if you have more than one disk, you need to run select SDX (x as disk) for disk selection, or you can directly use the parted/dev/ SDX specify the appropriate hard drive ~

Here are two kinds of mounting plan, do a finishing ~

First, use Fdisk to mount the disk

  code is as follows copy code

     1. Switch to root;
    2. Run the command "FDISK/DEV/XVDB";
    3. According to the prompts, enter "n", "P", "1" in turn;
    4. Press ENTER two times;
    5. Enter "W" when prompted syncing disks. Indicates that the partition was completed successfully;
    6. Enter "MKFS.EXT4/DEV/XVDB1" format the partition;
    7. Enter "Mkdir/myidata" to build the Mount directory
     8. Use the Mount/dev/xvdb1/home command to mount the partition.
    9. Vi/etc/fstab
    Press I
    last line write
    /dev/xvdb1/home ext4 Defaults 0 0

Ii. use parted to mount disks larger than 2T

The code is as follows Copy Code
PARTED/DEV/VDC (partition of 3T hard disk with part command)
Mklabel GPT (you can get 3TB in a partition in GPT format)
Unit TB (set to TB)
Mkpart Logical 0 2 (set to a primary partition, size 3TB, start is 0, end is 3)
Print (show partition size for settings)
Quit (Exit parted program)

MKFS.EXT4/DEV/VDC1 (after executing the above command, use Fdisk-l to view the disk that has already been divided)
Mount/dev/vdc1/home

Ok.

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.