如何删除服务器上的所有多路径引用以确保重启成功”

如何删除服务器上的所有多路径引用以确保重启成功”

我在 Ubuntu 服务器上运行了一些机箱,但我没有将它们创建为 raid 阵列。它们都是单独的 xfs 单分区单驱动器。我只希望看到驱动器本身显示在 fdisk / lsblk 等中。

/dev/sddf1: UUID="ad7b3c8b-82b7-438f-ab8e-722ec33179b6" TYPE="xfs" PARTUUID="f5f4af8d-d78b-f647-bd0c-8ba190b1c5d0"
/dev/sddg1: UUID="5a41ebee-66e1-4b26-9745-bd9410fe5cc1" TYPE="xfs" PARTUUID="9aaee3e9-fef6-e14d-8e84-85a565fb44b9"
/dev/sddh1: UUID="8cc16a7c-ef74-4257-b890-8e4cb7be89c3" TYPE="xfs" PARTUUID="68a0fe50-6b1b-df4f-8d1a-067e1a15b5f2"
/dev/sddi1: UUID="f9e7dc51-5e37-4ac8-bd15-0f4f420d2d1c" TYPE="xfs" PARTUUID="24b84399-679f-d847-9311-2aff596f25e4"
/dev/mapper/mpatha-part1: UUID="989e0fa6-31ff-445a-842e-fff25e80a78d" TYPE="xfs" PARTUUID="7aab467d-4f30-c140-ad96-62f253f47b16"
/dev/mapper/mpathk-part1: UUID="d636731a-657b-4eb0-b8d0-df127136cec1" TYPE="xfs" PARTUUID="97a44bc5-3a19-dd48-bfe5-0b14881db2a2"
/dev/mapper/mpathl-part1: UUID="4ba9ebe4-253e-4df3-a153-78a2ab060330" TYPE="xfs" PARTUUID="a1dfa5ae-763e-ed4a-9ebd-45178f13c6f8"
/dev/mapper/mpathm-part1: UUID="1494dacc-a802-4530-a6b9-5fa1d6452f95" TYPE="xfs" PARTUUID="e96093e9-a262-cf41-83e9-f23f165eb752"
/dev/mapper/mpathn-part1: UUID="9cfd51f4-9e1b-41ac-88d2-bc25d45132ae" TYPE="ext4" PARTUUID="40cccdbc-

第一部分 /dev/sddf1 等很好。我只是不想要映射器的东西。如果我执行

multipath -ll
mpathal (35000c500559892d7) dm-68 IBM-XIV,ST33000650SS  B1
size=2.7T features='0' hwhandler='0' wp=rw
|-+- policy='service-time 0' prio=1 status=active
| `- 2:0:46:0  sdas    66:192 active ready running
`-+- policy='service-time 0' prio=1 status=enabled
  `- 2:0:96:0  sdcn    69:176 active ready running
mpathf (35000c50084de734f) dm-24 SEAGATE,ST91000640SS
size=932G features='0' hwhandler='0' wp=rw
|-+- policy='service-time 0' prio=1 status=active
| `- 2:0:20:0  sdt     65:48  active ready running
`-+- policy='service-time 0' prio=1 status=enabled
  `- 2:0:71:0  sdbp    68:48  active ready running.. etc

然后我可以执行

multipath -F

这正是我想要的。不再引用映射器或多路径等。我该如何删除它并“保存它”。重新启动后,它又恢复了。我该如何彻底禁用它?

答案1

类似这样的事情应该可以工作:

# Black list the storage devices
cat << EOF | sudo tee -a /etc/multipath.conf
blacklist {
  devnode "^nvme[0-9]"
}
EOF

# Restart multipath service
systemctl restart multipathd

请记住更改与devnode您的系统相匹配的设备名称。

相关内容