Format disks and partitions in Linux

Source: Internet
Author: User

If a new hard disk is added, it is automatically detected in Linux. It is/dev/SDD. to partition, we should first clarify something about the partition: A disk can be divided into 16 different partitions, which mainly correspond to three partition structures:

Primary Partition: You can create up to four instances, one of which must be an activity.

Extended partition: External partitions are called extended partitions. Extended partitions are further subdivided into logical partitions.

Logical Partition: A maximum of 12 logical partitions can be created.

1. Run the "fdisk-L" command to view the hard disk information. This is part of my hard disk information.

The new hard drive is/dev/sdb.

2. Partition the new hard disk. Enter the command "fdisk/dev/SDB" on the terminal to go to the partition page. Enter m to display the available command:

I just added a primary partition here, so that is, N-> P, the partition number is 1, and I use the default partition size.

Save W and exit Q. Go back and run the "fdisk-L" command to check whether a partition is added to/dev/SDB:

3. Format partitions

Use the command "mkfs-T ext3/dev/sdb1" to format the file.

4. Mount partitions

Run "Mount/dev/sdb1/opt/new_disk" and run "DF-th" to check whether the disk is mounted.

Already mounted. 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.