mysql raid10_创建软RAID10

环境:

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--

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值