Linux add partitions, file systems, and permanent mounts

Source: Internet
Author: User
Tags uuid

Adding partitions, file systems, and permanent mounts

One, disk partitioning

1. Concept: A disk partition can divide a hard drive into multiple logical storage units, also known as partitions.

2. disk partitioning scheme:MBR partitioning scheme,GPT partitioning scheme

(1) MBR partitioning scheme:

MBR partition scheme (Master Boot Record Partitioning scheme), which refers to the running BIOS how the disk should be partitioned on the firmware's system. This scenario supports up to 4 primary partitions, and administrators can create up to a maximum of four partitions using an extended partition (the last primary partition is set to an extended partition, and the extended zoning is divided into several logical partitions).

(2) GPT partitioning scheme:

Refers to the scenario where partitioning is placed on a physical hard disk on a system running a unified Extensible Firmware Interface firmware.

(3) Compare:

MBR partitioning scheme supports up to 4 primary partitions, up to the partitions, with a maximum disk and partition size limited to 2T , using + Bits store logical block address and size information.

GPT support up to - partitions, using a - bit storage logical block address and size information

Ii. Division Management ( fdisk )

Adopt MBR partition Scheme disks can take fdisk to manage, such as creating partitions, deleting partitions, changing partition types

1. Specifies the disk device (root identity) to create the partition

650) this.width=650; "style=" width:734px;height:254px; "title=" 1.jpg "src=" http://s5.51cto.com/wyfs02/M02/77/3E/ Wkiol1zlnf7heybnaacbzbrkypk420.jpg "width=" 741 "height=" + "alt=" wkiol1zlnf7heybnaacbzbrkypk420.jpg "/>

2. Add a primary or extended partition (n is the primary partition by default)

650) this.width=650; "title=" 2.jpg "src=" Http://s2.51cto.com/wyfs02/M02/77/3E/wKioL1ZlnFrDpPbeAADlDkfPLFg601.jpg " Width= "734" height= "134" alt= "Wkiol1zlnfrdppbeaadldkfplfg601.jpg"/>

indicates whether to increase the primary or extended partition, the default is the primary partition, to create an extended partition input e

3. Specify the partition number

650) this.width=650; "title=" 3.jpg "src=" Http://s4.51cto.com/wyfs02/M02/77/3E/wKioL1ZlnHHD6_KgAAAW447NFw4468.jpg " alt= "Wkiol1zlnhhd6_kgaaaw447nfw4468.jpg"/>

4. Specifies the first available sector of a new partition on the disk (the first available sector on the default disk)

650) this.width=650; "title=" 4.jpg "src=" Http://s3.51cto.com/wyfs02/M01/77/40/wKiom1ZlnBiCnESRAAAp4-2hcuM562.jpg " alt= "Wkiom1zlnbicnesraaap4-2hcum562.jpg"/>

5,   + "How much space to specify the partition size, such as +1k +1m +2g etc 650) this.width=650; "title=" 5.jpg "src=" http://s4.51cto.com/ Wyfs02/m02/77/40/wkiom1zlncmcpjgdaaatq4ivj9g160.jpg "width=" 733 "height=" "alt=" Wkiom1zlncmcpjgdaaatq4ivj9g160.jpg "/>

6. defines the partition type (the Linux default is xfs type, to specify a different type of input T, Input L Show All Types list)

650) this.width=650; "title=" 6.jpg "src=" Http://s1.51cto.com/wyfs02/M02/77/3E/wKioL1ZlnKnS4O9KAAAtw2U82xk142.jpg " alt= "Wkiol1zlnkns4o9kaaatw2u82xk142.jpg"/>

650) this.width=650; "title=" 7.jpg "src=" Http://s3.51cto.com/wyfs02/M00/77/3E/wKioL1ZlnLiQuM-aAACcONoN-ys141.jpg " Width= "734" height= "202" alt= "wkiol1zlnliqum-aaacconon-ys141.jpg"/>

7. Save partition (w)

input W Save the partition table operation and exit fdisk The program completes the partition Creation 650) this.width=650; "title=" 8.jpg "src=" http://s5.51cto.com/wyfs02/M01/77/40/ Wkiom1zlngdir1tvaabuav5dqee167.jpg "alt=" Wkiom1zlngdir1tvaabuav5dqee167.jpg "/>

8. The boot kernel re-reads the new partition table (partprobe)

Run Partprobe command, the disk device name to make parameters, Force re-read partition table 650) this.width=650; "title=" 9.jpg "src=" http://s4.51cto.com/wyfs02/M02/77/40/ Wkiom1zlnhsteddhaaaeot32cxs584.jpg "alt=" Wkiom1zlnhsteddhaaaeot32cxs584.jpg "/>

