Partitioning and formatting of Linux partition disks

Source: Internet
Author: User

Partition mode of MBR partition corresponding to the partition type is MSDOS

No more than four primary partitions

When the maximum capacity of 2TB

GPT partition

There is almost no limit to the number of primary partitions and partition capacity

MBR partitioning: Using fdisk partitioning

parted partition tool both partition modes can be partitioned

Fdisk-l can view the usage of different disks

Fdisk Partitioning tool: can only be partitioned for MBR mode

parted has helpful information

How to switch the target disk: Select Device

Select/dev/sdc

Select partition type: Mklabel GPT (This is the Select hard disk partition table type)

Print all view information on the hard disk partition: Partition mode: Msdos GPT

Two modes of the parted command: Interactive mode (System help), Command mode (one in place)

First Use interactive mode (add Partition): 1. Mkpart

(parted) Mkpart
Partition name? []? Imooc
File system type? [Ext2]? Ext2
Starting point? 0
End point? 2000
Warning: The resulting partition is not a properly aligned for best performance.
Ignore/ignore/abandon/cancel? Cancel
(parted) Mkpart
Partition name? []? Imooc
File system type? [Ext2]?
Starting point? 1
End point? 2000

To view partition results after partitioning using the Print command

Print

Mkpart partition name start point end point

Command mode Add partition: Mkpart Test 2000 3000 (partition name is not saved)

When partitions overlap, humanized processing

Partition TABLE:GPT

Number Start End Size File system Name Flag
1 1049kB 2000MB 1999MB IMOOC
2 2000MB 3000MB 1000MB test

(parted) Mkpart test2 2500 3500
Warning: You requested a partition from 2500MB to 3500MB.
The closest location we can manage are 3000MB to 3500MB.
Is this still acceptable?
Is/yes/no/no? Yes
(parted) Print
Model:vmware, VMware Virtual S (SCSI)
disk/dev/sdc:8590mb
Sector size (logical/physical): 512b/512b
Partition TABLE:GPT

Number Start End Size File system Name Flag
1 1049kB 2000MB 1999MB IMOOC
2 2000MB 3000MB 1000MB test
3 3000MB 3500MB 500MB test2

(parted)

To delete a partition:

RM 3 Delete The number of the partition

Use GB for unit GB

(The parted command does not need to save the partition table with W: Exit directly with quit)

Formatting of partitions:

Format partitioning using the tools of the system: MKFS for partitioning

Ls-l/dev/sdb*: Shows the condition of SDB

MKFS.EXT3/DEV/SDB1 SDB1 This partition into a ext3 file system

Mkfs-t ext4/dev/sdb2 SDB2 This partition into a EXT4 file system

Note: The extended partition in the MBR partition table disk is not formatted, only the primary and logical partitions can be formatted

GPT partition mode using the FDISK command is unable to see the file type of the disk, you must start the parted partition tool, use the Print command

To view the partitioned table of GPT disks

Partitioning and formatting of Linux partition disks

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.