Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Partitioning tools with parted-- greater than 2T

Shulou Source: shulou.com Published: 2022-06-01 05:24:18 10月04日 Update

Summary: parted is a disk partitioning tool

The traditional MBR partitioning method has one limitation:

Cannot support hard disk partitions that exceed 2TB (or a single partition exceeds 2TB)

If it is greater than 2T, use the concept of GPT partition

The partition table of GPT solves the problem that traditional MBR cannot exceed the limit of 2TB.

However, in linux systems, traditional fdisk commands cannot support gpt partitioning.

The operation of parted is real-time:

That is to say, if you execute a partition command, it will actually partition, instead of, like fdisk, you need to execute the w command to write the changes made, so testing parted should never be used in a production environment.

How to use it:

Interactive:

Parted / dev/sdb

Mklabe gpt-- > yes modify the partition format to gpt

# create Partition method

# mkpart PART-TYPE [FS-TYPE] START END

# mkpart partition type file system type start and end location

Mapart primary 0 1000-> Ignore creates a primary partition with a size of 1000m

Mkpart primary linux-swap 1001 2000 create swap Partition

Mkpart logical ext4 2001 5000 create logical partitions

P View the partitions that have been created

Rm NUMBER deletes a partition, represented by a serial number

Non-interactive:

Parted / dev/sdb mklabe gpt YES

Parted / dev/sdb mapart primary 0 1000 Igore

Parted / dev/sdb mkpart primary linux-swap 1001 2000 Ignore

Parted / dev/sdb mkpart logical ext4 2001 5000

Parted / dev/sdb p

Tags: Traditional command interactive location method method type system support tool that is use method single size real-time sequence serial number file format Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Xiaomi Docker Redmi OPPO Reno