您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 销售管理 > RHEL5上制作Soft RAID
RHEL5上制作SoftRAID,并在SoftRAID基础上做LVM来源:ChinaUnix博客日期:2008.08.0111:18(共有0条评论)我要评论很久都没有操作都忘的差不多了,重新练练,加深点印象。这些操作都是在VMWare虚拟机上进行的。首先把RHEL5安装在/dev/sda上。安装完后从添加了四块硬盘,分别是/dev/sdb、/dev/sdc、/dev/sdd、/dev/sde以root进入系统,首先看一下磁盘的情况:[root@TSM54-Test~]#fdisk-lDisk/dev/sda:15.0GB,15032385536bytes255heads,63sectors/track,1827cylindersUnits=cylindersof16065*512=8225280bytesDeviceBootStartEndBlocksIdSystem/dev/sda1*11310439183Linux/dev/sda2141827145709558eLinuxLVMDisk/dev/sdb:8589MB,8589934592bytes255heads,63sectors/track,1044cylindersUnits=cylindersof16065*512=8225280bytesDeviceBootStartEndBlocksIdSystemDisk/dev/sdc:8589MB,8589934592bytes255heads,63sectors/track,1044cylindersUnits=cylindersof16065*512=8225280bytesDeviceBootStartEndBlocksIdSystemDisk/dev/sdd:8589MB,8589934592bytes255heads,63sectors/track,1044cylindersUnits=cylindersof16065*512=8225280bytesDeviceBootStartEndBlocksIdSystemDisk/dev/sde:8589MB,8589934592bytes255heads,63sectors/track,1044cylindersUnits=cylindersof16065*512=8225280bytesDeviceBootStartEndBlocksIdSystem一.创建SoftRAID1.创建raid分区[root@TSM54-Test~]#fdisk/dev/sdbThenumberofcylindersforthisdiskissetto1044.Thereisnothingwrongwiththat,butthisislargerthan1024,andcouldincertainsetupscauseproblemswith:1)softwarethatrunsatboottime(e.g.,oldversionsofLILO)2)bootingandpartitioningsoftwarefromotherOSs(e.g.,DOSFDISK,OS/2FDISK)Command(mforhelp):nCommandactioneextendedpprimarypartition(1-4)pPartitionnumber(1-4):1Firstcylinder(1-1044,default1):Usingdefaultvalue1Lastcylinderor+sizeor+sizeMor+sizeK(1-1044,default1044):Usingdefaultvalue1044Command(mforhelp):tSelectedpartition1Hexcode(typeLtolistcodes):L0Empty1eHiddenW95FAT180OldMinixbeSolarisboot1FAT1224NECDOS81Minix/oldLinbfSolaris2XENIXroot39Plan982Linuxswap/Soc1DRDOS/sec(FAT-3XENIXusr3cPartitionMagic83Linuxc4DRDOS/sec(FAT-4FAT16Hexcode(typeLtolistcodes):fdChangedsystemtypeofpartition1tofd(Linuxraidautodetect)Command(mforhelp):pDisk/dev/sdb:8589MB,8589934592bytes255heads,63sectors/track,1044cylindersUnits=cylindersof16065*512=8225280bytesDeviceBootStartEndBlocksIdSystem/dev/sdb1110448385898+fdLinuxraidautodetectCommand(mforhelp):wThepartitiontablehasbeenaltered!Callingioctl()tore-readpartitiontable.Syncingdisks.按照上面的方法分别把/dev/sdc,/dev/sdd/也创建raid分区。完成后,用fdisk-l查看[root@TSM54-Test~]#fdisk-lDisk/dev/sda:15.0GB,15032385536bytes255heads,63sectors/track,1827cylindersUnits=cylindersof16065*512=8225280bytesDeviceBootStartEndBlocksIdSystem/dev/sda1*11310439183Linux/dev/sda2141827145709558eLinuxLVMDisk/dev/sdb:8589MB,8589934592bytes255heads,63sectors/track,1044cylindersUnits=cylindersof16065*512=8225280bytesDeviceBootStartEndBlocksIdSystem/dev/sdb1110448385898+fdLinuxraidautodetectDisk/dev/sdc:8589MB,8589934592bytes255heads,63sectors/track,1044cylindersUnits=cylindersof16065*512=8225280bytesDeviceBootStartEndBlocksIdSystem/dev/sdc1110448385898+fdLinuxraidautodetectDisk/dev/sdd:8589MB,8589934592bytes255heads,63sectors/track,1044cylindersUnits=cylindersof16065*512=8225280bytesDeviceBootStartEndBlocksIdSystem/dev/sdd1110448385898+fdLinuxraidautodetectDisk/dev/sde:8589MB,8589934592bytes255heads,63sectors/track,1044cylindersUnits=cylindersof16065*512=8225280bytesDeviceBootStartEndBlocksIdSystem2.创建阵列mdadm可以支持LINEAR、RAID0(striping)、RAID1(mirroring)、RAID4、RAID5、RAID6和MULTIPATH的阵列模式。命令格式:mdadm--createdevice-chunk=X--level=Y--raid-devices=Zdevices[root@TSM54-Test~]#mdadm--create/dev/md0--level=5--raid-devices=3/dev/sdb/dev/sdc/dev/sddmdadm:array/dev/md0started.--level表示创建的阵列模式,--raid-devices表示参与阵列的磁盘数量3.配置文件[root@TSM54-Test~]#cp/usr/share/doc/mdadm-2.5.4/mdadm.conf-example/etc/mdadm.conf[root@TSM54-Test~]#echoDEVICE/dev/sd[bcd]1/etc/mdadm.conf[root@TSM54-Test~]#mdadm-Ds/etc/mdadm.conf4.格式化Raid接下来,只要把/dev/md0作为一个单独的磁盘设备进行操作就可以:[root@TSM54-Test~]#mkfs.ext3/dev/md0mke2fs1.39(29-May-2006)Filesystemlabel=OStype:LinuxBlocksize=4096(log=2)Fragmentsize=4096(log=2)2097152inodes,4194272blocks209713blocks(5.00%)reservedforthesuperuserFirstdatablock=0Maximumfilesystemblocks=0128blockgroups32768blockspergroup,32768fragmentspergroup16384inodespergroupSuperblockbackupsstoredonblocks:32768,98304,163840,229376,294912,819200,884736,1605632,2654208,4096000Writinginodetables:doneCreatingjournal(32768blocks):doneWritingsuperblocksandfilesystemaccountinginformation:doneThisfilesystemwillbeautomaticallycheckedevery36mountsor180days,whichevercomesfirst.Usetune2fs-cor-itooverride.[root@TSM54-Test~]#mkdir/mnt/software[root@TSM54-Test~]#mount/dev/md0/mnt/software5.开机自动挂载更改/etc/fstab文件,添加一行/dev/md0/mnt/softwareext3defaults00二.其他的操作mdadm有7中模式,下面列出了7种模式的命令格式,详细的选项,请参考man手册。ASSEMBLEMODE:madam--assemblemd-deviceoptions-and-component-devicesmdadm--assembel--scanmd-devices-and-optionsmdamd--assembel--scanoptionsBUILDMODE:mdadm--builddevice--chunk=X--level=Y--raid-devices=ZdevicesCREATEMODE:mdadm--createdevice--chunk=X--level=Y--raid-devices=ZdevicesMANAGEMODE:mdadmdeviceoptionsdevicesMISCMODE:mdadmoptions...devices...MONITORMODE:mdadm--monitoroptions...devices...GROWMODE:1.查看MISC模式#mdadm--detail/dev/md0#mdadm-D/dev/md02.停
本文标题:RHEL5上制作Soft RAID
链接地址:https://www.777doc.com/doc-4005016 .html