文章目录

  • Linux Storage
    • 1. RAID 磁盘阵列
      • 1.1 RAID 0
      • 1.2 RAID 1
      • 1.3 RAID 5
      • 1.4 RAID 0+1
    • 2. LVM
      • 2.1 逻辑卷管理
      • 2.2 磁盘分区
        • 2.2.1 命名
        • 2.2.2 分区和挂载
    • 3. 分区管理
      • 3.1 添加新虚拟硬盘
      • 3.2 主分区和扩展分区创建和使用
      • 3.3 LVM:逻辑卷的创建和使用

Linux Storage

1. RAID 磁盘阵列


三个基本功能:

  • 通过对磁盘上的数据进行条带化,实现对数据成块存取,减少磁盘的机械寻道时间,提高了数据存取速度

  • 通过对一个阵列的几块磁盘同时读取,减少了磁盘的机械寻道时间,提高数据存取速度

  • 通过镜像或者存储奇偶校验信息的方式,实现对数据的冗余保护

1.1 RAID 0

条带化,高性能,可用率 100%

#mermaid-svg-e4VXnWNwyyJRCkyb .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-e4VXnWNwyyJRCkyb .label text{fill:#333}#mermaid-svg-e4VXnWNwyyJRCkyb .node rect,#mermaid-svg-e4VXnWNwyyJRCkyb .node circle,#mermaid-svg-e4VXnWNwyyJRCkyb .node ellipse,#mermaid-svg-e4VXnWNwyyJRCkyb .node polygon,#mermaid-svg-e4VXnWNwyyJRCkyb .node path{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-e4VXnWNwyyJRCkyb .node .label{text-align:center;fill:#333}#mermaid-svg-e4VXnWNwyyJRCkyb .node.clickable{cursor:pointer}#mermaid-svg-e4VXnWNwyyJRCkyb .arrowheadPath{fill:#333}#mermaid-svg-e4VXnWNwyyJRCkyb .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-svg-e4VXnWNwyyJRCkyb .flowchart-link{stroke:#333;fill:none}#mermaid-svg-e4VXnWNwyyJRCkyb .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-svg-e4VXnWNwyyJRCkyb .edgeLabel rect{opacity:0.9}#mermaid-svg-e4VXnWNwyyJRCkyb .edgeLabel span{color:#333}#mermaid-svg-e4VXnWNwyyJRCkyb .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-svg-e4VXnWNwyyJRCkyb .cluster text{fill:#333}#mermaid-svg-e4VXnWNwyyJRCkyb div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-svg-e4VXnWNwyyJRCkyb .actor{stroke:#ccf;fill:#ECECFF}#mermaid-svg-e4VXnWNwyyJRCkyb text.actor>tspan{fill:#000;stroke:none}#mermaid-svg-e4VXnWNwyyJRCkyb .actor-line{stroke:grey}#mermaid-svg-e4VXnWNwyyJRCkyb .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333}#mermaid-svg-e4VXnWNwyyJRCkyb .messageLine1{stroke-width:1.5;stroke-dasharray:2, 2;stroke:#333}#mermaid-svg-e4VXnWNwyyJRCkyb #arrowhead path{fill:#333;stroke:#333}#mermaid-svg-e4VXnWNwyyJRCkyb .sequenceNumber{fill:#fff}#mermaid-svg-e4VXnWNwyyJRCkyb #sequencenumber{fill:#333}#mermaid-svg-e4VXnWNwyyJRCkyb #crosshead path{fill:#333;stroke:#333}#mermaid-svg-e4VXnWNwyyJRCkyb .messageText{fill:#333;stroke:#333}#mermaid-svg-e4VXnWNwyyJRCkyb .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-svg-e4VXnWNwyyJRCkyb .labelText,#mermaid-svg-e4VXnWNwyyJRCkyb .labelText>tspan{fill:#000;stroke:none}#mermaid-svg-e4VXnWNwyyJRCkyb .loopText,#mermaid-svg-e4VXnWNwyyJRCkyb .loopText>tspan{fill:#000;stroke:none}#mermaid-svg-e4VXnWNwyyJRCkyb .loopLine{stroke-width:2px;stroke-dasharray:2, 2;stroke:#ccf;fill:#ccf}#mermaid-svg-e4VXnWNwyyJRCkyb .note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-e4VXnWNwyyJRCkyb .noteText,#mermaid-svg-e4VXnWNwyyJRCkyb .noteText>tspan{fill:#000;stroke:none}#mermaid-svg-e4VXnWNwyyJRCkyb .activation0{fill:#f4f4f4;stroke:#666}#mermaid-svg-e4VXnWNwyyJRCkyb .activation1{fill:#f4f4f4;stroke:#666}#mermaid-svg-e4VXnWNwyyJRCkyb .activation2{fill:#f4f4f4;stroke:#666}#mermaid-svg-e4VXnWNwyyJRCkyb .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-e4VXnWNwyyJRCkyb .section{stroke:none;opacity:0.2}#mermaid-svg-e4VXnWNwyyJRCkyb .section0{fill:rgba(102,102,255,0.49)}#mermaid-svg-e4VXnWNwyyJRCkyb .section2{fill:#fff400}#mermaid-svg-e4VXnWNwyyJRCkyb .section1,#mermaid-svg-e4VXnWNwyyJRCkyb .section3{fill:#fff;opacity:0.2}#mermaid-svg-e4VXnWNwyyJRCkyb .sectionTitle0{fill:#333}#mermaid-svg-e4VXnWNwyyJRCkyb .sectionTitle1{fill:#333}#mermaid-svg-e4VXnWNwyyJRCkyb .sectionTitle2{fill:#333}#mermaid-svg-e4VXnWNwyyJRCkyb .sectionTitle3{fill:#333}#mermaid-svg-e4VXnWNwyyJRCkyb .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-e4VXnWNwyyJRCkyb .grid .tick{stroke:#d3d3d3;opacity:0.8;shape-rendering:crispEdges}#mermaid-svg-e4VXnWNwyyJRCkyb .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-e4VXnWNwyyJRCkyb .grid path{stroke-width:0}#mermaid-svg-e4VXnWNwyyJRCkyb .today{fill:none;stroke:red;stroke-width:2px}#mermaid-svg-e4VXnWNwyyJRCkyb .task{stroke-width:2}#mermaid-svg-e4VXnWNwyyJRCkyb .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-e4VXnWNwyyJRCkyb .taskText:not([font-size]){font-size:11px}#mermaid-svg-e4VXnWNwyyJRCkyb .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-e4VXnWNwyyJRCkyb .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-svg-e4VXnWNwyyJRCkyb .task.clickable{cursor:pointer}#mermaid-svg-e4VXnWNwyyJRCkyb .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-e4VXnWNwyyJRCkyb .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-e4VXnWNwyyJRCkyb .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-e4VXnWNwyyJRCkyb .taskText0,#mermaid-svg-e4VXnWNwyyJRCkyb .taskText1,#mermaid-svg-e4VXnWNwyyJRCkyb .taskText2,#mermaid-svg-e4VXnWNwyyJRCkyb .taskText3{fill:#fff}#mermaid-svg-e4VXnWNwyyJRCkyb .task0,#mermaid-svg-e4VXnWNwyyJRCkyb .task1,#mermaid-svg-e4VXnWNwyyJRCkyb .task2,#mermaid-svg-e4VXnWNwyyJRCkyb .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-svg-e4VXnWNwyyJRCkyb .taskTextOutside0,#mermaid-svg-e4VXnWNwyyJRCkyb .taskTextOutside2{fill:#000}#mermaid-svg-e4VXnWNwyyJRCkyb .taskTextOutside1,#mermaid-svg-e4VXnWNwyyJRCkyb .taskTextOutside3{fill:#000}#mermaid-svg-e4VXnWNwyyJRCkyb .active0,#mermaid-svg-e4VXnWNwyyJRCkyb .active1,#mermaid-svg-e4VXnWNwyyJRCkyb .active2,#mermaid-svg-e4VXnWNwyyJRCkyb .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-svg-e4VXnWNwyyJRCkyb .activeText0,#mermaid-svg-e4VXnWNwyyJRCkyb .activeText1,#mermaid-svg-e4VXnWNwyyJRCkyb .activeText2,#mermaid-svg-e4VXnWNwyyJRCkyb .activeText3{fill:#000 !important}#mermaid-svg-e4VXnWNwyyJRCkyb .done0,#mermaid-svg-e4VXnWNwyyJRCkyb .done1,#mermaid-svg-e4VXnWNwyyJRCkyb .done2,#mermaid-svg-e4VXnWNwyyJRCkyb .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-svg-e4VXnWNwyyJRCkyb .doneText0,#mermaid-svg-e4VXnWNwyyJRCkyb .doneText1,#mermaid-svg-e4VXnWNwyyJRCkyb .doneText2,#mermaid-svg-e4VXnWNwyyJRCkyb .doneText3{fill:#000 !important}#mermaid-svg-e4VXnWNwyyJRCkyb .crit0,#mermaid-svg-e4VXnWNwyyJRCkyb .crit1,#mermaid-svg-e4VXnWNwyyJRCkyb .crit2,#mermaid-svg-e4VXnWNwyyJRCkyb .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-svg-e4VXnWNwyyJRCkyb .activeCrit0,#mermaid-svg-e4VXnWNwyyJRCkyb .activeCrit1,#mermaid-svg-e4VXnWNwyyJRCkyb .activeCrit2,#mermaid-svg-e4VXnWNwyyJRCkyb .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-svg-e4VXnWNwyyJRCkyb .doneCrit0,#mermaid-svg-e4VXnWNwyyJRCkyb .doneCrit1,#mermaid-svg-e4VXnWNwyyJRCkyb .doneCrit2,#mermaid-svg-e4VXnWNwyyJRCkyb .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-svg-e4VXnWNwyyJRCkyb .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-svg-e4VXnWNwyyJRCkyb .milestoneText{font-style:italic}#mermaid-svg-e4VXnWNwyyJRCkyb .doneCritText0,#mermaid-svg-e4VXnWNwyyJRCkyb .doneCritText1,#mermaid-svg-e4VXnWNwyyJRCkyb .doneCritText2,#mermaid-svg-e4VXnWNwyyJRCkyb .doneCritText3{fill:#000 !important}#mermaid-svg-e4VXnWNwyyJRCkyb .activeCritText0,#mermaid-svg-e4VXnWNwyyJRCkyb .activeCritText1,#mermaid-svg-e4VXnWNwyyJRCkyb .activeCritText2,#mermaid-svg-e4VXnWNwyyJRCkyb .activeCritText3{fill:#000 !important}#mermaid-svg-e4VXnWNwyyJRCkyb .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-e4VXnWNwyyJRCkyb g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-svg-e4VXnWNwyyJRCkyb g.classGroup text .title{font-weight:bolder}#mermaid-svg-e4VXnWNwyyJRCkyb g.clickable{cursor:pointer}#mermaid-svg-e4VXnWNwyyJRCkyb g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-e4VXnWNwyyJRCkyb g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-e4VXnWNwyyJRCkyb .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-svg-e4VXnWNwyyJRCkyb .classLabel .label{fill:#9370db;font-size:10px}#mermaid-svg-e4VXnWNwyyJRCkyb .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-e4VXnWNwyyJRCkyb .dashed-line{stroke-dasharray:3}#mermaid-svg-e4VXnWNwyyJRCkyb #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-e4VXnWNwyyJRCkyb #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-e4VXnWNwyyJRCkyb #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-e4VXnWNwyyJRCkyb #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-e4VXnWNwyyJRCkyb #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-e4VXnWNwyyJRCkyb #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-e4VXnWNwyyJRCkyb #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-e4VXnWNwyyJRCkyb #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-e4VXnWNwyyJRCkyb .commit-id,#mermaid-svg-e4VXnWNwyyJRCkyb .commit-msg,#mermaid-svg-e4VXnWNwyyJRCkyb .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-e4VXnWNwyyJRCkyb .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-e4VXnWNwyyJRCkyb .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-e4VXnWNwyyJRCkyb g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-e4VXnWNwyyJRCkyb g.stateGroup text{fill:#9370db;fill:#333;stroke:none;font-size:10px}#mermaid-svg-e4VXnWNwyyJRCkyb g.statediagram-cluster .cluster-label text{fill:#333}#mermaid-svg-e4VXnWNwyyJRCkyb g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-svg-e4VXnWNwyyJRCkyb g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-e4VXnWNwyyJRCkyb g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-e4VXnWNwyyJRCkyb .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-e4VXnWNwyyJRCkyb .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-svg-e4VXnWNwyyJRCkyb .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px}#mermaid-svg-e4VXnWNwyyJRCkyb .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-e4VXnWNwyyJRCkyb .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-svg-e4VXnWNwyyJRCkyb .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.7}#mermaid-svg-e4VXnWNwyyJRCkyb .edgeLabel text{fill:#333}#mermaid-svg-e4VXnWNwyyJRCkyb .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-e4VXnWNwyyJRCkyb .node circle.state-start{fill:black;stroke:black}#mermaid-svg-e4VXnWNwyyJRCkyb .node circle.state-end{fill:black;stroke:white;stroke-width:1.5}#mermaid-svg-e4VXnWNwyyJRCkyb #statediagram-barbEnd{fill:#9370db}#mermaid-svg-e4VXnWNwyyJRCkyb .statediagram-cluster rect{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-e4VXnWNwyyJRCkyb .statediagram-cluster rect.outer{rx:5px;ry:5px}#mermaid-svg-e4VXnWNwyyJRCkyb .statediagram-state .divider{stroke:#9370db}#mermaid-svg-e4VXnWNwyyJRCkyb .statediagram-state .title-state{rx:5px;ry:5px}#mermaid-svg-e4VXnWNwyyJRCkyb .statediagram-cluster.statediagram-cluster .inner{fill:white}#mermaid-svg-e4VXnWNwyyJRCkyb .statediagram-cluster.statediagram-cluster-alt .inner{fill:#e0e0e0}#mermaid-svg-e4VXnWNwyyJRCkyb .statediagram-cluster .inner{rx:0;ry:0}#mermaid-svg-e4VXnWNwyyJRCkyb .statediagram-state rect.basic{rx:5px;ry:5px}#mermaid-svg-e4VXnWNwyyJRCkyb .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#efefef}#mermaid-svg-e4VXnWNwyyJRCkyb .note-edge{stroke-dasharray:5}#mermaid-svg-e4VXnWNwyyJRCkyb .statediagram-note rect{fill:#fff5ad;stroke:#aa3;stroke-width:1px;rx:0;ry:0}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}#mermaid-svg-e4VXnWNwyyJRCkyb .error-icon{fill:#522}#mermaid-svg-e4VXnWNwyyJRCkyb .error-text{fill:#522;stroke:#522}#mermaid-svg-e4VXnWNwyyJRCkyb .edge-thickness-normal{stroke-width:2px}#mermaid-svg-e4VXnWNwyyJRCkyb .edge-thickness-thick{stroke-width:3.5px}#mermaid-svg-e4VXnWNwyyJRCkyb .edge-pattern-solid{stroke-dasharray:0}#mermaid-svg-e4VXnWNwyyJRCkyb .edge-pattern-dashed{stroke-dasharray:3}#mermaid-svg-e4VXnWNwyyJRCkyb .edge-pattern-dotted{stroke-dasharray:2}#mermaid-svg-e4VXnWNwyyJRCkyb .marker{fill:#333}#mermaid-svg-e4VXnWNwyyJRCkyb .marker.cross{stroke:#333}:root { --mermaid-font-family: "trebuchet ms", verdana, arial;}#mermaid-svg-e4VXnWNwyyJRCkyb {color: rgba(0, 0, 0, 0.75);font: ;}

