设为首页 加入收藏

TOP

针对mdadm的RAID1失效测试(一)
2019-09-02 23:24:29 】 浏览:69
Tags:针对 mdadm RAID1 失效 测试

背景

对软RAID(mdadm)方式进行各个场景失效测试。

一、初始信息

内核版本:

root@omv30:~# uname -a
Linux omv30 4.18.0-0.bpo.1-amd64 #1 SMP Debian 4.18.6-1~bpo9+1 (2018-09-13) x86_64 GNU/Linux
root@omv30:~# mdadm --version
mdadm - v3.4 - 28th January 2016

使用omv创建RAID1之后,查询sdb的信息,此时sdb对应的是8ac693c5的UUID,device号为1:

root@omv30:~# mdadm --query /dev/sdb
/dev/sdb: is not an md array
/dev/sdb: device 1 in 2 device undetected raid1 /dev/md0.  Use mdadm --examine for more detail.
root@omv30:~# mdadm --examine /dev/sdb
/dev/sdb:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 921a8946:b273e00e:3fa4b99d:040a4437
           Name : omv30:raid1  (local to host omv30)
  Creation Time : Sun Sep 30 22:31:39 2018
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 2095104 (1023.00 MiB 1072.69 MB)
     Array Size : 1047552 (1023.00 MiB 1072.69 MB)
    Data Offset : 2048 sectors
   Super Offset : 8 sectors
   Unused Space : before=1960 sectors, after=0 sectors
          State : clean
    Device UUID : 64a58fb5:c7e76b1a:29453878:8ac693c5

    Update Time : Mon Oct  1 13:20:56 2018
  Bad Block Log : 512 entries available at offset 72 sectors
       Checksum : 2e1fb65b - correct
         Events : 21


   Device Role : Active device 1
   Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
root@omv30:~# mdadm -D /dev/md0 
/dev/md0:
        Version : 1.2
  Creation Time : Sun Sep 30 22:31:39 2018
     Raid Level : raid1
     Array Size : 1047552 (1023.00 MiB 1072.69 MB)
  Used Dev Size : 1047552 (1023.00 MiB 1072.69 MB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Mon Oct  1 19:46:42 2018
          State : clean 
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : omv30:raid1  (local to host omv30)
           UUID : 921a8946:b273e00e:3fa4b99d:040a4437
         Events : 25

    Number   Major   Minor   RaidDevice State
       0       8       32        0      active sync   /dev/sdc
       1       8       16        1      active sync   /dev/sdb

配置文件信息:

root@omv30:~# cat /etc/mdadm/mdadm.conf 
# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#

# by default, scan all partitions (/proc/partitions) for MD superblocks.
# alternatively, specify devices to scan, using wildcards if desired.
# Note, if no DEVICE line is present, then "DEVICE partitions" is assumed.
# To avoid the auto-assembly of RAID devices a pattern that CAN'T match is
# used if no RAID devices are configured.
DEVICE partitions

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# definitions of existing MD arrays
ARRAY /dev/md0 metadata=1.2 name=omv30:raid1 UUID=921a8946:b273e00e:3fa4b99d:040a4437

二、盘符错乱测试

1、盘符交换测试

在VirtualBox的存储-SATA下,分别选中两块硬盘,在右边的属性将SATA端口调换位置,即可交换盘符。

root@omv30:~# mdadm -D /dev/md0 
/dev/md0:
        Version : 1.2
  Creation Time : Sun Sep 30 22:31:39 2018
     Raid Level : raid1
     Array Size : 1047552 (1023.00 MiB 1072.69 MB)
  Used Dev Size : 1047552 (1023.00 MiB 1072.69 MB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Mon Oct  1 19:52:46 2018
          State : clean 
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : omv30:raid1  (local to host omv30)
           UUID : 921a8946:b273e00e:3fa4b99d:040a4437
         Events : 29

    Number   Major   Minor   RaidDevice State
       0       8       16        0      active sync   /dev/sdb
       1       8       32        1      active sync   /dev/sdc

可以看到盘符已经换了。

root@omv30:~# mdadm --examine /dev/sdb
/dev/sdb:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Arr
首页 上一页 1 2 3 4 5 6 下一页 尾页 1/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇第十三周学习笔记 下一篇透明代理、正向代理、反向代理的..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目