[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debian-users:44132] mdadm RAID1 再起動時にアレイが崩れてしまう



お世話になります。吉村と申します。

mdadm で作成したRAID1 が再起動時にアレイが壊れ、縮退モード
で起動してしまいます。

ハードディスク2本をプライマリIDEに接続し、

md: ide/host0/bus0/target1/lun0/part1
md: ide/host0/bus0/target0/lun0/part1
(hda1,hdb1)

作成したアレイだと raid1: raid set md0 active with 2 out of 2 mirrors
で通常起動するのですが、同じコンピュータで、プライマリIDEと、セカンダリ
IDE にドライブをつけてアレイを作成し、再起動すると、

md: ide/host0/bus0/target0/lun0/part1
md0: former device ide/host0/bus1/target1/lun0/part1 is unavailable, removing from array!
(hda1,hdd1)

となり、raid1: raid set md0 active with 1 out of 2 mirrors 縮退モードで
起動するようになります。何か設定に問題があるのでしょうか?


以下、私が試した手順です。

Linux version 2.4.27-2-386 
メモリ
384MB LOWMEM available.

CPU: Intel Pentium II (Deschutes) stepping 02
..... CPU clock speed is 448.0632 MHz.
..... host bus clock speed is 99.5692 MHz.

使用したハードディスク
QUANTUM FIREBALLP KA9.1, ATA DISK drive
Maxtor 90871U2, ATA DISK drive
IBM-DTTA-350840, ATA DISK drive



Debian Sarge を netインストールイメージにてインストールしました。
インストール中にRAID1 を構成しました。

/dev/hda1
/dev/hdb1

パーティションはルートパティションのみの構成としました。
GP6-450:/home# df
Filesystem           1K-ブロック    使用   使用可 使用% マウント位置
/dev/md0               7692776   1939988   5362016  27% /
tmpfs                   193376         0    193376   0% /dev/shm

障害が発生した事を想定し、hdaを外した。古いコンピュータなので、hdbだけつけていたのでは
BIOSでハードディスクを認識せず、hdaの位置に付け替えて起動させた。起動は、GRUBをFDに入れ
て手動メニューで起動させた。縮退モードで無事起動した。電源を落とし、hdd の位置にハードディスク
を増設。cfdisk でパーティショ ンを作成し、

mdadm /dev/md0 -a /dev/hdd1

とした。

GP6-450:/home# mdadm --detail /dev/md0

とすると、
   Number   Major   Minor   RaidDevice State
       0       0        0        0      faulty removed
       1       3        1        1      active sync   /dev/hda1
       2      22       65        2      spare rebuilding   /dev/hdd1

hdd1を使って rebuiled を始めた。rebuiled が完了し、

    Number   Major   Minor   RaidDevice State
       0      22       65        0      active sync   /dev/hdd1
       1       3        1        1      active sync   /dev/hda1

となっている事を確認した。

GP6-450:/etc/mdadm# cat /proc/mdstat 
Personalities : [raid1] 
read_ahead 1024 sectors
md0 : active raid1 ide/host0/bus1/target1/lun0/part1[0] ide/host0/bus0/target0/lun0/part1[1]
      7815488 blocks [2/2] [UU]

raid1 で動作している事を確認した。

mdadm.conf を再作成した
# mdadm --detail --scan >> /etc/mdadm/mdadm.conf
  $ cat /etc/mdadm/mdadm.conf
DEVICE partitions
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=1101312f:28873e2b:52e9437a:aeb827d1
   devices=/dev/hda1,/dev/hdd1


ここで再起動すると、起動時にこのようなログが出て、

hda: attached ide-disk driver.
hda: 18041184 sectors (9237 MB) w/371KiB Cache, CHS=17898/16/63, UDMA(33)
hdd: attached ide-disk driver.
hdd: 16992864 sectors (8700 MB) w/512KiB Cache, CHS=16858/16/63, UDMA(33)
Partition check:
 /dev/ide/host0/bus0/target0/lun0: [PTBL] [1123/255/63] p1 p2
 /dev/ide/host0/bus1/target1/lun0: [PTBL] [1057/255/63] p1 p2
 [events: 0000002b]
md: bind<ide/host0/bus0/target0/lun0/part1,1>
md: ide/host0/bus0/target0/lun0/part1's event counter: 0000002b
md0: former device ide/host0/bus1/target1/lun0/part1 is unavailable, removing from array!
md0: max total readahead window set to 124k
md0: 1 data-disks, max readahead per data-disk: 124k
raid1: device ide/host0/bus0/target0/lun0/part1 operational as mirror 1
raid1: md0, not all disks are operational -- trying to recover array
raid1: raid set md0 active with 1 out of 2 mirrors
md: updating md0 RAID superblock on device
md: ide/host0/bus0/target0/lun0/part1 [events: 0000002c]<6>(write)  ide/host0/bus0/target0/lun0/part1's sb
 offset: 7815488