磁盘1
磁盘2
read

磁盘1+磁盘2=总容量磁盘1+磁盘2=总容量 磁盘1+磁盘2=总容量

显然,使用 RAID 0 可以实现吞吐量的整数倍提升,例如两个磁盘组成的阵列的吞吐量即为原来的两倍,但是一旦其中一个磁盘出错数据就不能恢复,所以容错率为 1/2。

1.2 RAID 1

镜像化,高冗余,可用率50%

#mermaid-svg-AucNKwBKfU8JwOoC .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-AucNKwBKfU8JwOoC .label text{fill:#333}#mermaid-svg-AucNKwBKfU8JwOoC .node rect,#mermaid-svg-AucNKwBKfU8JwOoC .node circle,#mermaid-svg-AucNKwBKfU8JwOoC .node ellipse,#mermaid-svg-AucNKwBKfU8JwOoC .node polygon,#mermaid-svg-AucNKwBKfU8JwOoC .node path{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-AucNKwBKfU8JwOoC .node .label{text-align:center;fill:#333}#mermaid-svg-AucNKwBKfU8JwOoC .node.clickable{cursor:pointer}#mermaid-svg-AucNKwBKfU8JwOoC .arrowheadPath{fill:#333}#mermaid-svg-AucNKwBKfU8JwOoC .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-svg-AucNKwBKfU8JwOoC .flowchart-link{stroke:#333;fill:none}#mermaid-svg-AucNKwBKfU8JwOoC .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-svg-AucNKwBKfU8JwOoC .edgeLabel rect{opacity:0.9}#mermaid-svg-AucNKwBKfU8JwOoC .edgeLabel span{color:#333}#mermaid-svg-AucNKwBKfU8JwOoC .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-svg-AucNKwBKfU8JwOoC .cluster text{fill:#333}#mermaid-svg-AucNKwBKfU8JwOoC div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-svg-AucNKwBKfU8JwOoC .actor{stroke:#ccf;fill:#ECECFF}#mermaid-svg-AucNKwBKfU8JwOoC text.actor>tspan{fill:#000;stroke:none}#mermaid-svg-AucNKwBKfU8JwOoC .actor-line{stroke:grey}#mermaid-svg-AucNKwBKfU8JwOoC .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333}#mermaid-svg-AucNKwBKfU8JwOoC .messageLine1{stroke-width:1.5;stroke-dasharray:2, 2;stroke:#333}#mermaid-svg-AucNKwBKfU8JwOoC #arrowhead path{fill:#333;stroke:#333}#mermaid-svg-AucNKwBKfU8JwOoC .sequenceNumber{fill:#fff}#mermaid-svg-AucNKwBKfU8JwOoC #sequencenumber{fill:#333}#mermaid-svg-AucNKwBKfU8JwOoC #crosshead path{fill:#333;stroke:#333}#mermaid-svg-AucNKwBKfU8JwOoC .messageText{fill:#333;stroke:#333}#mermaid-svg-AucNKwBKfU8JwOoC .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-svg-AucNKwBKfU8JwOoC .labelText,#mermaid-svg-AucNKwBKfU8JwOoC .labelText>tspan{fill:#000;stroke:none}#mermaid-svg-AucNKwBKfU8JwOoC .loopText,#mermaid-svg-AucNKwBKfU8JwOoC .loopText>tspan{fill:#000;stroke:none}#mermaid-svg-AucNKwBKfU8JwOoC .loopLine{stroke-width:2px;stroke-dasharray:2, 2;stroke:#ccf;fill:#ccf}#mermaid-svg-AucNKwBKfU8JwOoC .note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-AucNKwBKfU8JwOoC .noteText,#mermaid-svg-AucNKwBKfU8JwOoC .noteText>tspan{fill:#000;stroke:none}#mermaid-svg-AucNKwBKfU8JwOoC .activation0{fill:#f4f4f4;stroke:#666}#mermaid-svg-AucNKwBKfU8JwOoC .activation1{fill:#f4f4f4;stroke:#666}#mermaid-svg-AucNKwBKfU8JwOoC .activation2{fill:#f4f4f4;stroke:#666}#mermaid-svg-AucNKwBKfU8JwOoC .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-AucNKwBKfU8JwOoC .section{stroke:none;opacity:0.2}#mermaid-svg-AucNKwBKfU8JwOoC .section0{fill:rgba(102,102,255,0.49)}#mermaid-svg-AucNKwBKfU8JwOoC .section2{fill:#fff400}#mermaid-svg-AucNKwBKfU8JwOoC .section1,#mermaid-svg-AucNKwBKfU8JwOoC .section3{fill:#fff;opacity:0.2}#mermaid-svg-AucNKwBKfU8JwOoC .sectionTitle0{fill:#333}#mermaid-svg-AucNKwBKfU8JwOoC .sectionTitle1{fill:#333}#mermaid-svg-AucNKwBKfU8JwOoC .sectionTitle2{fill:#333}#mermaid-svg-AucNKwBKfU8JwOoC .sectionTitle3{fill:#333}#mermaid-svg-AucNKwBKfU8JwOoC .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-AucNKwBKfU8JwOoC .grid .tick{stroke:#d3d3d3;opacity:0.8;shape-rendering:crispEdges}#mermaid-svg-AucNKwBKfU8JwOoC .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-AucNKwBKfU8JwOoC .grid path{stroke-width:0}#mermaid-svg-AucNKwBKfU8JwOoC .today{fill:none;stroke:red;stroke-width:2px}#mermaid-svg-AucNKwBKfU8JwOoC .task{stroke-width:2}#mermaid-svg-AucNKwBKfU8JwOoC .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-AucNKwBKfU8JwOoC .taskText:not([font-size]){font-size:11px}#mermaid-svg-AucNKwBKfU8JwOoC .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-AucNKwBKfU8JwOoC .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-svg-AucNKwBKfU8JwOoC .task.clickable{cursor:pointer}#mermaid-svg-AucNKwBKfU8JwOoC .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-AucNKwBKfU8JwOoC .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-AucNKwBKfU8JwOoC .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-AucNKwBKfU8JwOoC .taskText0,#mermaid-svg-AucNKwBKfU8JwOoC .taskText1,#mermaid-svg-AucNKwBKfU8JwOoC .taskText2,#mermaid-svg-AucNKwBKfU8JwOoC .taskText3{fill:#fff}#mermaid-svg-AucNKwBKfU8JwOoC .task0,#mermaid-svg-AucNKwBKfU8JwOoC .task1,#mermaid-svg-AucNKwBKfU8JwOoC .task2,#mermaid-svg-AucNKwBKfU8JwOoC .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-svg-AucNKwBKfU8JwOoC .taskTextOutside0,#mermaid-svg-AucNKwBKfU8JwOoC .taskTextOutside2{fill:#000}#mermaid-svg-AucNKwBKfU8JwOoC .taskTextOutside1,#mermaid-svg-AucNKwBKfU8JwOoC .taskTextOutside3{fill:#000}#mermaid-svg-AucNKwBKfU8JwOoC .active0,#mermaid-svg-AucNKwBKfU8JwOoC .active1,#mermaid-svg-AucNKwBKfU8JwOoC .active2,#mermaid-svg-AucNKwBKfU8JwOoC .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-svg-AucNKwBKfU8JwOoC .activeText0,#mermaid-svg-AucNKwBKfU8JwOoC .activeText1,#mermaid-svg-AucNKwBKfU8JwOoC .activeText2,#mermaid-svg-AucNKwBKfU8JwOoC .activeText3{fill:#000 !important}#mermaid-svg-AucNKwBKfU8JwOoC .done0,#mermaid-svg-AucNKwBKfU8JwOoC .done1,#mermaid-svg-AucNKwBKfU8JwOoC .done2,#mermaid-svg-AucNKwBKfU8JwOoC .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-svg-AucNKwBKfU8JwOoC .doneText0,#mermaid-svg-AucNKwBKfU8JwOoC .doneText1,#mermaid-svg-AucNKwBKfU8JwOoC .doneText2,#mermaid-svg-AucNKwBKfU8JwOoC .doneText3{fill:#000 !important}#mermaid-svg-AucNKwBKfU8JwOoC .crit0,#mermaid-svg-AucNKwBKfU8JwOoC .crit1,#mermaid-svg-AucNKwBKfU8JwOoC .crit2,#mermaid-svg-AucNKwBKfU8JwOoC .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-svg-AucNKwBKfU8JwOoC .activeCrit0,#mermaid-svg-AucNKwBKfU8JwOoC .activeCrit1,#mermaid-svg-AucNKwBKfU8JwOoC .activeCrit2,#mermaid-svg-AucNKwBKfU8JwOoC .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-svg-AucNKwBKfU8JwOoC .doneCrit0,#mermaid-svg-AucNKwBKfU8JwOoC .doneCrit1,#mermaid-svg-AucNKwBKfU8JwOoC .doneCrit2,#mermaid-svg-AucNKwBKfU8JwOoC .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-svg-AucNKwBKfU8JwOoC .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-svg-AucNKwBKfU8JwOoC .milestoneText{font-style:italic}#mermaid-svg-AucNKwBKfU8JwOoC .doneCritText0,#mermaid-svg-AucNKwBKfU8JwOoC .doneCritText1,#mermaid-svg-AucNKwBKfU8JwOoC .doneCritText2,#mermaid-svg-AucNKwBKfU8JwOoC .doneCritText3{fill:#000 !important}#mermaid-svg-AucNKwBKfU8JwOoC .activeCritText0,#mermaid-svg-AucNKwBKfU8JwOoC .activeCritText1,#mermaid-svg-AucNKwBKfU8JwOoC .activeCritText2,#mermaid-svg-AucNKwBKfU8JwOoC .activeCritText3{fill:#000 !important}#mermaid-svg-AucNKwBKfU8JwOoC .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-AucNKwBKfU8JwOoC g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-svg-AucNKwBKfU8JwOoC g.classGroup text .title{font-weight:bolder}#mermaid-svg-AucNKwBKfU8JwOoC g.clickable{cursor:pointer}#mermaid-svg-AucNKwBKfU8JwOoC g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-AucNKwBKfU8JwOoC g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-AucNKwBKfU8JwOoC .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-svg-AucNKwBKfU8JwOoC .classLabel .label{fill:#9370db;font-size:10px}#mermaid-svg-AucNKwBKfU8JwOoC .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-AucNKwBKfU8JwOoC .dashed-line{stroke-dasharray:3}#mermaid-svg-AucNKwBKfU8JwOoC #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-AucNKwBKfU8JwOoC #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-AucNKwBKfU8JwOoC #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-AucNKwBKfU8JwOoC #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-AucNKwBKfU8JwOoC #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-AucNKwBKfU8JwOoC #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-AucNKwBKfU8JwOoC #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-AucNKwBKfU8JwOoC #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-AucNKwBKfU8JwOoC .commit-id,#mermaid-svg-AucNKwBKfU8JwOoC .commit-msg,#mermaid-svg-AucNKwBKfU8JwOoC .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-AucNKwBKfU8JwOoC .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-AucNKwBKfU8JwOoC .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-AucNKwBKfU8JwOoC g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-AucNKwBKfU8JwOoC g.stateGroup text{fill:#9370db;fill:#333;stroke:none;font-size:10px}#mermaid-svg-AucNKwBKfU8JwOoC g.statediagram-cluster .cluster-label text{fill:#333}#mermaid-svg-AucNKwBKfU8JwOoC g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-svg-AucNKwBKfU8JwOoC g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-AucNKwBKfU8JwOoC g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-AucNKwBKfU8JwOoC .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-AucNKwBKfU8JwOoC .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-svg-AucNKwBKfU8JwOoC .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px}#mermaid-svg-AucNKwBKfU8JwOoC .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-AucNKwBKfU8JwOoC .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-svg-AucNKwBKfU8JwOoC .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.7}#mermaid-svg-AucNKwBKfU8JwOoC .edgeLabel text{fill:#333}#mermaid-svg-AucNKwBKfU8JwOoC .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-AucNKwBKfU8JwOoC .node circle.state-start{fill:black;stroke:black}#mermaid-svg-AucNKwBKfU8JwOoC .node circle.state-end{fill:black;stroke:white;stroke-width:1.5}#mermaid-svg-AucNKwBKfU8JwOoC #statediagram-barbEnd{fill:#9370db}#mermaid-svg-AucNKwBKfU8JwOoC .statediagram-cluster rect{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-AucNKwBKfU8JwOoC .statediagram-cluster rect.outer{rx:5px;ry:5px}#mermaid-svg-AucNKwBKfU8JwOoC .statediagram-state .divider{stroke:#9370db}#mermaid-svg-AucNKwBKfU8JwOoC .statediagram-state .title-state{rx:5px;ry:5px}#mermaid-svg-AucNKwBKfU8JwOoC .statediagram-cluster.statediagram-cluster .inner{fill:white}#mermaid-svg-AucNKwBKfU8JwOoC .statediagram-cluster.statediagram-cluster-alt .inner{fill:#e0e0e0}#mermaid-svg-AucNKwBKfU8JwOoC .statediagram-cluster .inner{rx:0;ry:0}#mermaid-svg-AucNKwBKfU8JwOoC .statediagram-state rect.basic{rx:5px;ry:5px}#mermaid-svg-AucNKwBKfU8JwOoC .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#efefef}#mermaid-svg-AucNKwBKfU8JwOoC .note-edge{stroke-dasharray:5}#mermaid-svg-AucNKwBKfU8JwOoC .statediagram-note rect{fill:#fff5ad;stroke:#aa3;stroke-width:1px;rx:0;ry:0}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}#mermaid-svg-AucNKwBKfU8JwOoC .error-icon{fill:#522}#mermaid-svg-AucNKwBKfU8JwOoC .error-text{fill:#522;stroke:#522}#mermaid-svg-AucNKwBKfU8JwOoC .edge-thickness-normal{stroke-width:2px}#mermaid-svg-AucNKwBKfU8JwOoC .edge-thickness-thick{stroke-width:3.5px}#mermaid-svg-AucNKwBKfU8JwOoC .edge-pattern-solid{stroke-dasharray:0}#mermaid-svg-AucNKwBKfU8JwOoC .edge-pattern-dashed{stroke-dasharray:3}#mermaid-svg-AucNKwBKfU8JwOoC .edge-pattern-dotted{stroke-dasharray:2}#mermaid-svg-AucNKwBKfU8JwOoC .marker{fill:#333}#mermaid-svg-AucNKwBKfU8JwOoC .marker.cross{stroke:#333}:root { --mermaid-font-family: "trebuchet ms", verdana, arial;}#mermaid-svg-AucNKwBKfU8JwOoC {color: rgba(0, 0, 0, 0.75);font: ;}

