Linux hard disk partition knowledge

Foreword

Hard disk before use, generally partition, format (creating a file system) <== store data

Analogy, the house before use, generally cut off, decoration, buy furniture, then occupied.

 

Partition

A hard drive:

  • Primary partition, extended partition, logical partitions
    • + Extended primary partition number of partition <= 4, where a primary partition extended partition can be a substitute, at most one extended partition.
    • Extended partition can not be used directly, also need to create logical partitions on it, you can have multiple logical partitions.
    • + Extended primary partition partition number is only 1-4, logical partitions are numbered starting from 5 only

 

Example:

  • 1. General Partition: the data is not particularly important to business, such as cluster nodes
    • / Boot primary partition boot partition 200M
    • / Swap swap 1.5 times the memory, once the memory is greater than 8G, 8G to give
    • / Linux apex of all directories, all the remaining space
  • 2. important data partition (database, storage servers)
    • / Boot primary partition boot partition 200M
    • / Swap swap 1.5 times the memory, once the memory is greater than 8G, 8G to give
    • / Linux directory of all vertices, 100-200G, given a fixed size
    • / Data all the rest, to store data
  • 3. large sites, portals (particularly large number of product lines, demand)
    • / Boot primary partition boot partition 200M
    • / Swap swap 1.5 times the memory, once the memory is greater than 8G, 8G to give
    • / Linux directory of all vertices, 100-200G, given a fixed size
    • The remaining space is not allocated, which led the department server, and then partition on demand

 

 

 

Wrong partition scheme :
the / usr, / home, / var also specifically points out, is not necessary. 100 flat but had to divide a pile of small rooms, no rational distribution.

 

Create a / boot partition illustration

 

 

Create the first partition / boot, adding the partition interface, you need to manually enter each partition mount point directory, file system type is selected , the operation of which disk (if the server has multiple disks you need to pay special attention), and specify partition size creates.

 

  • Mount Point mount point.
    • Linux is at the entrance to access the disk partition, that is, if you want to go to the / boot partition (/ dev / sda1) write data, it must have / boot entry to write to, unlike Windows is different.
  • File System Type the file system type
    • Windows file system type is fat32 / ntfs
    • Linux is the ext2, ext3, ** ext4 ** (default)
    • 磁盘分区只有在设置了文件系统类型格式化并挂载上挂载点后,分区才能存放数据。
  • Force to be a primary parition 强制主分区,是可选项。
    • 由于安装示例中,所有的分区未超过4个,所以必须勾选。

 

文件系统就是管理以及组织磁盘上数据的一种方式或机制

下面是常用的文件系统类型介绍:

 

Guess you like

Origin www.cnblogs.com/zoe233/p/11815998.html