RHEL8.6 ppc64le のrootファイルシステムをマルチパスに変更

#### はじめに

RHEL VM(ミラーリング, MD RAID構成)をPowerVCでイメージ・キャプチャーしてデプロイしたところ、マルチパス構成が失われていたため再度マルチパスを追加したログです。


ミラーリング(MD RAID)は以下で実行しています。

https://qiita.com/c_u/items/88f1cf6f6cabd88d39b7

---

#### 参照文書

https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/8/html/configuring_device_mapper_multipath/moving-a-root-file-system-from-a-single-path-device-to-a-multipath-device_managing-multipathed-volumes


---

#### 環境


RHEL 8.6 ppc64le on S1022 
  - testvm01 というホスト名のサーバー
  - ミラーリング構成のイメージをPowerVCからデプロイして作成
  - ディスクは VIOS vscsi 構成


---

#### 確認

##### multipath コマンド確認

```
[root@testvm01 ~]# multipath -l
```

-> 出力なし

##### /etc/multipath.conf 確認

```
[root@testvm01 ~]# cat /etc/multipath.conf 
defaults {
find_multipaths yes
user_friendly_names yes
}
blacklist {
}
[root@testvm01 ~]#
```

-> multipath.conf は存在


##### /etc/multipath/bindings 確認

```
[root@testvm01 ~]# cat /etc/multipath/bindings
# Multipath bindings, Version : 1.0
# NOTE: this file is automatically maintained by the multipath program.
# You should not need to edit this file in normal circumstances.
#
# Format:
# alias wwid
#
mpatha 360050763808106d7d80000000000013b
mpathb 360050763808106d7d80000000000013a
```

-> mpatha、mpathb の情報はある


##### /etc/multipath/bindingswwids 確認

```
[root@testvm01 ~]# cat /etc/multipath/wwids
# Multipath wwids, Version : 1.0
# NOTE: This file is automatically maintained by multipath and multipathd.
# You should not need to edit this file in normal circumstances.
#
# Valid WWIDs:
/360050763808106d7d80000000000013b/
```

-> mpathb のみ？


##### muptipathdltipathd.service 確認

```
[root@testvm01 ~]# systemctl status multipathd.service
● multipathd.service - Device-Mapper Multipath Device Controller
   Loaded: loaded (/usr/lib/systemd/system/multipathd.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2023-07-26 21:31:34 EDT; 34min ago
 Main PID: 1086 (multipathd)
   Status: "up"
    Tasks: 7
   Memory: 20.2M
   CGroup: /system.slice/multipathd.service
           └─1086 /sbin/multipathd -d -s
Jul 26 21:31:33 testvm01 systemd[1]: Starting Device-Mapper Multipath Device Controller...
Jul 26 21:31:33 testvm01 multipathd[1086]: --------start up--------
Jul 26 21:31:33 testvm01 multipathd[1086]: read /etc/multipath.conf
Jul 26 21:31:33 testvm01 multipathd[1086]: path checkers start up
Jul 26 21:31:34 testvm01 multipathd[1086]: mpatha: setting up map with 2/2 path checkers pending
Jul 26 21:31:34 testvm01 multipathd[1086]: mpatha: ignoring map
Jul 26 21:31:34 testvm01 multipathd[1086]: mpathb: ignoring map
Jul 26 21:31:34 testvm01 multipathd[1086]: mpatha: ignoring map
Jul 26 21:31:34 testvm01 multipathd[1086]: mpathb: ignoring map
Jul 26 21:31:34 testvm01 systemd[1]: Started Device-Mapper Multipath Device Controller.
```

-> サービスは running



##### /dev/mapper 確認

```
[root@testvm01 md]# ls -l /dev/mapper
total 0
crw-------. 1 root root 10, 236 Jul 26 21:31 control
lrwxrwxrwx. 1 root root       7 Jul 26 21:31 rhel-root -> ../dm-0
lrwxrwxrwx. 1 root root       7 Jul 26 21:31 rhel-swap -> ../dm-1
```

=> dm-0, dm-1 は存在


##### lsblk コマンド確認