磁盘1
磁盘1 副本
read

磁盘1=磁盘2磁盘1=磁盘2 磁盘1=磁盘2

增加了冗余量,并且一个磁盘损坏还有另外一个可用,可以并行读取。

1.3 RAID 5

条带化,奇偶校验,可用率 (N-1)/N

#mermaid-svg-NoBXW3FVejFISSTd .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-NoBXW3FVejFISSTd .label text{fill:#333}#mermaid-svg-NoBXW3FVejFISSTd .node rect,#mermaid-svg-NoBXW3FVejFISSTd .node circle,#mermaid-svg-NoBXW3FVejFISSTd .node ellipse,#mermaid-svg-NoBXW3FVejFISSTd .node polygon,#mermaid-svg-NoBXW3FVejFISSTd .node path{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-NoBXW3FVejFISSTd .node .label{text-align:center;fill:#333}#mermaid-svg-NoBXW3FVejFISSTd .node.clickable{cursor:pointer}#mermaid-svg-NoBXW3FVejFISSTd .arrowheadPath{fill:#333}#mermaid-svg-NoBXW3FVejFISSTd .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-svg-NoBXW3FVejFISSTd .flowchart-link{stroke:#333;fill:none}#mermaid-svg-NoBXW3FVejFISSTd .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-svg-NoBXW3FVejFISSTd .edgeLabel rect{opacity:0.9}#mermaid-svg-NoBXW3FVejFISSTd .edgeLabel span{color:#333}#mermaid-svg-NoBXW3FVejFISSTd .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-svg-NoBXW3FVejFISSTd .cluster text{fill:#333}#mermaid-svg-NoBXW3FVejFISSTd div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-svg-NoBXW3FVejFISSTd .actor{stroke:#ccf;fill:#ECECFF}#mermaid-svg-NoBXW3FVejFISSTd text.actor>tspan{fill:#000;stroke:none}#mermaid-svg-NoBXW3FVejFISSTd .actor-line{stroke:grey}#mermaid-svg-NoBXW3FVejFISSTd .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333}#mermaid-svg-NoBXW3FVejFISSTd .messageLine1{stroke-width:1.5;stroke-dasharray:2, 2;stroke:#333}#mermaid-svg-NoBXW3FVejFISSTd #arrowhead path{fill:#333;stroke:#333}#mermaid-svg-NoBXW3FVejFISSTd .sequenceNumber{fill:#fff}#mermaid-svg-NoBXW3FVejFISSTd #sequencenumber{fill:#333}#mermaid-svg-NoBXW3FVejFISSTd #crosshead path{fill:#333;stroke:#333}#mermaid-svg-NoBXW3FVejFISSTd .messageText{fill:#333;stroke:#333}#mermaid-svg-NoBXW3FVejFISSTd .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-svg-NoBXW3FVejFISSTd .labelText,#mermaid-svg-NoBXW3FVejFISSTd .labelText>tspan{fill:#000;stroke:none}#mermaid-svg-NoBXW3FVejFISSTd .loopText,#mermaid-svg-NoBXW3FVejFISSTd .loopText>tspan{fill:#000;stroke:none}#mermaid-svg-NoBXW3FVejFISSTd .loopLine{stroke-width:2px;stroke-dasharray:2, 2;stroke:#ccf;fill:#ccf}#mermaid-svg-NoBXW3FVejFISSTd .note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-NoBXW3FVejFISSTd .noteText,#mermaid-svg-NoBXW3FVejFISSTd .noteText>tspan{fill:#000;stroke:none}#mermaid-svg-NoBXW3FVejFISSTd .activation0{fill:#f4f4f4;stroke:#666}#mermaid-svg-NoBXW3FVejFISSTd .activation1{fill:#f4f4f4;stroke:#666}#mermaid-svg-NoBXW3FVejFISSTd .activation2{fill:#f4f4f4;stroke:#666}#mermaid-svg-NoBXW3FVejFISSTd .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-NoBXW3FVejFISSTd .section{stroke:none;opacity:0.2}#mermaid-svg-NoBXW3FVejFISSTd .section0{fill:rgba(102,102,255,0.49)}#mermaid-svg-NoBXW3FVejFISSTd .section2{fill:#fff400}#mermaid-svg-NoBXW3FVejFISSTd .section1,#mermaid-svg-NoBXW3FVejFISSTd .section3{fill:#fff;opacity:0.2}#mermaid-svg-NoBXW3FVejFISSTd .sectionTitle0{fill:#333}#mermaid-svg-NoBXW3FVejFISSTd .sectionTitle1{fill:#333}#mermaid-svg-NoBXW3FVejFISSTd .sectionTitle2{fill:#333}#mermaid-svg-NoBXW3FVejFISSTd .sectionTitle3{fill:#333}#mermaid-svg-NoBXW3FVejFISSTd .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-NoBXW3FVejFISSTd .grid .tick{stroke:#d3d3d3;opacity:0.8;shape-rendering:crispEdges}#mermaid-svg-NoBXW3FVejFISSTd .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-NoBXW3FVejFISSTd .grid path{stroke-width:0}#mermaid-svg-NoBXW3FVejFISSTd .today{fill:none;stroke:red;stroke-width:2px}#mermaid-svg-NoBXW3FVejFISSTd .task{stroke-width:2}#mermaid-svg-NoBXW3FVejFISSTd .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-NoBXW3FVejFISSTd .taskText:not([font-size]){font-size:11px}#mermaid-svg-NoBXW3FVejFISSTd .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-NoBXW3FVejFISSTd .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-svg-NoBXW3FVejFISSTd .task.clickable{cursor:pointer}#mermaid-svg-NoBXW3FVejFISSTd .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-NoBXW3FVejFISSTd .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-NoBXW3FVejFISSTd .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-NoBXW3FVejFISSTd .taskText0,#mermaid-svg-NoBXW3FVejFISSTd .taskText1,#mermaid-svg-NoBXW3FVejFISSTd .taskText2,#mermaid-svg-NoBXW3FVejFISSTd .taskText3{fill:#fff}#mermaid-svg-NoBXW3FVejFISSTd .task0,#mermaid-svg-NoBXW3FVejFISSTd .task1,#mermaid-svg-NoBXW3FVejFISSTd .task2,#mermaid-svg-NoBXW3FVejFISSTd .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-svg-NoBXW3FVejFISSTd .taskTextOutside0,#mermaid-svg-NoBXW3FVejFISSTd .taskTextOutside2{fill:#000}#mermaid-svg-NoBXW3FVejFISSTd .taskTextOutside1,#mermaid-svg-NoBXW3FVejFISSTd .taskTextOutside3{fill:#000}#mermaid-svg-NoBXW3FVejFISSTd .active0,#mermaid-svg-NoBXW3FVejFISSTd .active1,#mermaid-svg-NoBXW3FVejFISSTd .active2,#mermaid-svg-NoBXW3FVejFISSTd .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-svg-NoBXW3FVejFISSTd .activeText0,#mermaid-svg-NoBXW3FVejFISSTd .activeText1,#mermaid-svg-NoBXW3FVejFISSTd .activeText2,#mermaid-svg-NoBXW3FVejFISSTd .activeText3{fill:#000 !important}#mermaid-svg-NoBXW3FVejFISSTd .done0,#mermaid-svg-NoBXW3FVejFISSTd .done1,#mermaid-svg-NoBXW3FVejFISSTd .done2,#mermaid-svg-NoBXW3FVejFISSTd .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-svg-NoBXW3FVejFISSTd .doneText0,#mermaid-svg-NoBXW3FVejFISSTd .doneText1,#mermaid-svg-NoBXW3FVejFISSTd .doneText2,#mermaid-svg-NoBXW3FVejFISSTd .doneText3{fill:#000 !important}#mermaid-svg-NoBXW3FVejFISSTd .crit0,#mermaid-svg-NoBXW3FVejFISSTd .crit1,#mermaid-svg-NoBXW3FVejFISSTd .crit2,#mermaid-svg-NoBXW3FVejFISSTd .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-svg-NoBXW3FVejFISSTd .activeCrit0,#mermaid-svg-NoBXW3FVejFISSTd .activeCrit1,#mermaid-svg-NoBXW3FVejFISSTd .activeCrit2,#mermaid-svg-NoBXW3FVejFISSTd .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-svg-NoBXW3FVejFISSTd .doneCrit0,#mermaid-svg-NoBXW3FVejFISSTd .doneCrit1,#mermaid-svg-NoBXW3FVejFISSTd .doneCrit2,#mermaid-svg-NoBXW3FVejFISSTd .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-svg-NoBXW3FVejFISSTd .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-svg-NoBXW3FVejFISSTd .milestoneText{font-style:italic}#mermaid-svg-NoBXW3FVejFISSTd .doneCritText0,#mermaid-svg-NoBXW3FVejFISSTd .doneCritText1,#mermaid-svg-NoBXW3FVejFISSTd .doneCritText2,#mermaid-svg-NoBXW3FVejFISSTd .doneCritText3{fill:#000 !important}#mermaid-svg-NoBXW3FVejFISSTd .activeCritText0,#mermaid-svg-NoBXW3FVejFISSTd .activeCritText1,#mermaid-svg-NoBXW3FVejFISSTd .activeCritText2,#mermaid-svg-NoBXW3FVejFISSTd .activeCritText3{fill:#000 !important}#mermaid-svg-NoBXW3FVejFISSTd .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-NoBXW3FVejFISSTd g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-svg-NoBXW3FVejFISSTd g.classGroup text .title{font-weight:bolder}#mermaid-svg-NoBXW3FVejFISSTd g.clickable{cursor:pointer}#mermaid-svg-NoBXW3FVejFISSTd g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-NoBXW3FVejFISSTd g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-NoBXW3FVejFISSTd .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-svg-NoBXW3FVejFISSTd .classLabel .label{fill:#9370db;font-size:10px}#mermaid-svg-NoBXW3FVejFISSTd .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-NoBXW3FVejFISSTd .dashed-line{stroke-dasharray:3}#mermaid-svg-NoBXW3FVejFISSTd #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-NoBXW3FVejFISSTd #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-NoBXW3FVejFISSTd #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-NoBXW3FVejFISSTd #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-NoBXW3FVejFISSTd #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-NoBXW3FVejFISSTd #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-NoBXW3FVejFISSTd #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-NoBXW3FVejFISSTd #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-NoBXW3FVejFISSTd .commit-id,#mermaid-svg-NoBXW3FVejFISSTd .commit-msg,#mermaid-svg-NoBXW3FVejFISSTd .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-NoBXW3FVejFISSTd .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-NoBXW3FVejFISSTd .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-NoBXW3FVejFISSTd g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-NoBXW3FVejFISSTd g.stateGroup text{fill:#9370db;fill:#333;stroke:none;font-size:10px}#mermaid-svg-NoBXW3FVejFISSTd g.statediagram-cluster .cluster-label text{fill:#333}#mermaid-svg-NoBXW3FVejFISSTd g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-svg-NoBXW3FVejFISSTd g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-NoBXW3FVejFISSTd g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-NoBXW3FVejFISSTd .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-NoBXW3FVejFISSTd .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-svg-NoBXW3FVejFISSTd .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px}#mermaid-svg-NoBXW3FVejFISSTd .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-NoBXW3FVejFISSTd .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-svg-NoBXW3FVejFISSTd .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.7}#mermaid-svg-NoBXW3FVejFISSTd .edgeLabel text{fill:#333}#mermaid-svg-NoBXW3FVejFISSTd .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-NoBXW3FVejFISSTd .node circle.state-start{fill:black;stroke:black}#mermaid-svg-NoBXW3FVejFISSTd .node circle.state-end{fill:black;stroke:white;stroke-width:1.5}#mermaid-svg-NoBXW3FVejFISSTd #statediagram-barbEnd{fill:#9370db}#mermaid-svg-NoBXW3FVejFISSTd .statediagram-cluster rect{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-NoBXW3FVejFISSTd .statediagram-cluster rect.outer{rx:5px;ry:5px}#mermaid-svg-NoBXW3FVejFISSTd .statediagram-state .divider{stroke:#9370db}#mermaid-svg-NoBXW3FVejFISSTd .statediagram-state .title-state{rx:5px;ry:5px}#mermaid-svg-NoBXW3FVejFISSTd .statediagram-cluster.statediagram-cluster .inner{fill:white}#mermaid-svg-NoBXW3FVejFISSTd .statediagram-cluster.statediagram-cluster-alt .inner{fill:#e0e0e0}#mermaid-svg-NoBXW3FVejFISSTd .statediagram-cluster .inner{rx:0;ry:0}#mermaid-svg-NoBXW3FVejFISSTd .statediagram-state rect.basic{rx:5px;ry:5px}#mermaid-svg-NoBXW3FVejFISSTd .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#efefef}#mermaid-svg-NoBXW3FVejFISSTd .note-edge{stroke-dasharray:5}#mermaid-svg-NoBXW3FVejFISSTd .statediagram-note rect{fill:#fff5ad;stroke:#aa3;stroke-width:1px;rx:0;ry:0}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}#mermaid-svg-NoBXW3FVejFISSTd .error-icon{fill:#522}#mermaid-svg-NoBXW3FVejFISSTd .error-text{fill:#522;stroke:#522}#mermaid-svg-NoBXW3FVejFISSTd .edge-thickness-normal{stroke-width:2px}#mermaid-svg-NoBXW3FVejFISSTd .edge-thickness-thick{stroke-width:3.5px}#mermaid-svg-NoBXW3FVejFISSTd .edge-pattern-solid{stroke-dasharray:0}#mermaid-svg-NoBXW3FVejFISSTd .edge-pattern-dashed{stroke-dasharray:3}#mermaid-svg-NoBXW3FVejFISSTd .edge-pattern-dotted{stroke-dasharray:2}#mermaid-svg-NoBXW3FVejFISSTd .marker{fill:#333}#mermaid-svg-NoBXW3FVejFISSTd .marker.cross{stroke:#333}:root { --mermaid-font-family: "trebuchet ms", verdana, arial;}#mermaid-svg-NoBXW3FVejFISSTd {color: rgba(0, 0, 0, 0.75);font: ;}

