仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 785|回复: 8
打印 上一主题 下一主题

[CentOS(社区)] 带来一篇CentOS7.0下初级硬盘办理RAID 1+0计划

[复制链接]
兰色精灵 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-14 20:29:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们!企业常常用到的RAID+LVM办理形式的创建:
用到的软件:VMwareWorkstation10
体系情况:
[root@localhost~]#cat/etc/centos-release
CentOSLinuxrelease7.0.1406(Core)
[root@localhost~]#rpm-qimdadm
Name:mdadm
Version:3.2.6
RAID1+0计划

简介

先对磁盘做mirror,然后对全部mirror组做条带化;好比8块盘必要分红4个基组,每一个基组2块盘;每一个基组先做raid1,再做raid0,4条条带化。
以是:
同意一切磁盘基组中的磁盘各破坏一个,可是不同意统一基组中的磁盘同时有坏的。
长处:数据宁静性好,只需不是1个条带上的2个硬盘同时坏,没有成绩,还能够持续跑数据。数据规复快。
弱点:写功能略微比RAID0+1差(读功能一样)

我的思绪
在新增加的硬盘上分别4个1G的地区分离为1,2,3,5
每两个转化为一个RAID1卷/dev/md{1,2}
将这两个RAID1卷转化为一个RAID0卷/dev/md0
将RAID0转化为pv,vg
以后经由过程lv创立本人的空间
这个空间就具有RAID1+0的性子


具体实行历程




我们这里增加一块用作实行的硬盘2
我们不想重启来读取新增加的硬盘,我们输出上面下令举行扫描
[root@localhost~]#echo"---">/sys/class/scsi_host/host0/scan
[root@localhost~]#echo"---">/sys/class/scsi_host/host1/scan
[root@localhost~]#echo"---">/sys/class/scsi_host/host2/scan
[root@localhost~]#fdisk-l
Disk/dev/sdb:21.5GB,21474836480bytes,41943040sectors
Units=sectorsof1*512=512bytes
Sectorsize(logical/physical):512bytes/512bytes
I/Osize(minimum/optimal):512bytes/512bytes
发明新增加的sdb

上面入手下手详细的实行历程
#fdisk/dev/sdb
Command(mforhelp):n
Partitiontype:
pprimary(0primary,0extended,4free)
eextended
Select(defaultp):
Usingdefaultresponsep
Partitionnumber(1-4,default1):
Firstsector(2048-41943039,default2048):
Usingdefaultvalue2048
Lastsector,+sectorsor+size{K,M,G}(2048-41943039,default41943039):+1G
Partition1oftypeLinuxandofsize1GiBisset
Command(mforhelp):n
Partitiontype:
pprimary(1primary,0extended,3free)
eextended
Select(defaultp):
Usingdefaultresponsep
Partitionnumber(2-4,default2):
Firstsector(2099200-41943039,default2099200):
Usingdefaultvalue2099200
Lastsector,+sectorsor+size{K,M,G}(2099200-41943039,default41943039):+1G
Partition2oftypeLinuxandofsize1GiBisset
Command(mforhelp):n
Partitiontype:
pprimary(2primary,0extended,2free)
eextended
Select(defaultp):
Usingdefaultresponsep
Partitionnumber(3,4,default3):
Firstsector(4196352-41943039,default4196352):
Usingdefaultvalue4196352
Lastsector,+sectorsor+size{K,M,G}(4196352-41943039,default41943039):+1G
Partition3oftypeLinuxandofsize1GiBisset
Command(mforhelp):n
Partitiontype:
pprimary(3primary,0extended,1free)
eextended
Select(defaulte):
Usingdefaultresponsee
Selectedpartition4
Firstsector(6293504-41943039,default6293504):
Usingdefaultvalue6293504
Lastsector,+sectorsor+size{K,M,G}(6293504-41943039,default41943039):
Usingdefaultvalue41943039
Partition4oftypeExtendedandofsize17GiBisset
将残剩的一切空间划给扩大区,以后再分别区间用l下令即逻辑盘区
今后的区间号就从5入手下手今后加
Command(mforhelp):n
Allprimarypartitionsareinuse
Addinglogicalpartition5
Firstsector(6295552-41943039,default6295552):
Usingdefaultvalue6295552
Lastsector,+sectorsor+size{K,M,G}(6295552-41943039,default41943039):+1G
Partition5oftypeLinuxandofsize1GiBisset
Command(mforhelp):p

Disk/dev/sdb:21.5GB,21474836480bytes,41943040sectors
Units=sectorsof1*512=512bytes
Sectorsize(logical/physical):512bytes/512bytes
I/Osize(minimum/optimal):512bytes/512bytes
Disklabeltype:dos
Diskidentifier:0x8e9a9326