```
[root@testvm01 md]# lsblk --fs
NAME            FSTYPE            LABEL     UUID                                   MOUNTPOINT
sda                                                                                
├─sda1                                                                             
├─sda2          linux_raid_member testvm01:0 5dfd2d76-9a03-0e84-1fe2-e429a5348eec   
│ └─md0         xfs                         41435ad6-deae-470a-a6dd-5597e6260a7f   /boot
└─sda3          linux_raid_member testvm01:1 6660f874-01c3-2e81-783d-5695ef10722f   
  └─md1         LVM2_member                 g7Tf3O-RPDf-z9Sg-2mJZ-BSOh-vaHK-92PW14 
    ├─rhel-root xfs                         b8956ba8-47d5-49ec-888e-d5d226d7143a   /
    └─rhel-swap swap                        c5855925-d52f-4405-8c32-e721c0312344   [SWAP]
sdb                                                                                
├─sdb1                                                                             
├─sdb2          linux_raid_member testvm01:0 5dfd2d76-9a03-0e84-1fe2-e429a5348eec   
└─sdb3          linux_raid_member testvm01:1 6660f874-01c3-2e81-783d-5695ef10722f   
sdc                                                                                
├─sdc1                                                                             
├─sdc2          linux_raid_member testvm01:0 5dfd2d76-9a03-0e84-1fe2-e429a5348eec   
└─sdc3          linux_raid_member testvm01:1 6660f874-01c3-2e81-783d-5695ef10722f   
sdd                                                                                
├─sdd1                                                                             
├─sdd2          linux_raid_member testvm01:0 5dfd2d76-9a03-0e84-1fe2-e429a5348eec   
│ └─md0         xfs                         41435ad6-deae-470a-a6dd-5597e6260a7f   /boot
└─sdd3          linux_raid_member testvm01:1 6660f874-01c3-2e81-783d-5695ef10722f   
  └─md1         LVM2_member                 g7Tf3O-RPDf-z9Sg-2mJZ-BSOh-vaHK-92PW14 
    ├─rhel-root xfs                         b8956ba8-47d5-49ec-888e-d5d226d7143a   /
    └─rhel-swap swap                        c5855925-d52f-4405-8c32-e721c0312344   [SWAP]
sr0             iso9660           config-2  2023-07-26-20-59-21-00     
```

-> sda/sdb/sdc/sdd で認識されている





---

#### 変更

##### mpathconf コマンドの実行

```
[root@testvm01 etc]# mpathconf --enable
```

##### rootデバイスにマルチパスを構築

```
[root@testvm01 multipath]# multipath -a /dev/sda
wwid '360050763808106d7d80000000000013b' added
[root@testvm01 multipath]# multipath -a /dev/sdb
wwid '360050763808106d7d80000000000013a' added
[root@testvm01 multipath]# multipath -a /dev/sdc
wwid '360050763808106d7d80000000000013b' added
[root@testvm01 multipath]# multipath -a /dev/sdd
wwid '360050763808106d7d80000000000013a' added
```


```
[root@testvm01 multipath]# multipath
Jul 26 22:20:10 | mpatha: ignoring map
Jul 26 22:20:10 | mpathb: ignoring map
Jul 26 22:20:10 | mpatha: ignoring map
Jul 26 22:20:10 | mpathb: ignoring map
```

mutltipath コマンドが失敗することを確認


##### initramfs ファイルシステムを再構築

```
[root@testvm01 etc]# dracut --force -H --add multipath
```

##### shutdown 

```
[root@testvm01 etc]# shutdown -h now

Connection to xxx.xx.xxx.xxx closed by remote host.
Connection to xxx.xx.xxx.xxx closed.
```


---

#### 変更後確認


ログイン

##### multipath コマンド確認

```
[root@testvm01 ~]# multipath -ll
mpatha (360050763808106d7d80000000000013b) dm-0 AIX,VDASD
size=50G features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=1 status=active
  |- 0:0:1:0 sda 8:0  active ready running
  `- 1:0:1:0 sdc 8:32 active ready running
mpathb (360050763808106d7d80000000000013a) dm-1 AIX,VDASD
size=50G features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=1 status=active
  |- 0:0:2:0 sdb 8:16 active ready running
  `- 1:0:2:0 sdd 8:48 active ready running
```

-> multipathコマンドが正常に返る


##### lsblk コマンド確認

