此文章不详细介绍各工具的使用方法。
具体使用到的工具有parted,mkfs.ext4,e2label,LVM管理
一、普通硬盘方式挂载数据盘
1、使用parted -l查看,发现硬盘。
650) this.width=650;" width="526" height="246" title="Image(28)" style="border-top-width:0px;border-right-width:0px;border-bottom-width:0px;" alt="Image(28)" src="http://s3.51cto.com/wyfs02/M00/76/AF/wKiom1ZZOTnjQwh5AAAhy99m8y0247.png" border="0" />
2、使用parted工具对硬盘分区
650) this.width=650;" width="704" height="303" title="Image(29)" style="border-top-width:0px;border-right-width:0px;border-bottom-width:0px;" alt="Image(29)" src="http://s3.51cto.com/wyfs02/M02/76/AE/wKioL1ZZOZzxgwwGAAD1F8eIL4M849.png" border="0" />
查看命令具体用法:
650) this.width=650;" width="704" height="180" title="Image(30)" style="border-top-width:0px;border-right-width:0px;border-bottom-width:0px;" alt="Image(30)" src="http://s3.51cto.com/wyfs02/M00/76/AE/wKioL1ZZOZ2SbF1KAACfDl5J-C4389.png" border="0" />
创建分区表,格式为gpt
650) this.width=650;" width="530" height="191" title="Image(31)" style="border-top-width:0px;border-right-width:0px;border-bottom-width:0px;" alt="Image(31)" src="http://s3.51cto.com/wyfs02/M01/76/AE/wKioL1ZZOZ2BLzhHAAAZwUplKYA015.png" border="0" />
创建分区,发现不支持ext4格式,所以先不格式化
650) this.width=650;" width="704" height="327" title="Image(32)" style="border-top-width:0px;border-right-width:0px;border-bottom-width:0px;" alt="Image(32)" src="http://s3.51cto.com/wyfs02/M02/76/AF/wKiom1ZZOT6ThGHxAADh12r6eUc130.png" border="0" />
3、格式化分区成ext4格式
650) this.width=650;" width="684" height="438" title="Image(33)" style="border-top-width:0px;border-right-width:0px;border-bottom-width:0px;" alt="Image(33)" src="http://s3.51cto.com/wyfs02/M01/76/AE/wKioL1ZZOaCBI7kTAABCAnx1avQ186.png" border="0" />
4、创建分区标签,挂载分区,添加永久生效
650) this.width=650;" width="652" height="326" title="Image(34)" style="border-top-width:0px;border-right-width:0px;border-bottom-width:0px;" alt="Image(34)" src="http://s3.51cto.com/wyfs02/M00/76/AF/wKiom1ZZOUCwOgf9AAA5mfx414Y713.png" border="0" />
二、LVM方式挂载数据盘
1、创建PV
650) this.width=650;" width="579" height="277" title="Image(35)" style="border-top-width:0px;border-right-width:0px;border-bottom-width:0px;" alt="Image(35)" src="http://s3.51cto.com/wyfs02/M02/76/AE/wKioL1ZZOaKg-gf-AAAmfmyGHyU475.png" border="0" />
2、创建VG
650) this.width=650;" width="585" height="512" title="Image(36)" style="border-top-width:0px;border-right-width:0px;border-bottom-width:0px;" alt="Image(36)" src="http://s3.51cto.com/wyfs02/M01/76/AF/wKiom1ZZOULzfg6zAAA86fE7TpI124.png" border="0" />
3、创建LV
650) this.width=650;" width="623" height="369" title="Image(37)" style="border-top-width:0px;border-right-width:0px;border-bottom-width:0px;" alt="Image(37)" src="http://s3.51cto.com/wyfs02/M01/76/AE/wKioL1ZZOaTR5sdUAAAxSjqtxgQ249.png" border="0" />
4、使用parted -l,查看分区
650) this.width=650;" width="575" height="388" title="Image(38)" style="border-top-width:0px;border-right-width:0px;border-bottom-width:0px;" alt="Image(38)" src="http://s3.51cto.com/wyfs02/M00/76/AE/wKioL1ZZOaTiC5PFAAA0DxCMc_0255.png" border="0" />
5、使用parted创建分区
650) this.width=650;" width="617" height="444" title="Image(39)" style="border-top-width:0px;border-right-width:0px;border-bottom-width:0px;" alt="Image(39)" src="http://s3.51cto.com/wyfs02/M00/76/AF/wKiom1ZZOUTzyPtkAAA9flK3q2Q264.png" border="0" />
5、格式化分区成ext4格式,创建分区标签,挂载分区
650) this.width=650;" width="701" height="481" title="Image(40)" style="border-top-width:0px;border-right-width:0px;border-bottom-width:0px;" alt="Image(40)" src="http://s3.51cto.com/wyfs02/M00/76/AE/wKioL1ZZOabS9mKTAABV820PNRQ009.png" border="0" />
6、设置分区挂载永久生效
650) this.width=650;" width="674" height="300" title="Image(41)" style="border-top-width:0px;border-right-width:0px;border-bottom-width:0px;" alt="Image(41)" src="http://s3.51cto.com/wyfs02/M01/76/AE/wKioL1ZZOaexf-qnAAAwV4MacW0804.png" border="0" />
注:对于已经使用中的硬盘和分区,重建分区和格式化会清除数据