Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6543536
  • 博文数量: 1005
  • 博客积分: 8199
  • 博客等级: 中将
  • 技术积分: 13071
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-25 20:19
个人简介

脚踏实地、勇往直前!

文章分类

全部博文(1005)

文章存档

2020年(2)

2019年(93)

2018年(208)

2017年(81)

2016年(49)

2015年(50)

2014年(170)

2013年(52)

2012年(177)

2011年(93)

2010年(30)

分类: 服务器与存储

2012-04-18 15:01:42

环境:
OS:Red Hat Linux As5
raid10就是raid0+raid1的组合,下面是创建raid10的步骤.
 
1.准备4块硬盘,并使用fd格式化(具体操作省略)
fdisk /dev/sdg(操作选择:n-->p--1--默认回车--默认回车--t--l--fd--w)
fdisk /dev/sdh(操作选择:n-->p--1--默认回车--默认回车--t--l--fd--w)
fdisk /dev/sdi(操作选择:n-->p--1--默认回车--默认回车--t--l--fd--w)
fdisk /dev/sdj(操作选择:n-->p--1--默认回车--默认回车--t--l--fd--w)
每个硬盘分别划分为一个分区,即得到如下磁盘分区:
/dev/sdg1
/dev/sdh1
/dev/sdi1
/dev/sdj1
 
2.创建两个raid0
[root@hxl oracle]# mdadm -C /dev/md0 -l0 -n2 /dev/sd[gh]1
mdadm: array /dev/md0 started.
[root@hxl oracle]# mdadm -C /dev/md1 -l0 -n2 /dev/sd[ij]1
mdadm: array /dev/md1 started.

 
3.使用步骤2创建的两个raid0创建raid1
[root@hxl oracle]# mdadm -C /dev/md2 -l1 -n2 /dev/md0 /dev/md1
mdadm: array /dev/md2 started.

 
4.查看创建好的阵列
[root@hxl oracle]# mdadm -D /dev/md2
/dev/md2:
        Version : 00.90.01
  Creation Time : Sun Apr 15 15:46:09 2012
     Raid Level : raid1
     Array Size : 2088128 (2039.19 MiB 2138.24 MB)
    Device Size : 2088128 (2039.19 MiB 2138.24 MB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 2
    Persistence : Superblock is persistent
    Update Time : Sun Apr 15 15:46:23 2012
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

    Number   Major   Minor   RaidDevice State
       0       9        0        0      active sync   /dev/md0
       1       9        1        1      active sync   /dev/md1
           UUID : c17fc60c:0bc46396:77223f62:c9774c62
         Events : 0.2

 
这样就完成了raid10的创建.
 
5.格式化raid
对raid格式化,不管其中套了多少层,只要格式化最顶层的设备,在这里只需要格式化/dev/md2.
[root@hxl oracle]# mkfs.ext3 /dev/md2
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
261120 inodes, 522032 blocks
26101 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=536870912
16 block groups
32768 blocks per group, 32768 fragments per group
16320 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
说明:
raid0: n块磁盘做raid0最后的磁盘容量大小是n个磁盘的总容量.(这里的n没有规定,一块硬盘也可以做raid0).
raid1: n块磁盘做raid1最后的磁盘容量大小是n/2个磁盘的总容量.(这里的n>=2).
raid5: n块磁盘做raid5最后的磁盘容量大小是n-1个磁盘的总容量.(这里的n>=3).
 
--The End--
阅读(6031) | 评论(0) | 转发(0) |
0

上一篇:使用RAID5做逻辑卷

下一篇:什么是/dev/shm

给主人留下些什么吧!~~