DeviceBootStartEndBlocksIdSystem
/dev/sdb120482099199104857683Linux
/dev/sdb220992004196351104857683Linux
/dev/sdb341963526293503104857683Linux
/dev/sdb4629350441943039178247685Extended
/dev/sdb562955528392703104857683Linux
/dev/sdb6839475210491903104857683Linux
[root@localhost~]#mdadm-C/dev/md1-ayes-l1-n2/dev/sdb{1,2}
mdadm:Note:thisarrayhasmetadataatthestartand
maynotbesuitableasabootdevice.Ifyouplanto
store/bootonthisdevicepleaseensurethat
yourboot-loaderunderstandsmd/v1.xmetadata,oruse
--metadata=0.90
Continuecreatingarray?
Continuecreatingarray?(y/n)y
mdadm:Defaultingtoversion1.2metadata
mdadm:array/dev/md1started.
[root@localhost~]#mdadm-C/dev/md2-ayes-l1-n2/dev/sdb{3,5}
mdadm:Note:thisarrayhasmetadataatthestartand
maynotbesuitableasabootdevice.Ifyouplanto
store/bootonthisdevicepleaseensurethat
yourboot-loaderunderstandsmd/v1.xmetadata,oruse
--metadata=0.90
Continuecreatingarray?
Continuecreatingarray?(y/n)y
mdadm:Defaultingtoversion1.2metadata
mdadm:array/dev/md2started.
[root@localhost~]#mdadm-C/dev/md0-ayes-l1-n2/dev/md{1,2}(将RAID1转化为RAID0)
mdadm:Note:thisarrayhasmetadataatthestartand
maynotbesuitableasabootdevice.Ifyouplanto
store/bootonthisdevicepleaseensurethat
yourboot-loaderunderstandsmd/v1.xmetadata,oruse
--metadata=0.90
Continuecreatingarray?
Continuecreatingarray?(y/n)y
mdadm:Defaultingtoversion1.2metadata
mdadm:array/dev/md0started.
[root@localhost~]#pvcreate/dev/md0(变PV)
Physicalvolume"/dev/md0"successfullycreated
[root@localhost~]#vgcreatefirst/dev/md0(变VG)
Volumegroup"first"successfullycreated
[root@localhost~]#lvcreate-L1G-ndata1first
Volumegroup"first"hasinsufficientfreespace(255extents):256required.
[root@localhost~]#lvcreate-L+500M-ndata1first(分别本人想要的地区巨细)
Logicalvolume"data1"created

[root@localhost~]#mkfs.ext4/dev/first/data1(格局化)
mke2fs1.42.9(28-Dec-2013)
Filesystemlabel=
OStype:Linux
Blocksize=1024(log=0)
Fragmentsize=1024(log=0)
Stride=0blocks,Stripewidth=0blocks
128016inodes,512000blocks
25600blocks(5.00%)reservedforthesuperuser
Firstdatablock=1
Maximumfilesystemblocks=34078720
63blockgroups
8192blockspergroup,8192fragmentspergroup
2032inodespergroup
Superblockbackupsstoredonblocks:
8193,24577,40961,57345,73729,204801,221185,401409

Allocatinggrouptables:done
Writinginodetables:done
Creatingjournal(8192blocks):done
Writingsuperblocksandfilesystemaccountinginformation:done

[root@localhost~]#mkdir/lvm1
[root@localhost~]#mount/dev/first/data1/lvm1
[root@localhost~]#cd/lvm1
[root@localhostlvm1]#ll
total12
drwx------2rootroot12288Aug1221:21lost+found
挂载后便可对分别出的新空间举行利用。
举例

这里举个例子,20个硬盘

做RAID1+0,共10个条带,每一个条带2个硬盘做MIRROR,假如坏了1个硬盘,不妨,别的19个硬盘还要同时事情,只需不是坏在一个MIRROR内里的,就没事。
倡议,硬盘良多时,同时坏的概率就对照年夜,倡议利用宁静系数高的RAID1+0,宁肯丧失点功能(实在差未几)。
后语:
老手,若有毛病,接待斧正。
本文出自“张帆-IT的奇异漂泊”博客,请务必保存此出处http://chawan.blog.51cto.com/9179874/1540190
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的好朋友们!
因胸联盟 该用户已被删除
沙发
发表于 2015-1-16 18:47:26 | 只看该作者

带来一篇CentOS7.0下初级硬盘办理RAID 1+0计划

掌握在Linux系统中安装软件,在安装Linux工具盘后大致日常所需的软件都会有,一般网络提供下载的软件都会有安装说明。
飘灵儿 该用户已被删除
板凳
发表于 2015-1-19 09:06:34 | 只看该作者
在学习linux的工程中,linux学习方法有很多种,这里是小编的学习心得,给大家拿出来分享一下。
愤怒的大鸟 该用户已被删除
地板
发表于 2015-1-28 06:00:01 | 只看该作者
虽然大家都比较喜欢漂亮的mm,但是在学 linux 的过程中,还是要多和“男人”接触一下:P 遇到问题的时候,出来看说和上网查之外,就是要多用 linux 下的 man 命令找找帮助。
柔情似水 该用户已被删除
5#
发表于 2015-2-13 11:05:30 | 只看该作者
得到到草率的回答或者根本得不到任何Linux答案。越表现出在寻求帮助前为解决问题付出的努力,你越能得到实质性的帮助。
莫相离 该用户已被删除
6#
发表于 2015-3-3 20:43:01 | 只看该作者
我是学习嵌入式方向的,这学期就选修了这门专业任选课。
精灵巫婆 该用户已被删除
7#
发表于 2015-3-11 14:04:41 | 只看该作者
放手去搞。尽量不要提问,运用搜索找答案,或者看wiki,从原理上理解操作系统的本质,而不是满足于使用几个技巧。尽量看英文资料。
小魔女 该用户已被删除
8#
发表于 2015-3-19 01:00:43 | 只看该作者
Linux简单,占内存少,特别是对于程序开发人员来说很方便,如果说windows的成功在于其方便用户的窗口管理界面。
深爱那片海 该用户已被删除
9#
发表于 2015-3-27 00:11:04 | 只看该作者
我是学习嵌入式方向的,这学期就选修了这门专业任选课。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-5-14 21:18

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表