```
[root@testvm01 ~]# lsblk --fs
NAME              FSTYPE            LABEL     UUID                                   MOUNTPOINT
sda               mpath_member                                                       
└─mpatha                                                                             
  ├─mpatha1                                                                          
  ├─mpatha2       linux_raid_member testvm01:0 5dfd2d76-9a03-0e84-1fe2-e429a5348eec   
  │ └─md0         xfs                         41435ad6-deae-470a-a6dd-5597e6260a7f   /boot
  └─mpatha3       linux_raid_member testvm01:1 6660f874-01c3-2e81-783d-5695ef10722f   
    └─md1         LVM2_member                 g7Tf3O-RPDf-z9Sg-2mJZ-BSOh-vaHK-92PW14 
      ├─rhel-root xfs                         b8956ba8-47d5-49ec-888e-d5d226d7143a   /
      └─rhel-swap swap                        c5855925-d52f-4405-8c32-e721c0312344   [SWAP]
sdb               mpath_member                                                       
└─mpathb                                                                             
  ├─mpathb1                                                                          
  ├─mpathb2       linux_raid_member testvm01:0 5dfd2d76-9a03-0e84-1fe2-e429a5348eec   
  │ └─md0         xfs                         41435ad6-deae-470a-a6dd-5597e6260a7f   /boot
  └─mpathb3       linux_raid_member testvm01:1 6660f874-01c3-2e81-783d-5695ef10722f   
    └─md1         LVM2_member                 g7Tf3O-RPDf-z9Sg-2mJZ-BSOh-vaHK-92PW14 
      ├─rhel-root xfs                         b8956ba8-47d5-49ec-888e-d5d226d7143a   /
      └─rhel-swap swap                        c5855925-d52f-4405-8c32-e721c0312344   [SWAP]
sdc               mpath_member                                                       
└─mpatha                                                                             
  ├─mpatha1                                                                          
  ├─mpatha2       linux_raid_member testvm01:0 5dfd2d76-9a03-0e84-1fe2-e429a5348eec   
  │ └─md0         xfs                         41435ad6-deae-470a-a6dd-5597e6260a7f   /boot
  └─mpatha3       linux_raid_member testvm01:1 6660f874-01c3-2e81-783d-5695ef10722f   
    └─md1         LVM2_member                 g7Tf3O-RPDf-z9Sg-2mJZ-BSOh-vaHK-92PW14 
      ├─rhel-root xfs                         b8956ba8-47d5-49ec-888e-d5d226d7143a   /
      └─rhel-swap swap                        c5855925-d52f-4405-8c32-e721c0312344   [SWAP]
sdd               mpath_member                                                       
└─mpathb                                                                             
  ├─mpathb1                                                                          
  ├─mpathb2       linux_raid_member testvm01:0 5dfd2d76-9a03-0e84-1fe2-e429a5348eec   
  │ └─md0         xfs                         41435ad6-deae-470a-a6dd-5597e6260a7f   /boot
  └─mpathb3       linux_raid_member testvm01:1 6660f874-01c3-2e81-783d-5695ef10722f   
    └─md1         LVM2_member                 g7Tf3O-RPDf-z9Sg-2mJZ-BSOh-vaHK-92PW14 
      ├─rhel-root xfs                         b8956ba8-47d5-49ec-888e-d5d226d7143a   /
      └─rhel-swap swap                        c5855925-d52f-4405-8c32-e721c0312344   [SWAP]

````



##### /dev/mapper 確認


```
[root@testvm01 ~]# ls -l /dev/mapper
total 0
crw-------. 1 root root 10, 236 Jul 27 00:09 control
lrwxrwxrwx. 1 root root       7 Jul 27 00:09 mpatha -> ../dm-0
lrwxrwxrwx. 1 root root       7 Jul 27 00:09 mpatha1 -> ../dm-2
lrwxrwxrwx. 1 root root       7 Jul 27 00:09 mpatha2 -> ../dm-3
lrwxrwxrwx. 1 root root       7 Jul 27 00:09 mpatha3 -> ../dm-4
lrwxrwxrwx. 1 root root       7 Jul 27 00:09 mpathb -> ../dm-1
lrwxrwxrwx. 1 root root       7 Jul 27 00:09 mpathb1 -> ../dm-5
lrwxrwxrwx. 1 root root       7 Jul 27 00:09 mpathb2 -> ../dm-6
lrwxrwxrwx. 1 root root       7 Jul 27 00:09 mpathb3 -> ../dm-7
lrwxrwxrwx. 1 root root       7 Jul 27 00:09 rhel-root -> ../dm-8
lrwxrwxrwx. 1 root root       7 Jul 27 00:09 rhel-swap -> ../dm-9
[root@testvm01 ~]#
```



rootデバイスのmultipath を設定することができました。



以上です。