2009年1月10日土曜日

RAID1 構成に

元々、RAID1 にするつもりで GLAN TANK はセットアップしてきたのですが、旧サーバーからの移行期間は 1HDD で動かしてました。ほぼ 100% 移行できたので、旧サーバーを完全に停止し、そちらで使っていた HDD も GLAN TANK へ持ってきました。

旧サーバーも RAID1 で使っていた事もあり、HDD はまったく同じもの。
GLAN TANK ではとりあえず片肺でセットアップしてきた訳です。
先に旧サーバーは KNOPPIX で GLAN TANK と同じ様に FDISK しました。
/boot の領域は active にはしてません。
/ 以下を RAID 構成にします。

sunfield2:~# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 hda3[0]
77666176 blocks [2/1] [U_]

unused devices:
sunfield2:~# fdisk /dev/hda

The number of cylinders for this disk is set to 9729.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0009e30a

Device Boot Start End Blocks Id System
/dev/hda1 * 1 24 192748+ 83 Linux
/dev/hda2 25 60 289170 82 Linux swap / Solaris
/dev/hda3 61 9729 77666242+ fd Linux raid autodetect

Command (m for help): q

sunfield2:~#

既に /dev/md0 は構成してあるので、add するだけ。

sunfield2:~# mdadm --add /dev/md0 /dev/hdb3
mdadm: added /dev/hdb3
sunfield2:~# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 hdb3[2] hda3[0]
77666176 blocks [2/1] [U_]
[>....................] recovery = 0.0% (71168/77666176) finish=90.8min speed=14233K/sec

unused devices:
sunfield2:~# mdadm --grow /dev/md0 --raid-devices=2
sunfield2:~#

90 分待てということなんで、しばし待つ。。。
その間、確認。

sunfield2:~# mdadm -D /dev/md0
/dev/md0:
Version : 00.90
Creation Time : Wed Dec 10 00:08:29 2008
Raid Level : raid1
Array Size : 77666176 (74.07 GiB 79.53 GB)
Used Dev Size : 77666176 (74.07 GiB 79.53 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistent

Update Time : Sat Jan 10 18:48:16 2009
State : clean, degraded, recovering
Active Devices : 1
Working Devices : 2
Failed Devices : 0
Spare Devices : 1

Rebuild Status : 3% complete

UUID : 6a733435:bb779c3c:8986af65:ae9adae4
Events : 0.607082

Number Major Minor RaidDevice State
0 3 3 0 active sync /dev/hda3
2 3 67 1 spare rebuilding /dev/hdb3
sunfield2:~#



/boot (/dev/hda1) が RAID1 になっていないことにハタと気がついたので、これは後日行うことにする。でも、GLAN TANK の Debian は GRUB とか使ってないみたいなんで、起動のメカニズムを調べてからになりそう。。。
とりあえず、/dev/hda1 の内容を /dev/hdb1 にコピーしておく。

# mke2fs /dev/hdb1
# mount /dev/hdb1 /mnt
# cd /boot
# find . -depth | cpio -pdmv /mnt

0 コメント: