2022年 09月 16日
Linux ソフトウェア Raid openSUSE 15.4 後編 - ディスクの差替え

Linux ソフトウェア Raid 作成 openSUSE 15.4 YaST GUI(前編)
SLE マニュアルはこちら
mdadmによるソフトウェアRAIDアレイのサイズ変更
opensuse154:~ # mdadm /dev/md127 --fail /dev/vdc --remove /dev/vdcmdadm: set /dev/vdc faulty in /dev/md127mdadm: hot removed /dev/vdc from /dev/md127
opensuse154:~ # cat /proc/mdstatPersonalities : [raid1]md127 : active raid1 vdb[0]13631360 blocks super 1.0 [2/1] [U_]bitmap: 0/1 pages [0KB], 65536KB chunkunused devices: <none>
確認してみる
opensuse154:~ # mdadm --detail /dev/md127/dev/md127:Version : 1.0Creation Time : Tue Sep 13 10:57:56 2022Raid Level : raid1Array Size : 13631360 (13.00 GiB 13.96 GB)Used Dev Size : 13631360 (13.00 GiB 13.96 GB)Raid Devices : 2Total Devices : 1Persistence : Superblock is persistentIntent Bitmap : InternalUpdate Time : Tue Sep 13 16:59:42 2022State : clean, degradedActive Devices : 1Working Devices : 1Failed Devices : 0Spare Devices : 0Consistency Policy : bitmapName : any:mydiskUUID : eb1a87b7:bf3c3411:c08ec675:a46606faEvents : 43Number Major Minor RaidDevice State0 253 16 0 active sync /dev/vdb- 0 0 1 removedopensuse154:~ #
ディスク vdc が removed になった。
この間にファイルをいくつか修正して、継続してアクセスできることを確認しました。
iSCSI NAS にターゲットを作成し、iSCSI 上で Active 状態にします。
Linux で iSCSI で NAS を使う openSUSE Leap 15.4https://islandcnt.exblog.jp/241577472/
増設した iSCSI ターゲット /dev/sda を Raid ディスクセットに追加します。
opensuse154:~ # mdadm --add /dev/md127 /dev/sdamdadm: added /dev/sdaopensuse154:~ # mdadm --detail /dev/md127/dev/md127:Version : 1.0Creation Time : Tue Sep 13 10:57:56 2022Raid Level : raid1Array Size : 13631360 (13.00 GiB 13.96 GB)Used Dev Size : 13631360 (13.00 GiB 13.96 GB)Raid Devices : 2Total Devices : 2Persistence : Superblock is persistentIntent Bitmap : InternalUpdate Time : Wed Sep 14 19:25:18 2022State : clean, degraded, recoveringActive Devices : 1Working Devices : 2Failed Devices : 0Spare Devices : 1Consistency Policy : bitmapRebuild Status : 8% completeName : any:mydiskUUID : eb1a87b7:bf3c3411:c08ec675:a46606faEvents : 164Number Major Minor RaidDevice State0 253 16 0 active sync /dev/vdb2 8 0 1 spare rebuilding /dev/sdaopensuse154:~ #
spare rebuilding になりました。
進捗を確認します。
opensuse154:~ # cat /proc/mdstatPersonalities : [raid1]md127 : active raid1 sda[2] vdb[0]13631360 blocks super 1.0 [2/1] [U_][====>................] recovery = 24.9% (3405376/13631360) finish=18.0min speed=9431K/secbitmap: 0/1 pages [0KB], 65536KB chunkunused devices: <none>opensuse154:~ #
recovery = .... が進捗中です。18分後に終了予定です。
終わりました
opensuse154:~ # cat /proc/mdstatPersonalities : [raid1]md127 : active raid1 sda[2] vdb[0]13631360 blocks super 1.0 [2/2] [UU]bitmap: 0/1 pages [0KB], 65536KB chunkunused devices: <none>opensuse154:~ # mdadm --detail /dev/md127/dev/md127:Version : 1.0Creation Time : Tue Sep 13 10:57:56 2022Raid Level : raid1Array Size : 13631360 (13.00 GiB 13.96 GB)Used Dev Size : 13631360 (13.00 GiB 13.96 GB)Raid Devices : 2Total Devices : 2Persistence : Superblock is persistentIntent Bitmap : InternalUpdate Time : Wed Sep 14 19:44:13 2022State : cleanActive Devices : 2Working Devices : 2Failed Devices : 0Spare Devices : 0Consistency Policy : bitmapName : any:mydiskUUID : eb1a87b7:bf3c3411:c08ec675:a46606faEvents : 387Number Major Minor RaidDevice State0 253 16 0 active sync /dev/vdb2 8 0 1 active sync /dev/sdaopensuse154:~ #
とりあえず、Raid1 で構築したディスクセットの復旧はできましたが、YaST2 パーティショナーから操作すると正しく認識されません。コンピュータを再起動しても、動作に支障はないのですが、パーティション操作を受け付けなくなりました。まず、ディスクの構成が変わったわけです。おそらく停止させたミラーコピーディスクを(仮想マシンから)取り外していない事が原因だと思うのですが、この作業手順でなにかヌケがあるのかは調べてみなければなりません。