|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
欢迎大家来到仓酷云论坛!今天重装一台老办事器的时分发明IntelhardwareRAID把持卡有成绩,不克不及辨认一切硬盘,可是装置操纵体系过程当中能够辨认一切硬盘,另有一个成绩就是操纵体系装置一般,可是装置完后没法启动,某种缘故原由招致BIOS不克不及从硬盘启动体系。以是盘算把操纵体系装置到一个USB盘上,然后从USB盘启动体系,并给下面的6块硬盘做成SoftwareRAID10后挂载到体系里用。
做SoftwareRAID不请求硬盘都千篇一律,可是激烈保举用统一厂商、型号和巨细的硬盘。为啥RAID10,不选RAID0,RAID1,RAID5呢?答:RAID0太伤害,RAID1功能稍逊一些,RAID5频仍写情形下功能差,RAID10仿佛是现今磁盘阵列的最好选择,出格合适做KVM/Xen/VMware假造机母机(host)的当地存储体系(假如不思索SAN和散布式存储的话)。
这台办事器上有6块完整不异的硬盘,给每块硬盘分红一个区,分区格局为Linuxsoftwareraid:- #fdisk/dev/sdaWARNING:DOS-compatiblemodeisdeprecated.Itsstronglyrecommendedtoswitchoffthemode(commandc)andchangedisplayunitstosectors(commandu).Command(mforhelp):nCommandactioneextendedpprimarypartition(1-4)pPartitionnumber(1-4):1Firstcylinder(1-91201,default1):Usingdefaultvalue1Lastcylinder,+cylindersor+size{K,M,G}(1-91201,default91201):Usingdefaultvalue91201Command(mforhelp):pDisk/dev/sda:750.2GB,750156374016bytes255heads,63sectors/track,91201cylindersUnits=cylindersof16065*512=8225280bytesSectorsize(logical/physical):512bytes/512bytesI/Osize(minimum/optimal):512bytes/512bytesDiskidentifier:0x0005c259DeviceBootStartEndBlocksIdSystem/dev/sda119120173257200183LinuxCommand(mforhelp):tSelectedpartition1Hexcode(typeLtolistcodes):fdChangedsystemtypeofpartition1tofd(Linuxraidautodetect)Command(mforhelp):wThepartitiontablehasbeenaltered!Callingioctl()tore-readpartitiontable.Syncingdisks.
复制代码 依照下面的/dev/sda的分区例子顺次给剩下的5块硬盘sdc,sdd,sde,sdf,sdg分区、变动分区格局:- #fdisk/dev/sdc...#fdisk/dev/sdd...#fdisk/dev/sde...#fdisk/dev/sdf...#fdisk/dev/sdg...
复制代码 分区完成后就能够入手下手创立RAID了,在下面的6个不异巨细的分区上创立raid10:- #mdadm--create/dev/md0-v--raid-devices=6--level=raid10/dev/sda1/dev/sdc1/dev/sdd1/dev/sde1/dev/sdf1/dev/sdg1mdadm:layoutdefaultston2mdadm:layoutdefaultston2mdadm:chunksizedefaultsto512Kmdadm:sizesetto732440576Kmdadm:Defaultingtoversion1.2metadatamdadm:array/dev/md0started.
复制代码 检察磁盘阵列的初始化历程(build),依据磁盘巨细和速率,全部历程也许必要几个小时:- #watchcat/proc/mdstatEvery2.0s:cat/proc/mdstatTueFeb1112:51:252014Personalities:[raid10]md0:activeraid10sdg1[5]sdf1[4]sde1[3]sdd1[2]sdc1[1]sda1[0]2197321728blockssuper1.2512Kchunks2near-copies[6/6][UUUUUU][>....................]resync=0.2%(5826816/2197321728)finish=278.9minspeed=130948K/secunuseddevices:
复制代码 等阵列完成初始化后,就能够给md0装备创立分区和文件体系了,有了文件体系就能够挂载到体系里:- #fdisk/dev/md0#mkfs.ext4/dev/md0p1#mkdir/raid10#mount/dev/md0p1/raid10
复制代码 修正/etc/fstab文件让每次体系启动时主动挂载:- #vi/etc/fstab.../dev/md0p1/raid10ext4noatime,rw00
复制代码 在下面的/etc/fstab文件里利用/dev/md0p1装备名不是一个好举措,由于udev的原因,这个装备名常在重启体系后变更,以是最好用UUID,利用blkid下令找到响应分区的UUID:- #blkid.../dev/md0p1:UUID="093e0605-1fa2-4279-99b2-746c70b78f1b"TYPE="ext4"
复制代码 然后修正响应的fstab,利用UUID挂载:- #vi/etc/fstab...#/dev/md0p1/raid10ext4noatime,rw00UUID=093e0605-1fa2-4279-99b2-746c70b78f1b/raid10ext4noatime,rw00
复制代码 检察RAID的情形:- #mdadm--query--detail/dev/md0/dev/md0:Version:1.2CreationTime:TueFeb1112:50:382014RaidLevel:raid10ArraySize:2197321728(2095.53GiB2250.06GB)UsedDevSize:732440576(698.51GiB750.02GB)RaidDevices:6TotalDevices:6Persistence:SuperblockispersistentUpdateTime:TueFeb1118:48:102014State:cleanActiveDevices:6WorkingDevices:6FailedDevices:0SpareDevices:0Layout:near=2ChunkSize:512KName:local:0(localtohostlocal)UUID:e3044b6c:5ab972ea:8e742b70:3f766a11Events:70NumberMajorMinorRaidDeviceState0810activesync/dev/sda118331activesync/dev/sdc128492activesync/dev/sdd138653activesync/dev/sde148814activesync/dev/sdf158975activesync/dev/sdg1
复制代码 如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的好朋友们! |
|