白箱をいぢる 2(RAIDの再構築)
玄箱が有名であるほどには、白箱は知られていないようだ。したがって、検索時のキーワードにも気を遣う。白箱、グラタン、GLAN TANK、GLANTANK、SOTO-HDLGW …「これは」…という名前が決まっていない。どれも、知ってるやつは分かるけれど、知らないやつは分からない。検索窓に、「 グラタン OR 白箱 OR GLAN OR TANK OR GLANTANK OR SOTO-HDLGW “apt-line”」なんてやらないとだめなのだ。「白箱 “apt-line”」程度じゃ、場合によっては重要な情報のページがhitしない。この手の愚痴はこのくらいにして・・・次の愚痴・・・(笑)色々といぢっているうちに、ACCESSランプが点滅をやめないことに気づいたのです。最初からだったようにも思いますが・・・どうやら、RAIDがうまくいっていないと、こーなるらしいです。ぢゃ、一応mdstatでも見てみるか・・・とsshで入ってrootになって、
GLANTANK:/home/admin# cat /proc/mdstatPersonalities : [linear] [raid0] [raid1] [raid5]md0 : active raid1 hda3[0]312054528 blocks [2/1] [U_]unused devices: <none>
あちゃーーーーー2台目無視かよ・・・ぢゃ、fdiskで状態を見てみるべと、
GLANTANK:/home/admin# fdisk -l /dev/hdaDisk /dev/hda: 320.0 GB, 320072933376 bytes255 heads, 63 sectors/track, 38913 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System/dev/hda1 1 32 257008+ 83 Linux/dev/hda2 33 64 257040 82 Linux swap / Solaris/dev/hda3 65 38913 312054592+ fd Linux raid autodetect※ここから1引いた値を後ほど、スタートシリンダの値に入力
hdaは大丈夫そうね。
GLANTANK:/home/admin# df -mFilesystem 1M-ブロック 使用 使用可 使用% マウント位置/dev/md0 299959 1113 283610 1% /tmpfs 62 1 62 1% /dev/shm/dev/hda1 244 128 104 56% /boot
ぢゃ、領域解放して、RAIDの再構築ってやつをやってやるべと・・・まずは、領域解放からですね。
GLANTANK:/home/admin# fdisk /dev/hdbThe number of cylinders for this disk is set to 38913.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): pDisk /dev/hdb: 320.0 GB, 320072933376 bytes255 heads, 63 sectors/track, 38913 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System/dev/hdb1 1 32 257008+ 83 Linux/dev/hdb2 33 64 257040 82 Linux swap / Solaris/dev/hdb3 65 38913 312054592+ fd Linux raid autodetectCommand (m for help): dPartition number (1-4): 1Command (m for help): dPartition number (1-4): 2Command (m for help): dSelected partition 3Command (m for help): pDisk /dev/hdb: 320.0 GB, 320072933376 bytes255 heads, 63 sectors/track, 38913 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System
おっけ。続いて、新規で領域を確保して、パーティションタイプをLinux raid autodetectに変える
Command (m for help): nCommand actione extendedp primary partition (1-4)pPartition number (1-4): 1First cylinder (1-38913, default 1): 64Last cylinder or +size or +sizeM or +sizeK (64-38913, default 38913):Using default value 38913Command (m for help): tSelected partition 1Hex code (type L to list codes): fdChanged system type of partition 1 to fd (Linux raid autodetect)Command (m for help): pDisk /dev/hdb: 320.0 GB, 320072933376 bytes255 heads, 63 sectors/track, 38913 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System/dev/hdb1 64 38913 312062625 fd Linux raid autodetectCommand (m for help): wThe partition table has been altered!
ここまではOK。無問題(もーまんたい…ふるっ)。さて、いよいよRAIDの再構築をやっぺ。…ところが…
GLANTANK:/home/admin# raidhotadd /dev/md0 /dev/hdb1bash: raidhotadd: command not found
とかなっちまう!ぐぐったっけ、愛と悲しみのピアノレッスンさんの●HDDの追加とRAIDアレイに情報あり!
GLANTANK:/home/admin# mdadm --manage /dev/md0 --add /dev/hdb1mdadm: hot added /dev/hdb1
気持ちよく逝ってくれた。様子を見ると・・・
GLANTANK:/home/admin# cat /proc/mdstatPersonalities : [linear] [raid0] [raid1] [raid5]md0 : active raid1 hdb1[2] hda3[0]312054528 blocks [2/1] [U_][>....................] recovery = 0.3% (1016704/312054528) finish=302.2min speed=17152K/secunused devices: <none>
うまく逝ってますな。ちなみに、RAID再構築前は、こんなだったのだからね。
GLANTANK:/home/admin# cat /proc/mdstatPersonalities : [linear] [raid0] [raid1] [raid5]md0 : active raid1 hda3[0]312054528 blocks [2/1] [U_]unused devices: <none>
そんでもって、数時間後RAID再構築が終わり、正常な状態になりました。
GLANTANK:/home/admin# cat /proc/mdstatPersonalities : [linear] [raid0] [raid1] [raid5]md0 : active raid1 hdb1[1] hda3[0]312054528 blocks [2/2] [UU]
※100%終わってからしばらくはACCESSランプが速く点滅するという異常点滅状態は続きましたが、放っておいたら、ACCESSランプは消灯し、POWERランプの点灯のみになりました。
0コメント