磁盘1
磁盘2
磁盘3
磁盘4 校验
read

容量:
磁盘1+磁盘2+磁盘3+磁盘4=总容量×43磁盘1+磁盘2+磁盘3+磁盘4=总容量\times \frac{4}{3} \\ 磁盘1+磁盘2+磁盘3+磁盘4=总容量×34​
校验其中,每一行相加为相同定值:

磁盘1 磁盘2 磁盘3 校验盘
A1 A2 A3 checksum1
B1 B2 checksum2 B3
C1 checksum3 C2 C3
checksum4 D1 D2 D3

从这个阵列的图示可以看出,RAID5 在读出效率方面非常的高,并且拥有一定的错误恢复能力,块式的集体访问效率较高,并且因为奇偶校验码分布在不同的磁盘上,所以拥有更高的可靠性,也就是说,当任意的一整个磁盘出现错误或者是出现故障的时候,我们都可以通过剩下的三个磁盘阵列将这个损坏的磁盘恢复出来。但是另外一方面,对于数据传输的并行性不好。

1.4 RAID 0+1

条带化,高冗余,可用率50%

#mermaid-svg-eIHBRPWNdXQu6i8B .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-eIHBRPWNdXQu6i8B .label text{fill:#333}#mermaid-svg-eIHBRPWNdXQu6i8B .node rect,#mermaid-svg-eIHBRPWNdXQu6i8B .node circle,#mermaid-svg-eIHBRPWNdXQu6i8B .node ellipse,#mermaid-svg-eIHBRPWNdXQu6i8B .node polygon,#mermaid-svg-eIHBRPWNdXQu6i8B .node path{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-eIHBRPWNdXQu6i8B .node .label{text-align:center;fill:#333}#mermaid-svg-eIHBRPWNdXQu6i8B .node.clickable{cursor:pointer}#mermaid-svg-eIHBRPWNdXQu6i8B .arrowheadPath{fill:#333}#mermaid-svg-eIHBRPWNdXQu6i8B .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-svg-eIHBRPWNdXQu6i8B .flowchart-link{stroke:#333;fill:none}#mermaid-svg-eIHBRPWNdXQu6i8B .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-svg-eIHBRPWNdXQu6i8B .edgeLabel rect{opacity:0.9}#mermaid-svg-eIHBRPWNdXQu6i8B .edgeLabel span{color:#333}#mermaid-svg-eIHBRPWNdXQu6i8B .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-svg-eIHBRPWNdXQu6i8B .cluster text{fill:#333}#mermaid-svg-eIHBRPWNdXQu6i8B div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-svg-eIHBRPWNdXQu6i8B .actor{stroke:#ccf;fill:#ECECFF}#mermaid-svg-eIHBRPWNdXQu6i8B text.actor>tspan{fill:#000;stroke:none}#mermaid-svg-eIHBRPWNdXQu6i8B .actor-line{stroke:grey}#mermaid-svg-eIHBRPWNdXQu6i8B .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333}#mermaid-svg-eIHBRPWNdXQu6i8B .messageLine1{stroke-width:1.5;stroke-dasharray:2, 2;stroke:#333}#mermaid-svg-eIHBRPWNdXQu6i8B #arrowhead path{fill:#333;stroke:#333}#mermaid-svg-eIHBRPWNdXQu6i8B .sequenceNumber{fill:#fff}#mermaid-svg-eIHBRPWNdXQu6i8B #sequencenumber{fill:#333}#mermaid-svg-eIHBRPWNdXQu6i8B #crosshead path{fill:#333;stroke:#333}#mermaid-svg-eIHBRPWNdXQu6i8B .messageText{fill:#333;stroke:#333}#mermaid-svg-eIHBRPWNdXQu6i8B .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-svg-eIHBRPWNdXQu6i8B .labelText,#mermaid-svg-eIHBRPWNdXQu6i8B .labelText>tspan{fill:#000;stroke:none}#mermaid-svg-eIHBRPWNdXQu6i8B .loopText,#mermaid-svg-eIHBRPWNdXQu6i8B .loopText>tspan{fill:#000;stroke:none}#mermaid-svg-eIHBRPWNdXQu6i8B .loopLine{stroke-width:2px;stroke-dasharray:2, 2;stroke:#ccf;fill:#ccf}#mermaid-svg-eIHBRPWNdXQu6i8B .note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-eIHBRPWNdXQu6i8B .noteText,#mermaid-svg-eIHBRPWNdXQu6i8B .noteText>tspan{fill:#000;stroke:none}#mermaid-svg-eIHBRPWNdXQu6i8B .activation0{fill:#f4f4f4;stroke:#666}#mermaid-svg-eIHBRPWNdXQu6i8B .activation1{fill:#f4f4f4;stroke:#666}#mermaid-svg-eIHBRPWNdXQu6i8B .activation2{fill:#f4f4f4;stroke:#666}#mermaid-svg-eIHBRPWNdXQu6i8B .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-eIHBRPWNdXQu6i8B .section{stroke:none;opacity:0.2}#mermaid-svg-eIHBRPWNdXQu6i8B .section0{fill:rgba(102,102,255,0.49)}#mermaid-svg-eIHBRPWNdXQu6i8B .section2{fill:#fff400}#mermaid-svg-eIHBRPWNdXQu6i8B .section1,#mermaid-svg-eIHBRPWNdXQu6i8B .section3{fill:#fff;opacity:0.2}#mermaid-svg-eIHBRPWNdXQu6i8B .sectionTitle0{fill:#333}#mermaid-svg-eIHBRPWNdXQu6i8B .sectionTitle1{fill:#333}#mermaid-svg-eIHBRPWNdXQu6i8B .sectionTitle2{fill:#333}#mermaid-svg-eIHBRPWNdXQu6i8B .sectionTitle3{fill:#333}#mermaid-svg-eIHBRPWNdXQu6i8B .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-eIHBRPWNdXQu6i8B .grid .tick{stroke:#d3d3d3;opacity:0.8;shape-rendering:crispEdges}#mermaid-svg-eIHBRPWNdXQu6i8B .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-eIHBRPWNdXQu6i8B .grid path{stroke-width:0}#mermaid-svg-eIHBRPWNdXQu6i8B .today{fill:none;stroke:red;stroke-width:2px}#mermaid-svg-eIHBRPWNdXQu6i8B .task{stroke-width:2}#mermaid-svg-eIHBRPWNdXQu6i8B .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-eIHBRPWNdXQu6i8B .taskText:not([font-size]){font-size:11px}#mermaid-svg-eIHBRPWNdXQu6i8B .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-eIHBRPWNdXQu6i8B .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-svg-eIHBRPWNdXQu6i8B .task.clickable{cursor:pointer}#mermaid-svg-eIHBRPWNdXQu6i8B .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-eIHBRPWNdXQu6i8B .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-eIHBRPWNdXQu6i8B .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-eIHBRPWNdXQu6i8B .taskText0,#mermaid-svg-eIHBRPWNdXQu6i8B .taskText1,#mermaid-svg-eIHBRPWNdXQu6i8B .taskText2,#mermaid-svg-eIHBRPWNdXQu6i8B .taskText3{fill:#fff}#mermaid-svg-eIHBRPWNdXQu6i8B .task0,#mermaid-svg-eIHBRPWNdXQu6i8B .task1,#mermaid-svg-eIHBRPWNdXQu6i8B .task2,#mermaid-svg-eIHBRPWNdXQu6i8B .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-svg-eIHBRPWNdXQu6i8B .taskTextOutside0,#mermaid-svg-eIHBRPWNdXQu6i8B .taskTextOutside2{fill:#000}#mermaid-svg-eIHBRPWNdXQu6i8B .taskTextOutside1,#mermaid-svg-eIHBRPWNdXQu6i8B .taskTextOutside3{fill:#000}#mermaid-svg-eIHBRPWNdXQu6i8B .active0,#mermaid-svg-eIHBRPWNdXQu6i8B .active1,#mermaid-svg-eIHBRPWNdXQu6i8B .active2,#mermaid-svg-eIHBRPWNdXQu6i8B .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-svg-eIHBRPWNdXQu6i8B .activeText0,#mermaid-svg-eIHBRPWNdXQu6i8B .activeText1,#mermaid-svg-eIHBRPWNdXQu6i8B .activeText2,#mermaid-svg-eIHBRPWNdXQu6i8B .activeText3{fill:#000 !important}#mermaid-svg-eIHBRPWNdXQu6i8B .done0,#mermaid-svg-eIHBRPWNdXQu6i8B .done1,#mermaid-svg-eIHBRPWNdXQu6i8B .done2,#mermaid-svg-eIHBRPWNdXQu6i8B .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-svg-eIHBRPWNdXQu6i8B .doneText0,#mermaid-svg-eIHBRPWNdXQu6i8B .doneText1,#mermaid-svg-eIHBRPWNdXQu6i8B .doneText2,#mermaid-svg-eIHBRPWNdXQu6i8B .doneText3{fill:#000 !important}#mermaid-svg-eIHBRPWNdXQu6i8B .crit0,#mermaid-svg-eIHBRPWNdXQu6i8B .crit1,#mermaid-svg-eIHBRPWNdXQu6i8B .crit2,#mermaid-svg-eIHBRPWNdXQu6i8B .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-svg-eIHBRPWNdXQu6i8B .activeCrit0,#mermaid-svg-eIHBRPWNdXQu6i8B .activeCrit1,#mermaid-svg-eIHBRPWNdXQu6i8B .activeCrit2,#mermaid-svg-eIHBRPWNdXQu6i8B .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-svg-eIHBRPWNdXQu6i8B .doneCrit0,#mermaid-svg-eIHBRPWNdXQu6i8B .doneCrit1,#mermaid-svg-eIHBRPWNdXQu6i8B .doneCrit2,#mermaid-svg-eIHBRPWNdXQu6i8B .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-svg-eIHBRPWNdXQu6i8B .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-svg-eIHBRPWNdXQu6i8B .milestoneText{font-style:italic}#mermaid-svg-eIHBRPWNdXQu6i8B .doneCritText0,#mermaid-svg-eIHBRPWNdXQu6i8B .doneCritText1,#mermaid-svg-eIHBRPWNdXQu6i8B .doneCritText2,#mermaid-svg-eIHBRPWNdXQu6i8B .doneCritText3{fill:#000 !important}#mermaid-svg-eIHBRPWNdXQu6i8B .activeCritText0,#mermaid-svg-eIHBRPWNdXQu6i8B .activeCritText1,#mermaid-svg-eIHBRPWNdXQu6i8B .activeCritText2,#mermaid-svg-eIHBRPWNdXQu6i8B .activeCritText3{fill:#000 !important}#mermaid-svg-eIHBRPWNdXQu6i8B .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-eIHBRPWNdXQu6i8B g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-svg-eIHBRPWNdXQu6i8B g.classGroup text .title{font-weight:bolder}#mermaid-svg-eIHBRPWNdXQu6i8B g.clickable{cursor:pointer}#mermaid-svg-eIHBRPWNdXQu6i8B g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-eIHBRPWNdXQu6i8B g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-eIHBRPWNdXQu6i8B .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-svg-eIHBRPWNdXQu6i8B .classLabel .label{fill:#9370db;font-size:10px}#mermaid-svg-eIHBRPWNdXQu6i8B .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-eIHBRPWNdXQu6i8B .dashed-line{stroke-dasharray:3}#mermaid-svg-eIHBRPWNdXQu6i8B #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-eIHBRPWNdXQu6i8B #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-eIHBRPWNdXQu6i8B #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-eIHBRPWNdXQu6i8B #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-eIHBRPWNdXQu6i8B #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-eIHBRPWNdXQu6i8B #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-eIHBRPWNdXQu6i8B #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-eIHBRPWNdXQu6i8B #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-eIHBRPWNdXQu6i8B .commit-id,#mermaid-svg-eIHBRPWNdXQu6i8B .commit-msg,#mermaid-svg-eIHBRPWNdXQu6i8B .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-eIHBRPWNdXQu6i8B .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-eIHBRPWNdXQu6i8B .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-eIHBRPWNdXQu6i8B g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-eIHBRPWNdXQu6i8B g.stateGroup text{fill:#9370db;fill:#333;stroke:none;font-size:10px}#mermaid-svg-eIHBRPWNdXQu6i8B g.statediagram-cluster .cluster-label text{fill:#333}#mermaid-svg-eIHBRPWNdXQu6i8B g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-svg-eIHBRPWNdXQu6i8B g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-eIHBRPWNdXQu6i8B g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-eIHBRPWNdXQu6i8B .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-eIHBRPWNdXQu6i8B .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-svg-eIHBRPWNdXQu6i8B .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px}#mermaid-svg-eIHBRPWNdXQu6i8B .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-eIHBRPWNdXQu6i8B .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-svg-eIHBRPWNdXQu6i8B .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.7}#mermaid-svg-eIHBRPWNdXQu6i8B .edgeLabel text{fill:#333}#mermaid-svg-eIHBRPWNdXQu6i8B .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-eIHBRPWNdXQu6i8B .node circle.state-start{fill:black;stroke:black}#mermaid-svg-eIHBRPWNdXQu6i8B .node circle.state-end{fill:black;stroke:white;stroke-width:1.5}#mermaid-svg-eIHBRPWNdXQu6i8B #statediagram-barbEnd{fill:#9370db}#mermaid-svg-eIHBRPWNdXQu6i8B .statediagram-cluster rect{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-eIHBRPWNdXQu6i8B .statediagram-cluster rect.outer{rx:5px;ry:5px}#mermaid-svg-eIHBRPWNdXQu6i8B .statediagram-state .divider{stroke:#9370db}#mermaid-svg-eIHBRPWNdXQu6i8B .statediagram-state .title-state{rx:5px;ry:5px}#mermaid-svg-eIHBRPWNdXQu6i8B .statediagram-cluster.statediagram-cluster .inner{fill:white}#mermaid-svg-eIHBRPWNdXQu6i8B .statediagram-cluster.statediagram-cluster-alt .inner{fill:#e0e0e0}#mermaid-svg-eIHBRPWNdXQu6i8B .statediagram-cluster .inner{rx:0;ry:0}#mermaid-svg-eIHBRPWNdXQu6i8B .statediagram-state rect.basic{rx:5px;ry:5px}#mermaid-svg-eIHBRPWNdXQu6i8B .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#efefef}#mermaid-svg-eIHBRPWNdXQu6i8B .note-edge{stroke-dasharray:5}#mermaid-svg-eIHBRPWNdXQu6i8B .statediagram-note rect{fill:#fff5ad;stroke:#aa3;stroke-width:1px;rx:0;ry:0}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}#mermaid-svg-eIHBRPWNdXQu6i8B .error-icon{fill:#522}#mermaid-svg-eIHBRPWNdXQu6i8B .error-text{fill:#522;stroke:#522}#mermaid-svg-eIHBRPWNdXQu6i8B .edge-thickness-normal{stroke-width:2px}#mermaid-svg-eIHBRPWNdXQu6i8B .edge-thickness-thick{stroke-width:3.5px}#mermaid-svg-eIHBRPWNdXQu6i8B .edge-pattern-solid{stroke-dasharray:0}#mermaid-svg-eIHBRPWNdXQu6i8B .edge-pattern-dashed{stroke-dasharray:3}#mermaid-svg-eIHBRPWNdXQu6i8B .edge-pattern-dotted{stroke-dasharray:2}#mermaid-svg-eIHBRPWNdXQu6i8B .marker{fill:#333}#mermaid-svg-eIHBRPWNdXQu6i8B .marker.cross{stroke:#333}:root { --mermaid-font-family: "trebuchet ms", verdana, arial;}#mermaid-svg-eIHBRPWNdXQu6i8B {color: rgba(0, 0, 0, 0.75);font: ;}

