《Linux磁盘阵列》.doc
文本预览下载声明
这篇文章就简单介绍如何用软件实现raid技术(以raid0为例)。有两个可以实现软raid的工具:raidtools, mdadm。本文也以mdadm为例讲述。一、查看当前硬盘情况[root@primary /]# fdisk -lDisk /dev/sda: 10.7 GB, 10737418240 bytes255 heads, 63 sectors/track, 1305 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System/dev/sda1 * 1 13 104391 83 Linux/dev/sda2 14 1114 8843782+ 83 Linux/dev/sda3 1115 1305 1534207+ 82 Linux swapDisk /dev/sdb: 107 MB, 107374080 bytes64 heads, 32 sectors/track, 102 cylindersUnits = cylinders of 2048 * 512 = 1048576 bytesDisk /dev/sdb doesnt contain a valid partition tableDisk /dev/sdc: 107 MB, 107374080 bytes64 heads, 32 sectors/track, 102 cylindersUnits = cylinders of 2048 * 512 = 1048576 bytesDisk /dev/sdc doesnt contain a valid partition table二、为硬盘分区raid一般多个硬盘来组成,你也可以用同一个硬盘的多个分区组成raid,但这样是没有意义的。[root@primary /]# fdisk /dev/sdbDevice contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel. Changes will remain in memory only,until you decide to write them. After that, of course, the previouscontent wont be recoverable.Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)Command (m for help): nCommand actione extendedp primary partition (1-4)pPartition number (1-4): 1First cylinder (1-102, default 1): Using default value 1Last cylinder or +size or +sizeM or +sizeK (1-102, default 102): Using default value 102Command (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.[root@primary /]# fdisk /dev/sdcDevice contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel. Changes will remain in memory only,until you decide to write them. After that, of course, the previouscontent wont be recoverable.Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)Command (m for help): nCommand actione extendedp primary partition (1-4)pPartiti
显示全部