RAID10

添加凉快20G的硬盘然后分区:
/dev/sdb:
Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        2610    20964793+   5  Extended
/dev/sdb5               1        1217     9775489+  83  Linux
/dev/sdb6            1218        2434     9775521   83  Linux
 
/dev/sdc:
Disk /dev/sdc: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        2610    20964793+   5  Extended
/dev/sdc5               1        1217     9775489+  83  Linux
/dev/sdc6            1218        2434     9775521   83  Linux
 
创建RAID1
mdadm --create --auto=yes /dev/md2 --level=1 --raid-devices=2 /dev/sdc5 /dev/sdc6
把两组RAID1组成RAID0:
mdadm --create --auto=yes /dev/md0 --level=0 --raid-devices=2 /dev/md1 /dev/md2
查看RAID10:
mdadm --detail /dev/md0
/dev/md0:
        Version : 0.90
  Creation Time : Sun May 19 16:17:33 2013
     Raid Level : raid0
     Array Size : 19550720 (18.65 GiB 20.02 GB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 0
    Persistence : Superblock is persistent
 
    Update Time : Sun May 19 16:17:33 2013
          State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
  Spare Devices : 0
 
     Chunk Size : 64K
 
           UUID : 59bcfc86:e42a1226:185e0395:04c37a09
         Events : 0.1
 
    Number   Major   Minor   RaidDevice State
       0       9        1        0      active sync   /dev/md1
       1       9        2        1      active sync   /dev/md2
 
cat /proc/mdstat
Personalities : [raid1] [raid0]
md2 : active raid1 sdc6[1] sdc5[0]
      9775424 blocks [2/2] [UU]
 
md1 : active raid1 sdb6[1] sdb5[0]
      9775424 blocks [2/2] [UU]
 
md0 : active raid0 md2[1] md1[0]
      19550720 blocks 64k chunks
 
unused devices: <none>
 
格式化挂载:
mkfs -t ext3 /dev/md0
partprobe
mkdir /dd
mount /dev/md0 /dd
这样磁盘既有了RAID0的性能,又有了RAID1的容错了!
 

你可能感兴趣的:(RAID10)