The Disk Management---partition under CentOS

Source: Internet
Author: User

1. Disk partition Format description

The Linux partition differs from the Windows,linux under the hard drive device name (IDE hard disk is HDX (x is from a-d) because the IDE hard disk is up to four, the SCSI,SATA,USB hard disk is SDX (x is a-Z), the hard disk primary partition is up to 4, needless to say you know ... So the primary partition starts from SDB1 to SDB4, and the logical partition starts with SDB5 (logical partition always starts from SDB5 ... ) device name can be viewed using fdisk–l

2. Detailed Zoning

Log on to the system using the SSH Remote Connection tool and use the FDISK-L command to view the disk status

Here you can see two hard disks hda and HDB, the first HDD HDA is installed system. The HDB hard disk is not partitioned.

This example will partition this 10G hard disk, Partition plan: Divide a primary partition, size 3G, file format ext3. Three logical partitions, each of which is 2g,2g,3g in size. The actual number and size of partitions can be determined by the situation.

Here is the detailed steps of the partition, because each step is carried out and explained, the content is slightly complex, in fact, very simple.

Enter FDISK/DEV/HDB and then enter to partition the hard drive. Such as

Enter N to new partition, then enter P return to create a new primary partition.

This is required to select the partition number in 1-4, enter 1 return car

First cylinder (1-20805, default 1): Here is the column to set the beginning of the partition, the direct return to select the default, enter after the

Last cylinder or +size or +sizem or +sizek (1-20805, default 20805): Here is the setting of the end cylinder of the partition, +3g indicates the end of 3G from the starting cylinder, is also set the partition size to 3G, enter +3g after the return , as shown

Here you can enter p to see if the partition was successful, enter P carriage, such as: Display partition success

Next we'll divide the extended partition, press N to enter

Enter e here, which means to create an extended partition, enter the E return

Enter partition number 2 return car

Press ENTER directly here to select the default

Here is also the direct carriage return select default, which indicates that the disk after the first primary partition is divided into a logical partition

Here you can enter the command p to view the current partition status, as

Start dividing the logical partition under the extended partition HDB2 here! Next, enter command N return

Enter L here to select Create Logical partition, enter L return

Use the carriage return directly here to select the default

Enter +2g here to divide the partition size to 2G, enter +2g carriage return

Here to divide the two logical space according to the plan, enter n return, then enter the L enter to select the logical partition, then go directly to select the default starting cylinder, enter +2g return to set the partition size

The following is the disk size of the extended partition to all the last logical partition, enter n return, and then enter L Select the logical partition, and then directly enter select the default starting cylinder, and finally do not set the disk size direct carriage return

Enter P again to view the current partition status

Divide the space with our plan to divide the same, and finally enter W return, to save and exit.

Using the Fdisk-l command again, you can see that the disk HDB has been partitioned successfully.

Disk partition is successful, the following will be formatted

Using the command mkfs-t EXT3/DEV/HDB1

Mkfs-t EXT3/DEV/HDB5

Mkfs-t EXT3/DEV/HDB6

Mkfs-t EXT3/DEV/HDB7

Format the disk separately, formatted as a ext3 file type

Since this partition process is finished!

Attached: parameter explanations for FDISK and MKFS,MKSWAP commands

The fdisk command is detailed:

M: Get Help

N: New Partition

P: Show partition Table

D: Delete partition

B: Set the volume label

W: Write to partition table

T: Change the partition file system type

V: Test partition

L: Displays the file system code supported by FDISK

Q: Exit

Creation of file systems:

MKFS parameter Partitioning

-T File system type specifies the type of file system established

Note: mkfs–t ext3 =mkfs.ext3

-c Check for bad path before setting up file system

-L file name: Read bad path from file

-V Show detailed conditions

Mkswap partition on partition to establish swap partition

Example: establishing the Swap partition command on HDB7 is as follows:

Mkswap/etc/hdb7

The Disk Management---partition under CentOS

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.