Linux hard disk Partition: partition, format, mount, cancel mount, delete partition

Source: Internet
Author: User

1. Create a partition

Check to see if an unpartitioned hard disk exists

# fdisk-l

650) this.width=650; "Src=" http://note.youdao.com/yws/public/resource/7cab2b25f7845268da528679eea1885b/xmlnote/ 8bc7622684204302a80b7c7d820d4ee0/1418 "style=" Border:none;margin:auto;height:auto; "alt=" 1418 "/>

, the original hard disk is formatted and mounted, and the new hard disk is not partitioned

So, start partitioning

# FDISK/DEV/SDB

650) this.width=650; "Src=" http://note.youdao.com/yws/public/resource/7cab2b25f7845268da528679eea1885b/xmlnote/ 58e3ff05293642a0bbcbcb202d563d8c/1423 "style=" Border:none;margin:auto;height:auto; "alt=" 1423 "/>

Enter m to view individual command options

650) this.width=650; "Src=" http://note.youdao.com/yws/public/resource/7cab2b25f7845268da528679eea1885b/xmlnote/ e47edef1bb1e405d96a4cf115631de66/1426 "style=" Border:none;margin:auto;height:auto; "alt=" 1426 "/>

Enter P to view the current hard disk partition status

650) this.width=650; "Src=" http://note.youdao.com/yws/public/resource/7cab2b25f7845268da528679eea1885b/xmlnote/ 3cd7ff7c536844e5a2af81f7a490c225/1429 "style=" Border:none;margin:auto;height:auto; "alt=" 1429 "/>

Enter N to create a new partition

650) this.width=650; "Src=" http://note.youdao.com/yws/public/resource/7cab2b25f7845268da528679eea1885b/xmlnote/ 2884124350854c6cad4ed2d1827931ec/1432 "style=" Border:none;margin:auto;height:auto; "alt=" 1432 "/>

e Create the extended partition, p to create the primary partition. Here, first create a primary partition, first create partition number 1th, the starting point is the default

, direct enter, set the end point, the partition of how much to write how big, I wrote is 2G

650) this.width=650; "Src=" http://note.youdao.com/yws/public/resource/7cab2b25f7845268da528679eea1885b/xmlnote/ 293a07c83379474289e08743373e4cba/1436 "style=" Border:none;margin:auto;height:auto; "alt=" 1436 "/>

If you separate a primary partition, create an extended partition and a logical partition

650) this.width=650; "Src=" http://note.youdao.com/yws/public/resource/7cab2b25f7845268da528679eea1885b/xmlnote/ 88243a3777bc49c7a91443f9739eff51/1439 "style=" Border:none;margin:auto;height:auto; "alt=" 1439 "/>

The partitioned 2-bit extended partition in the figure, with the logical partition starting with ordinal 5.

Enter command W to save the partition

650) this.width=650; "Src=" http://note.youdao.com/yws/public/resource/7cab2b25f7845268da528679eea1885b/xmlnote/ de88d6c95b3e466186c909de86c5efee/1442 "style=" Border:none;margin:auto;height:auto; "alt=" 1442 "/>

2. Format the partition

Two commands implement MKFS.EXT4 or MKE2FS (default format to EXT4 format).

650) this.width=650; "Src=" http://note.youdao.com/yws/public/resource/7cab2b25f7845268da528679eea1885b/xmlnote/ 4a3c1a8741844b96831ded6b62394125/1448 "style=" Border:none;margin:auto;height:auto; "alt=" 1448 "/>

3. Mounting

# MKDIR/MNT/SDB1 //Build Mount Directory

# MKDIR/MNT/SDB5

# MOUNT/DEV/SDB1/MNT/SDB1 //mount, same as SDB5 method

650) this.width=650; "Src=" http://note.youdao.com/yws/public/resource/7cab2b25f7845268da528679eea1885b/xmlnote/ 875b7170c3d247c0b0efc1047bfff48f/1456 "style=" Border:none;margin:auto;height:auto; "alt=" 1456 "/>

Mounted successfully.

4. un-mount

# UMOUNT/MNT/SDB1

5. Cancel Partition

# FDISK/DEV/SDB

First enter P to view, then use command D to delete, last w save.

650) this.width=650; "Src=" http://note.youdao.com/yws/public/resource/7cab2b25f7845268da528679eea1885b/xmlnote/ 19528e8708084852a56152abb1a07e93/1461 "style=" Border:none;margin:auto;height:auto; "alt=" 1461 "/>

Additional:

The above mount operation fails after the server restarts, and if you want the server to mount automatically when it starts, you need to edit the Fstab file

650) this.width=650; "Src=" http://note.youdao.com/yws/public/resource/7cab2b25f7845268da528679eea1885b/xmlnote/ 7c56a59acb9640c58bf58068c4fe88b1/1472 "style=" Border:none;margin:auto;height:auto; "alt=" 1472 "/>

The last line adds the last line to automatically mount the boot. There are altogether 6 columns of documents, respectively, representing:

First column: Device name or device volume label name, (/DEV/SDA10 or label=/)

Second column: Device mount directory (e.g. "/" or "/mnt/d/" above)

Column three: Device file system (e.g. "ext3" or "VFAT" above)

Fourth column: Mount parameters (see Help man Mount)

Fifth column: Indicate whether to back up, (0 is not a backup, 1 is to be backed up, general root partition to back up)

Sixth column: Indicates the self-test order. (0 is not self-test, 1 or 2 is to self-test, if the root partition to be set to 1, the other partition can only be 2)


This article is from the "cloud" blog, be sure to keep this source http://walterliew.blog.51cto.com/11286797/1879966

Linux hard disk Partition: partition, format, mount, cancel mount, delete partition

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.