Detailed steps for linux disk partitioning (illustration of how to use linux partition commands)

Source: Internet
Author: User
This article mainly introduces the detailed steps for linux disk partitioning (illustration of how to use linux partition commands). For more information, see

First, we will introduce several simple commands:

Free view the current system memory usage

View partition usage: T type, H display size in G, M

View the partition information of all the hard disks in the system: all partitions without partitions are displayed.

Start partitioning: Why do you want to add a cu without adding it? you need to add it for virtual machine experiments. cu targets virtual hard disks, and virtual hard disks do not have a cylindrical disk.

(M for help) press m to get help

I need to know so much about the parameters. I only know a few of the commonly used iok items: d delete partitions, l view partition types, n add partitions, p print partition tables, q exit and do not save, t modify the partition type, w save

A hard disk can create a maximum of 4 primary partitions or 3 primary partitions, an extended partition, and N logical partitions (N represents the number of logical partitions I have not studied. I have read 14 in the past, 12. There are countless others. who knows if I can leave a message and share it with me)

Of course, the master score is given priority. you can start from 1 to 2, that is, it looks awkward. The default values start at KB, and can start at KB, which is a waste.

Ignore 1 directly from 2

Extended Shard: the extended Shard usually absorbs all the remaining primary Shard:

Logical Partitions usually start from 5 by default and have four primary partitions, right? it can only start from 5.

Modify partition type: t modify the partition type, modify the sdb5, 8e represents the lvm Logical Volume, L you can view the partition type, you can select at will.

Save and exit (wq), and refresh the partition table. If you do not refresh the partition, you cannot see the newly added partition. it is still unavailable. You can check the/proc partition information. the partprobe intensity is not as strong as partx-d, but it can also be used.

Partition formatting: select the type to be formatted.

Use of extended partitions:

Format a swap partition:

First, view the swap partition information in the current system:

Add a swap partition. you can also see that sda2 has a higher priority than sdb5. the larger the number, the higher the priority.

Disable a swap partition:

If you do not want this swap partition, the swap partition is closed, formatted, or directly deleted from the partition.

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.