磁盘1
磁盘2
read
备份1
备份2

即 RAID 0 和 RAID 1 的结合,既拥有全冗余的能力,又使得数据分布在多个盘上,可以一次读取多个磁盘,提供了并行读取的能力。

2. LVM


2.1 逻辑卷管理

  • PV:物理卷,指的是硬盘分区或从逻辑上于磁盘分区具有同样功能的设备,例如 RAID 磁盘阵列
  • VG:卷组,PV的集合,逻辑层面的物理硬盘
  • LV:逻辑卷,非LVM系统中的硬盘分区,再逻辑卷之上可以建立文件系统,从而系统不再直接对物理卷进行操作,而是对抽象出来的逻辑卷进行访问
  • PE:每一个物理卷被划分为称为PE(Physical Extents)的基本单元,具有唯一编号的PE是可以被LVM寻址的最小单元
  • LE:逻辑卷也被划分为被称为LE(Logical Extents)的可被寻址的基本单位。再同一个卷组中,LE的大小和PE是相同的,并且是一一对应的

如下图所示,每一个硬盘设备的一个硬盘分区在逻辑上都会对应一个物理卷(PV),而对应不同硬盘的每一个 PV 都可以用于组成一个卷组(VG),即通过这样的方法将卷组管理和磁盘分区在硬件层面上的限制分离开来,从而将每一个存储设备都当作一个整体来使用,这样就可以通过直接添加新的硬盘设备在进行磁盘空间扩增,而不影响顶层文件系统的逻辑。