9.  DeleteMBRDisk Partitions (D). InputPdisplay disk information and current partition, enterDSelect the partition you want to delete, enterWSave your changes. Finally throughPartprobecommand to start kernel re-read partition table650) this.width=650; "title=" 10.jpg "src=" http://s3.51cto.com/wyfs02/M01/77/40/wKiom1ZlnIrDB__JAACzcuYv5Z4409.jpg "Width=" 729 "height=" "alt=" Wkiom1zlnirdb__jaaczcuyv5z4409.jpg "/>650" this.width=650; "title=" 11.jpg "src=" Http://s4.51cto.com/wyfs02/M01/77/3E/wKioL1ZlnRCCxSm0AAAt4Gkd8Dk734.jpg "alt=" Wkiol1zlnrccxsm0aaat4gkd8dk734.jpg "/>

third, partition management ( Gdisk )

Adopt GPT partition Scheme disks can be used Gdsik Partition Editor manages partitions, such as creating partitions, changing partitions, deleting partitions

1. Specify the disk device to create the partition ()

650) this.width=650; "title=" 12.jpg "src=" http://s3.51cto.com/wyfs02/M02/77/3E/wKioL1ZlnSHS2O79AAC8EN3NIMo754.jpg "Width=" 733 "height=" 379 "alt=" wkiol1zlnshs2o79aac8en3nimo754.jpg "/>

2. Add new partition (n, same as fdisk)

3. Specify partition number (same as fdisk)

4. Specify the start disk location for the new partition (gdisk allows two different specified types)

(1)         The first input type represents the absolute disk sector number of the first sector of the new partition 650) this.width=650; " Title= "13.jpg" src= "http://s4.51cto.com/wyfs02/M01/77/40/wKiom1ZlnOChPMUdAAAgx804QnI030.jpg" width= "732" height= " "alt=" wkiom1zlnochpmudaaagx804qni030.jpg "/>";

(2) The second input type refers to the start sector of the partition. You can use K,M,G,T,P Specified units

5. Specifies the last sector of the new partition (same as fdisk)

6. define partition type (default to Linux file system type) use the t option to change other types,l Option Display Type list

7. Save partition Table changes (same as fdisk)

8. Start the kernel to re-read the new partition table (example :partprobe/dev/sdb)

9. Delete GPT disk partitions (use gdisk to select disk devices, follow-up with fdisk )

four, format the partition and create the file system ( mkfs-t )

after you create a partition, you format the partition and assign it a file system to store the data. the mkfs command is used to format the user partition and the default file system type is ext2. You can use the –t option to specify additional file system types.

650) this.width=650; "title=" 14.jpg "src=" http://s5.51cto.com/wyfs02/M01/77/3E/wKioL1Zlnb7CpyqJAACXdLN9CIg777.jpg "Width=" 736 "height=" 223 "alt=" Wkiol1zlnb7cpyqjaacxdln9cig777.jpg "/>

v. Mount the file system ( Mount or Vim/etc/fstab )

when you apply a file system to a partition, you attach the partition to the directory structure to be used by the program for access. Can be mounted temporarily using the Mount command, or by editing,etc/fstab files for permanent mounting

( 1 ) Temporary mount file system Mount

Create a mount point before mounting and overwrite existing directory data if mounted to an existing directory

650) this.width=650; "title=" 15.jpg "src=" http://s4.51cto.com/wyfs02/M00/77/40/wKiom1ZlnTmh-loWAAA_LSbHNNc698.jpg "Width=" 733 "height=" alt= "Wkiom1zlntmh-lowaaa_lsbhnnc698.jpg"/>

mounted file systems can be mounted through the device path or by UUID Mount, UUID mounting is relatively safe and reliable

650) this.width=650; "title=" 16.jpg "src=" http://s2.51cto.com/wyfs02/M00/77/40/wKiom1ZlnSGSu-ZcAABJthJpec8975.jpg "Width=" 734 "height=" "alt=" Wkiom1zlnsgsu-zcaabjthjpec8975.jpg "/>"

The temporary mounted file system will not mount to the directory again after rebooting the system, and it will need to be mounted manually.

(3) Permanently mount file system vim/etc/fstab

by adding a list of devices to the /etc/fstab can be permanently mounted (the last behavior adds the permanent mount content, or UUId change to device directory /DEV/SDB1 )

650) this.width=650; "title=" 17.jpg "src=" http://s4.51cto.com/wyfs02/M02/77/3E/wKioL1ZlnXCxeFW_AACeolFxyqY156.jpg "Width=" 736 "height=" 294 "alt=" Wkiol1zlnxcxefw_aaceolfxyqy156.jpg "/>

*** when a file system is uninstalled, it can be removed by Mount–a Mount back to the original location

This article is from the "Ali" blog, make sure to keep this source http://ali123.blog.51cto.com/10601773/1720570

Linux add partitions, file systems, and permanent mounts

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.