文档详情

《Linux磁盘阵列》.doc

发布:2016-02-27约8.68千字共6页下载文档
文本预览下载声明
这篇文章就简单介绍如何用软件实现raid技术(以raid0为例)。 有两个可以实现软raid的工具:raidtools, mdadm。 本文也以mdadm为例讲述。 一、查看当前硬盘情况 [root@primary /]# fdisk -l Disk /dev/sda: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device 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 swap Disk /dev/sdb: 107 MB, 107374080 bytes 64 heads, 32 sectors/track, 102 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Disk /dev/sdb doesnt contain a valid partition table Disk /dev/sdc: 107 MB, 107374080 bytes 64 heads, 32 sectors/track, 102 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Disk /dev/sdc doesnt contain a valid partition table 二、为硬盘分区 raid一般多个硬盘来组成,你也可以用同一个硬盘的多个分区组成raid,但这样是没有意义的。 [root@primary /]# fdisk /dev/sdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content wont be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-102, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-102, default 102): Using default value 102 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [root@primary /]# fdisk /dev/sdc Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content wont be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Command (m for help): n Command action e extended p primary partition (1-4) p Partiti
显示全部
相似文档