2.2 磁盘分区

根据具体要求可以将磁盘的物理空间划分为多个分区,使得操作系统可以进行更加高效的文件存储管理。分区和操作系统之间是分离的,因此可以在安装操作系统之前进行分区的划分。

MBR(Master Boot Record)主引导记录分区,分区类型有两种:

  • 主分区 (primary partion):最多有四个(磁盘分区表一共是 64 个字节,每个主分区的分区信息占 16 个字节,最多 4 个主分区)
  • 扩展分区(extension partion) :N 个逻辑分区的集合,把最后一个主分区作为扩展分区来划分,分割出来多个逻辑分区,物理上不存在,类似于指向这个主分区的某块存储空间的若干指针

以上两个分区以及硬盘主引导分区一起,共同构成硬盘的组成部分。

2.2.1 命名

IDE硬盘:

  • 磁盘名:hda, hdb, hdc…
  • 分区名:hda1, hda2, …(主分区为1到4,扩展分区从5开始)

SATA硬盘:

  • 磁盘名:sda, sdb, sdc…
  • 分区名:sda1, sda2, … (同理)

2.2.2 分区和挂载

而对于这些磁盘和分区来说,事实上在 Linux 系统里面依然也是以文件的形式存在的(在 Linux 中一切皆为文件),因此当我们希望对磁盘进行操作的时候,也还是一个对文件进行操作的过程。