md: recovery thread got woken up ...
md0: no spare disk to reconstruct array! -- continuing in degraded mode
md: recovery thread finished ...

アレイが崩れてしまう。アレイから、ハードディスクが取り去られてしまった
というエラーだと思うのですが。

アレイが崩れている状態を確認すると、
GP6-450:/home# cat /proc/mdstat 
Personalities : [raid1] 
read_ahead 1024 sectors
md0 : active raid1 ide/host0/bus0/target0/lun0/part1[1]
      7815488 blocks [2/1] [_U]

GP6-450:/home# mdadm --detail /dev/md0
/dev/md0:
        Version : 00.90.00
  Creation Time : Sat Jul  9 11:17:08 2005
     Raid Level : raid1
     Array Size : 7815488 (7.45 GiB 8.00 GB)
    Device Size : 7815488 (7.45 GiB 8.00 GB)
   Raid Devices : 2
  Total Devices : 1
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Sun Jul 17 18:21:11 2005
          State : active, degraded
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0

           UUID : 1101312f:28873e2b:52e9437a:aeb827d1
         Events : 0.44

    Number   Major   Minor   RaidDevice State
       0       0        0        0      faulty removed
       1       3        1        1      active sync   /dev/hda1

hdd1がとり外された事になっている。

mdadm /dev/md0 -a /dev/hdd1 すれば、またrebuiled が始まり、RAID1状態にはなるが、
再起動すると 、同じ状況になってしまう。


hdd1 をhdb1 の位置に付け加えて
GP6-450:/home# mdadm /dev/md0 -a /dev/hdb1
mdadm: hot added /dev/hdb1
してみる。

hdb で rebuiledが完了する
GP6-450:/boot/grub# mdadm --detail /dev/md0
    Number   Major   Minor   RaidDevice State
       0       3       65        0      active sync   /dev/hdb1
       1       3        1        1      active sync   /dev/hda1


mdadm.conf を書き換える
mdadm --detail --scan >> mdadm.conf
DEVICE partitions
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=1101312f:28873e2b:52e9437a:aeb827d1
   devices=/dev/hdb1,/dev/hda1


再起動する(hda,hdb だと再起動してもアレイは崩れない)
dmesg 
hda: attached ide-disk driver.
hda: 18041184 sectors (9237 MB) w/371KiB Cache, CHS=17898/16/63, UDMA(33)
hdb: attached ide-disk driver.
hdb: 16992864 sectors (8700 MB) w/512KiB Cache, CHS=16858/16/63, UDMA(33)
Partition check:
 /dev/ide/host0/bus0/target0/lun0: [PTBL] [1123/255/63] p1 p2
 /dev/ide/host0/bus0/target1/lun0: [PTBL] [1057/255/63] p1 p2
 [events: 00000033]
md: bind<ide/host0/bus0/target0/lun0/part1,1>
 [events: 00000033]
md: bind<ide/host0/bus0/target1/lun0/part1,2>
md: ide/host0/bus0/target1/lun0/part1's event counter: 00000033
md: ide/host0/bus0/target0/lun0/part1's event counter: 00000033
md0: max total readahead window set to 124k
md0: 1 data-disks, max readahead per data-disk: 124k
raid1: device ide/host0/bus0/target1/lun0/part1 operational as mirror 0
raid1: device ide/host0/bus0/target0/lun0/part1 operational as mirror 1
raid1: raid set md0 active with 2 out of 2 mirrors
md: updating md0 RAID superblock on device
md: ide/host0/bus0/target1/lun0/part1 [events: 00000034]<6>(write)  ide/host0/bus0/target1/lun0/part1's sb
 offset: 7815488
md: ide/host0/bus0/target0/lun0/part1 [events: 00000034]<6>(write)  ide/host0/bus0/target0/lun0/part1's sb
 offset: 7815488

アレイを確認する
GP6-450:/home/yoshimurah# cat /proc/mdstat 
Personalities : [raid1] 
read_ahead 1024 sectors
md0 : active raid1 ide/host0/bus0/target1/lun0/part1[0] ide/host0/bus0/target0/lun0/part1[1]
      7815488 blocks [2/2] [UU]

      
unused devices: <none>

GP6-450:/home/yoshimurah# mdadm --detail /dev/md0
   Number   Major   Minor   RaidDevice State
       0       3       65        0      active sync   /dev/hdb1
       1       3        1        1      active sync   /dev/hda1


長文になってしまい、申し訳ございません。この使用しているコンピュータ自体に不具合があるのかなと
も疑っているのですが。何か、ヒントになるような事がありましたらご教示賜りたくよろしくお願いいたします。