mdadm双盘阵
来源:互联网 发布:java判断素数 编辑:程序博客网 时间:2024/05/20 07:50
查看系统版本号
[root@localhost ~]# uname -a
Linuxlocalhost.localdomain 3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014x86_64 x86_64 x86_64 GNU/Linux
磁盘分区:
给/dev/sdb分区:
root@localhost ~]# fdisk /dev/sdb
Command (m for help): n
Partition type:
p primary (0 primary, 0extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-62914559, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G}(2048-62914559, default 62914559): +50M
Partition 1 of type Linux and of size 50 MiBis set
Command (m for help): n
Partition type:
p primary (1 primary, 0extended, 3 free)
e extended
Select (default p): p
Partition number (2-4, default 2): 2
First sector (104448-62914559, default104448):
Using default value 104448
Last sector, +sectors or +size{K,M,G}(104448-62914559, default 62914559): +50M
Partition 2 of type Linux and of size 50 MiBis set
Command (m for help): w
查看sdb的分区情况:
[root@localhost ~]#fdisk -l /dev/sdb
Disk /dev/sdb: 32.2 GB, 32212254720 bytes,62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes /512 bytes
I/O size (minimum/optimal): 512 bytes / 512bytes
Disk label type: dos
Disk identifier: 0xd109dbc5
Device Boot Start End Blocks Id System
/dev/sdb1 2048 104447 51200 83 Linux
/dev/sdb2 104448 206847 51200 83 Linux
给sdc分区
[root@localhost ~]#fdisk /dev/sdc
Command (m for help): n
Partition type:
p primary (0 primary, 0extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-62914559, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G}(2048-62914559, default 62914559): +20M
Partition 1 of type Linux and of size 20 MiBis set
Command (m for help): n
Partition type:
p primary (1 primary, 0extended, 3 free)
e extended
Select (default p): p
Partition number (2-4, default 2): 2
First sector (43008-62914559, default 43008):
Using default value 43008
Last sector, +sectors or +size{K,M,G}(43008-62914559, default 62914559): +30M
Partition 2 of type Linux and of size 30 MiBis set
Command (m for help): w
查看sdc的分区情况
[root@localhost ~]#fdisk -l /dev/sdc
Disk /dev/sdc: 32.2 GB, 32212254720 bytes,62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes /512 bytes
I/O size (minimum/optimal): 512 bytes / 512bytes
Disk label type: dos
Disk identifier: 0x1c50da75
Device Boot Start End Blocks Id System
/dev/sdc1 2048 43007 20480 83 Linux
/dev/sdc2 43008 104447 30720 83 Linux
在Centos7上已经安装有mdadm,mdadm-3.2.6-31.el7.x86_64已经安装,无需安装。
创建RID0
[root@localhost ~]# mdadm --create --verbose/dev/md0 --level=mirror --raid-devices=2 /dev/sdb /dev/sdc
mdadm:Note: this array has metadata at the start and
may not be suitable as a boot device. If you plan to
store '/boot' on this device please ensurethat
your boot-loader understands md/v1.xmetadata, or use
--metadata=0.90
mdadm:size set to 20955008K
Continuecreating array? y
mdadm:Defaulting to version 1.2 metadata
mdadm:array /dev/md0 started.
查看RID0创建情况
[root@localhost~]# cat /proc/mdstat
Personalities: [raid1]
md0 :active raid1 sdc[1] sdb[0]
20955008 blocks super 1.2 [2/2] [UU]
[===========>.........] resync = 58.2% (12206464/20955008)finish=0.7min speed=200000K/sec
格式化光盘
root@localhost ~]# mkfs.ext4 /dev/md0
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=512 blocks, Stripe width=1024 blocks
17712 inodes, 70656 blocks
3532 blocks (5.00%) reserved for the superuser
First data block=1
Maximum filesystem blocks=33685504
9 block groups
8192 blocks per group, 8192 fragments pergroup
1968 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345
Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accountinginformation: done
创建挂载点,挂载硬盘
[root@localhost~]# mkdir /DATA
[root@localhost~]# mount /dev/md0 /DATA
保存raid配置
[root@localhost~]# mdadm --detail --scan >> /etc/mdadm.conf
[root@localhost~]# vi /etc/mdadm.conf
ARRAY/dev/md0 metadata=1.2 name=localhost.localdomain:0UUID=6db58f0f:2bb6a45c:104d1157:55200fbc
~
模拟磁盘坏掉:
仍然可以读写数据
[root@localhost~]# cd /DATA
[root@localhostDATA]# ls
lost+found
查看日志
Aug 1500:18:33 localhost kernel: Write(10): 2a 00 00 01 a1 20 00 00 08 00
Aug 1500:18:33 localhost kernel: end_request: I/O error, dev sdb, sector 106784
Aug 1500:18:33 localhost kernel: md/raid1:md0: Disk failure on sdb, disabling device.
md/raid1:md0:Operation continuing on 1 devices.
Aug 1500:18:33 localhost kernel: md/raid1:md0: redirecting sector 74016 to othermirror: sdc
- mdadm双盘阵
- mdadm
- mdadm
- mdadm
- mdadm
- mdadm详解
- mdadm简介
- mdadm详解
- mdadm简介
- mdadm: /etc/mdadm/mdadm.conf defines no arrays.
- RAID管理程序mdadm解析
- mdadm: failed to RUN_ARRAY
- mdadm中文man帮助
- 用mdadm管理软件RAID
- mdadm 软RAID管理工具
- mdadm创建raid
- MDADM实现软RAID
- mdadm管理软件RAID阵列
- 介绍自己玩电脑经常用的几个个按钮很方便哟:————【Badboy】
- 使用Flex itemEditors – Part 1: Inline itemEditors(翻译)
- Linux下crontab命令的用法
- Yii时间控件的使用(包括小时、分钟、秒的插件)
- 素数环
- mdadm双盘阵
- OpenGL教程Nehe版(中文版+VC++源码)来源:Linux社区 作者:Linux
- Centos7操作系统部署指南
- text-indent:-9999px 字体隐藏问题
- php array_slice 截取数组
- css命名规范
- git的一些错误提示
- Gray Code
- gcc动态链接库基本知识