在 Linux 中,每个分区都对应一个特定的目录,必须将分区挂载到对应的目录上进行文件的操作,此时任何对文件的操作即是作用在对应的磁盘分区之上。Linux 文件系统的默认目录事实上就是几个 Linux 默认的挂载点,例如 '/' 根目录即为根分区,所有未指定挂载点的目录都会存放到这个目录之下,这个目录必须挂载到主分区上,否则系统将会因找不到启动文件而不能正常启动;而 /boot 目录则是包含了操作系统的内核在启动系统的过程中所需要的文件,通常大小在 100M 和 200M 之间。

当一个磁盘分区创建完成之后,在进行挂载之前,需要对分区空间进行格式化为对应的文件系统类型,例如:

  • ext2/3/4:默认为更加高效的 ext4
  • physical volume(LVM):弹性扩展的分区管理
  • swap:内存交换空间,并不会挂载到目录上
  • vfat:同时被 Linux 和 Windows 支持,可以用于双系统的主机上进行不同系统之间的数据交互
  • xfs:centos 7 中的默认文件系统类型,替代 ext4

3. 分区管理

按照正确步骤成功完成 Red Hat 安装之后,此时安装完成的系统中将会存在三个分区:

  • /:根分区,对应磁盘为 sda
  • /boot:启动分区,对应为
  • /swap:交换分区,对应 swap
df -h

可以看到已经划分的磁盘分区状态,包括了 大小(Size),已使用空间(Used),可用空间(Avail),已用百分比(Use%),挂载目录(Mounted On):

Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/rhel-rootlv   16G  1.8G   15G  12% /
devtmpfs                 902M     0  902M   0% /dev
tmpfs                    912M     0  912M   0% /dev/shm
tmpfs                    912M  8.6M  904M   1% /run
tmpfs                    912M     0  912M   0% /sys/fs/cgroup
/dev/sda1                197M  119M   79M  61% /boot
tmpfs                    183M     0  183M   0% /run/user/0

此时可以用到:

fdisk -l

可以看到此时所有可用磁盘的分区划分状态:

Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0001ceebDevice Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      411647      204800   83  Linux
/dev/sda2          411648    41943039    20765696   8e  Linux LVMDisk /dev/mapper/rootvg-rootlv: 17.0 GB, 16965959680 bytes, 33136640 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/rootvg-swaplv1: 4294 MB, 4294967296 bytes, 8388608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

3.1 添加新虚拟硬盘

可以看到,虚拟磁盘 sda 空间已被全部分配,因此我们需要添加一块新的虚拟磁盘,通过在虚拟机设置的添加按钮中用管理员权限创建新的虚拟磁盘:





此时可以看到,出现了一个新的硬盘 2(SCSI),创建成功:

这时,重启虚拟机,再次查看磁盘状态,可以看到出现了一个新的磁盘设备 /dev/sdb,:

Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0001ceebDevice Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      411647      204800   83  Linux
/dev/sda2          411648    41943039    20765696   8e  Linux LVMDisk /dev/sdb: 10.7 GB, 10737418240 bytes, 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/rootvg-rootlv: 17.0 GB, 16965959680 bytes, 33136640 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/rootvg-swaplv1: 4294 MB, 4294967296 bytes, 8388608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

3.2 主分区和扩展分区创建和使用

在关于 Linux 的问题上,往往会强调一句话:一切皆为文件,事实上在 Linux 操作系统中,甚至连磁盘分区都被淡化,所有设备分区都在 /dev 目录之下已文件的形式存在:

[root@localhost ~]# ls /dev/
agpgart        core             fb0        kmsg          network_latency     random  sg1       tty0   tty17  tty25  tty33  tty41  tty5   tty58  tty9     usbmon1  vcsa         vhci
autofs         cpu              fd         log           network_throughput  raw     shm       tty1   tty18  tty26  tty34  tty42  tty50  tty59  ttyS0    usbmon2  vcsa1        vhost-net
block          cpu_dma_latency  full       loop-control  null                rootvg  snapshot  tty10  tty19  tty27  tty35  tty43  tty51  tty6   ttyS1    vcs      vcsa2        vmci
bsg            crash            fuse       mapper        nvram               rtc     snd       tty11  tty2   tty28  tty36  tty44  tty52  tty60  ttyS2    vcs1     vcsa3        vsock
btrfs-control  disk             hidraw0    mcelog        oldmem              rtc0    sr0       tty12  tty20  tty29  tty37  tty45  tty53  tty61  ttyS3    vcs2     vcsa4        zero
bus            dm-0             hpet       mem           port                sda     stderr    tty13  tty21  tty3   tty38  tty46  tty54  tty62  uhid     vcs3     vcsa5
cdrom          dm-1             hugepages  midi          ppp                 sda1    stdin     tty14  tty22  tty30  tty39  tty47  tty55  tty63  uinput   vcs4     vcsa6
char           dmmidi           initctl    mqueue        ptmx                sda2    stdout    tty15  tty23  tty31  tty4   tty48  tty56  tty7   urandom  vcs5     vfio
console        dri              input      net           pts                 sg0     tty       tty16  tty24  tty32  tty40  tty49  tty57  tty8   usbmon0  vcs6     vga_arbiter

通过 fdisk 命令,加上相应的分区文件路径作为参数,可以进入该分区进行操作:

fdisk /dev/sdb

命令行界面:

Welcome to fdisk (util-linux 2.23.2).Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x45c30369.Command (m for help):

输入 m 可以看到命令提示:

Command actiona   toggle a bootable flagb   edit bsd disklabelc   toggle the dos compatibility flagd   delete a partitiong   create a new empty GPT partition tableG   create an IRIX (SGI) partition tablel   list known partition typesm   print this menun   add a new partitiono   create a new empty DOS partition tablep   print the partition tableq   quit without saving changess   create a new empty Sun disklabelt   change a partition's system idu   change display/entry unitsv   verify the partition tablew   write table to disk and exitx   extra functionality (experts only)

可以看到这样的几个功能:

  • n :用于创建一个新的分区
  • l :列出所有已知的分区类型
  • q :直接退出
  • t :调整分区的系统类型
  • w :保存并退出

首先,划分一个新的分区:

Command (m for help): n
Partition type:p   primary (0 primary, 0 extended, 4 free)e   extended
Select (default p): p

primary 即为主分区,extended 为扩展分区,共有四个分区可用。通常一个分区信息大小为 16KB,而设备卷首信息头大小为 64 KB,所以至多只能划分 4 个分区,选择主分区之后,可以看到提示的分区号为 1-4,选择分区 1:

Partition number (1-4, default 1): 1

选择分区起始块位置,默认为从第 2048 块开始:

First sector (2048-20971519, default 2048):2048

选择分区大小,可选方式 +扇区数量或者是分区大小,单位为 K,M,G,这里分配 5 G 的空间:

Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519):+5G
Partition 1 of type Linux and of size 5 GiB is set

创建完成分区之后,通过 w 选项保存并退出(q 直接退出):

Command (m for help): w
The partition table has been altered!Calling ioctl() to re-read partition table.
Syncing disks.

再次查看分区状态:

Disk /dev/sdb: 10.7 GB, 10737418240 bytes, 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xb5bcd435Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    10487807     5242880   83  Linux

此时,在 sdb 下出现了一个新的分区 sdb1,分区创建完成。如果希望创建更多的分区,Linux 中是将最后一块,即第四块分区作为扩展分区,来划分出更多的分区,接下来重复上述过程,我们在创建3个分区,大小分别为 2G,2G,1G:

Disk /dev/sdb: 10.7 GB, 10737418240 bytes, 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xb5bcd435Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    10487807     5242880   83  Linux
/dev/sdb2        10487808    14682111     2097152   83  Linux
/dev/sdb3        14682112    18876415     2097152   83  Linux
/dev/sdb4        18876416    20971519     1047552    5  Extended

可以看到,正如前文所讲,第四块主分区被用来作为扩展分区,这时我们再次通过 fdisk /dev/sdb 命令编辑磁盘分区,输入 n 新建一个分区,可以看到:

Command (m for help): n
All primary partitions are in use
Adding logical partition 5
First sector (18878464-20971519, default 18878464):

此时系统提示,所有的主分区已在用,现在开始添加逻辑分区 5,可以看到起始扇区就是扩展分区的起始扇区 + 2048,也就是说,除了分区首部信息之外,整个分区的实际使用空间都用于进行逻辑分区的分配。此时,选择默认的起始扇区,创建一个大小为 100M 的逻辑分区:

Last sector, +sectors or +size{K,M,G} (18878464-20971519, default 20971519): +100M
Partition 5 of type Linux and of size 100 MiB is set

输入 w 保存退出,再次查看磁盘分区状态:

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    10487807     5242880   83  Linux
/dev/sdb2        10487808    14682111     2097152   83  Linux
/dev/sdb3        14682112    18876415     2097152   83  Linux
/dev/sdb4        18876416    20971519     1047552    5  Extended
/dev/sdb5        18878464    19083263      102400   83  Linux

可以看到,此时新的逻辑分区的系统类型和前面三个主分区事实上是一样的,也就是在逻辑上同样是当作主分区来使用,但是物理上起始是属于第四块主分区,也就是扩展分区之中的空间。

3.3 LVM:逻辑卷的创建和使用


此时,已有的分区为:sdb1,sdb2,sdb3,接下来,通过 pvcreate 为每个分区创建物理卷(PV),但是在这之前,首先需要调整分区类型,使其可以用于 LVM。再次通过 fdisk /dev/sdb 进行编辑,输入命令 t 进行系统类型调整,选择第一块分区:

Command (m for help): t
Partition number (1-5, default 5): 1

此时,系统要求输入 64 位代号选择类型,根据提示通过 L 列出所有的可选代号,可以看到 ‘8e’ 为 Linux LVM,

Hex code (type L to list all codes): L0  Empty           24  NEC DOS         81  Minix / old Lin bf  Solaris        1  FAT12           27  Hidden NTFS Win 82  Linux swap / So c1  DRDOS/sec (FAT-2  XENIX root      39  Plan 9          83  Linux           c4  DRDOS/sec (FAT-3  XENIX usr       3c  PartitionMagic  84  OS/2 hidden C:  c6  DRDOS/sec (FAT-4  FAT16 <32M      40  Venix 80286     85  Linux extended  c7  Syrinx         5  Extended        41  PPC PReP Boot   86  NTFS volume set da  Non-FS data    6  FAT16           42  SFS             87  NTFS volume set db  CP/M / CTOS / .7  HPFS/NTFS/exFAT 4d  QNX4.x          88  Linux plaintext de  Dell Utility   8  AIX             4e  QNX4.x 2nd part 8e  Linux LVM       df  BootIt         9  AIX bootable    4f  QNX4.x 3rd part 93  Amoeba          e1  DOS access     a  OS/2 Boot Manag 50  OnTrack DM      94  Amoeba BBT      e3  DOS R/O        b  W95 FAT32       51  OnTrack DM6 Aux 9f  BSD/OS          e4  SpeedStor      c  W95 FAT32 (LBA) 52  CP/M            a0  IBM Thinkpad hi eb  BeOS fs        e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a5  FreeBSD         ee  GPT            f  W95 Ext'd (LBA) 54  OnTrackDM6      a6  OpenBSD         ef  EFI (FAT-12/16/
10  OPUS            55  EZ-Drive        a7  NeXTSTEP        f0  Linux/PA-RISC b
11  Hidden FAT12    56  Golden Bow      a8  Darwin UFS      f1  SpeedStor
12  Compaq diagnost 5c  Priam Edisk     a9  NetBSD          f4  SpeedStor
14  Hidden FAT16 <3 61  SpeedStor       ab  Darwin boot     f2  DOS secondary
16  Hidden FAT16    63  GNU HURD or Sys af  HFS / HFS+      fb  VMware VMFS
17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fc  VMware VMKCORE
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fd  Linux raid auto
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid fe  LANstep
1c  Hidden W95 FAT3 75  PC/IX           be  Solaris boot    ff  BBT
1e  Hidden W95 FAT1 80  Old Minix

输入 8e ,调整为 Linux LVM:

Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'

此时,保存退出,查看状态:

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    10487807     5242880   8e  Linux LVM
/dev/sdb2        10487808    14682111     2097152   83  Linux
/dev/sdb3        14682112    18876415     2097152   83  Linux
/dev/sdb4        18876416    20971519     1047552    5  Extended
/dev/sdb5        18878464    19083263      102400   83  Linux

修改保存成功,重复上述过程,将三个主分区都调整为 Linux LVM 类型,即可进行物理卷创建:

pvcreate /dev/sdb1
pvcreate /dev/sdb2
pvcreate /dev/sdb3

全部提示创建成功,接下来通过 pvdisplay 查看创建情况:

[root@localhost ~]# pvdisplay --- Physical volume ---PV Name               /dev/sda2VG Name               rootvgPV Size               19.80 GiB / not usable 3.00 MiBAllocatable           yes (but full)PE Size               4.00 MiBTotal PE              5069Free PE               0Allocated PE          5069PV UUID               Q1f8v5-Jy2m-q1Wn-28Np-sr39-I16I-jvB332"/dev/sdb3" is a new physical volume of "2.00 GiB"--- NEW Physical volume ---PV Name               /dev/sdb3VG Name               PV Size               2.00 GiBAllocatable           NOPE Size               0   Total PE              0Free PE               0Allocated PE          0PV UUID               xWmxvO-6k2g-FnWs-J0YL-N4S8-zWWb-N4bdzb"/dev/sdb2" is a new physical volume of "2.00 GiB"--- NEW Physical volume ---PV Name               /dev/sdb2VG Name               PV Size               2.00 GiBAllocatable           NOPE Size               0   Total PE              0Free PE               0Allocated PE          0PV UUID               VGlj1B-hJup-B7GF-zlXB-QczV-N8Dh-I85g5L"/dev/sdb1" is a new physical volume of "5.00 GiB"--- NEW Physical volume ---PV Name               /dev/sdb1VG Name               PV Size               5.00 GiBAllocatable           NOPE Size               0   Total PE              0Free PE               0Allocated PE          0PV UUID               ylJYqM-qMoN-Opkd-fswz-YQ8F-tTcj-eFuHlc

接下来创建卷组(VG),通过 vgcreate 进行创建(vgremove 进行移除):

[root@localhost ~]# vgcreate vg1 /dev/sdb1 /dev/sdb2 /dev/sdb3Volume group "vg1" successfully created

查看:

[root@localhost ~]# vgdisplay ...--- Volume group ---VG Name               vg1System ID             Format                lvm2Metadata Areas        3Metadata Sequence No  1VG Access             read/writeVG Status             resizableMAX LV                0Cur LV                0Open LV               0Max PV                0Cur PV                3Act PV                3VG Size               8.99 GiBPE Size               4.00 MiBTotal PE              2301Alloc PE / Size       0 / 0   Free  PE / Size       2301 / 8.99 GiBVG UUID               dSYeSJ-0VNq-1Tg0-0INR-w4KI-MjqD-NkKsOL

接下来,我们就可以进行逻辑卷的创建了:

lvcreate -L 100M -n lv1 vg1

查看:

[root@localhost ~]# lvdisplay ...--- Logical volume ---LV Path                /dev/vg1/lv1LV Name                lv1VG Name                vg1LV UUID                U4ij5R-imsy-PmeK-pj4A-pWRn-2pJg-2jbrZ8LV Write Access        read/writeLV Creation host, time localhost.localdomain, 2020-10-13 00:56:13 +0800LV Status              available# open                 0LV Size                100.00 MiBCurrent LE             25Segments               1Allocation             inheritRead ahead sectors     auto- currently set to     8192Block device           253:2

然后,正如前文所讲,在挂载到相应的目录之前,需要进行格式化:

[root@localhost ~]# mkfs.ext4 /dev/vg1/lv1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
25688 inodes, 102400 blocks
5120 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=33685504
13 block groups
8192 blocks per group, 8192 fragments per group
1976 inodes per group
Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done 

创建一个挂载点:

mkdir /lvm1-mount

挂载:

mount /dev/vg1/lv1 /lvm1-mount

此时,我们即可在该目录下对逻辑卷进行读写了。

关于磁盘阵列和LVM相关推荐

  1. 磁盘阵列raid LVM创建

    1.磁盘阵列(raid)详解:磁盘阵列,有独立磁盘构成的具有冗余能力的阵列. raid0:(一种简单的.无数据校验的数据条带化技术)它的性能是所有raid中是最好的. 特点:成本低,高读写性能: 10 ...

  2. RAID磁盘阵列和LVM磁盘管理

    RAID是英文Redundant Array of Independent Disks的缩写,中文简称为独立冗余磁盘阵列.简单的说,RAID是一种把多块独立的硬盘(物理硬盘)按不同的方式组合起来形成一 ...

  3. RHEL磁盘阵列与LVM逻辑卷管理器

    磁盘阵列和逻辑管理器 本篇博客和各位聊聊关于linux系统中的相关磁盘阵列和逻辑管理器,都是涉及到硬件方面的操作.那我们为什么需要使用LVM以及配置RAID呢? 一般在公司中服务器需要保证数据的安全性 ...

  4. 2-6 磁盘阵列和LVM

    目的:提升硬盘的性能,提升安全性,加快读写速率. 解决办法:RAID 0,RAID 1,RAID 5,RAID 10. RAID 0:简单理解,将两块硬盘捆绑在一起,同时读写数据,提升数据的吞吐速度, ...

  5. Linux-通过LVM对服务器磁盘进行动态扩容

    最近在一次部署配置服务器的过程中,部署完成后使用的时候发现磁盘空间不能满足需求需要扩容,于是就在服务器的硬盘位增加了几块硬盘,然后在Linux管理后台,格式化.挂载磁盘.磁盘分区.结果是操作完成后(服 ...

  6. Linux 系统启动流程及其介绍

    熟悉Linux系统启动流程可以更好的排除Linux系统在启动的过程中所遇到的错误,下面介绍Linux系统在启动过程. 开机,BIOS自检:检测外置设备,目的是为了把外围设备的信息提供给操作系统使用 寻 ...

  7. 分布式对象存储系统在openstack中的应用研究--Ceph(一)

    Ceph介绍 Ceph的是一个大规模的.可扩展的.开源的分布式存储系统.它包括对象存储,块存储,并且符合是POSIX标准的分布式文件系统.Ceph具有自我修复和自我管理,并且没有单点故障等优点. Ce ...

  8. VM虚拟机下安装CentOS_6.5_x64

    在开始Linux的学习之前,我们必须要有一个实验环境.这里我选择了安装CentOS-6.5-x86_64的Minimal版本,大家也可以选择安装其他的Linux发行版.选择CentOS主要还是因为它比 ...

  9. Linux 命令(123)—— iostat 命令

    文章目录 1.命令简介 2.命令格式 3.选项说明 4.常用示例 参考文献 1.命令简介 iostat(IO statistics)命令被用于监视 CPU 和输入输出设备的使用情况.iostat 有一 ...

最新文章

  1. 试用最新版本的live writer发一篇日志看看
  2. 【linux】——ubuntu12.04 下安装wine和wine乱码解决方案
  3. python3下载文件-使用Python 3从网上下载文件
  4. 1.3 单一数字评估指标-深度学习第三课《结构化机器学习项目》-Stanford吴恩达教授
  5. ActiveMQ的消息重发策略和DLQ处理
  6. c# 变量,对象,静态类型,集合类的线程安全回顾
  7. osal_start_timerEx(Lock_TaskID,SBP_START_DEVICE_EVT,SBP_PERIODIC_EVT_PERIOD)的理解
  8. 计算机硬件知识考证题,计算机硬件知识题(答案)资料
  9. 平衡二叉树中需要旋转的情况
  10. Javascript图片滚动
  11. 【Calcite】Calcite入门
  12. WebAPI——cookie与session遇到的问题
  13. 狼来了!中国房地产的实质--比喻太生动了
  14. 西门子G120调试参数设置
  15. 小福利,e分钟带你爬取海量专利数据并保存为excel文件
  16. uni-app微信小程序——商城(8)——订单详情
  17. windows用户验证
  18. CeoMax总裁WordPress模板3.8.1免受权版本
  19. SAP - 采购价格确定 ①
  20. iOS15.4 Beta4 新测试版推送,新增反跟踪功能

热门文章

  1. JavaScript 设计模式之发布-订阅模式(下)
  2. (架构)后端技术体系框架
  3. 关于UDP双向通信原理解释与范例
  4. 神经网络如何告别黑箱,可解释?
  5. PLSQL的存储过程和函数
  6. 摸鱼神器:在命令行中玩斗地主
  7. 出现 java.lang.UnsupportedClassVersionError 错误的原因及解决方法
  8. win10解压安装mysql方法及遇见的问题(缺少MSVCR120.dll文件、服务无法启动)
  9. Android流媒体开发之路二:NDK C++开发Android端RTMP直播推流程序
  10. 使用Obj2gltf 将Obj格式转换为glft格式