Featured image of post longhorn卷格式化挂载失败

longhorn卷格式化挂载失败

遇到一个问题:

  • longhorn组件运行一切正常

  • 页面上自己创建卷正常

  • 使用k8s的pvc调用storageclass创建pv正常

但是,当pod挂载volume时报错了:

1
2
3
4
5
6
7
8
 Type     Reason                  Age                 From                     Message
  ----     ------                  ----                ----                     -------
  Warning  FailedScheduling        17m                 default-scheduler        0/3 nodes are available: persistentvolumeclaim "nginx-pvc" not found. preemption: 0/3 nodes are available: 3 Preemption is not helpful for scheduling.
  Warning  FailedScheduling        17m                 default-scheduler        0/3 nodes are available: pod has unbound immediate PersistentVolumeClaims. preemption: 0/3 nodes are available: 3 Preemption is not helpful for scheduling.
  Normal   Scheduled               17m                 default-scheduler        Successfully assigned default/nginx-deployment-7fc8dbbc67-bmdp2 to node2-amd64.geori.geo
  Normal   SuccessfulAttachVolume  17m                 attachdetach-controller  AttachVolume.Attach succeeded for volume "pvc-4c6b9a8e-b678-4c8f-8190-4cc2da3dac74"
  Warning  FailedMount             37s (x16 over 17m)  kubelet                  MountVolume.MountDevice failed for volume "pvc-4c6b9a8e-b678-4c8f-8190-4cc2da3dac74" : rpc error: code = Internal desc = format of disk "/dev/longhorn/pvc-4c6b9a8e-b678-4c8f-8190-4cc2da3dac74" failed: type:("ext4") target:("/var/lib/kubelet/plugins/kubernetes.io/csi/driver.longhorn.io/c2a7b64ee59eaea0dfa4dfaaa55796896033d47e366100f511e162710d97fc0a/globalmount") options:("defaults") errcode:(exit status 1) output:(mke2fs 1.47.0 (5-Feb-2023)
/dev/longhorn/pvc-4c6b9a8e-b678-4c8f-8190-4cc2da3dac74 is apparently in use by the system; will not make a filesystem here!

解决方案

故障排除

  1. 查找 Longhorn 设备的 major:minor 编号:在节点上,尝试 ls -l /dev/longhorn/major:minor 编号将显示在设备名称前,例如 8,16
1
2
3
$ ls -l /dev/longhorn
# 总用量 0
# brw-rw---- 1 root disk 8, 16  7月  5 17:31 pvc-d2d80ab6-1a2e-41fd-b771-81bff9a5a3f9
  1. 查找 Linux 为相同的 major:minor 编号生成的设备是什么,使用 ls -l /dev 并找到相同 major:minor 编号的设备,例如 /dev/sdb
1
2
3
4
$ ls -l /dev
# ...
# brw-rw----   1 root disk      8,  16  7月  5 17:31 sdb
# ...
  1. 找到进程,使用 lsof 获取正在使用的文件处理程序列表,然后使用 grep 获取设备名称(例如 sde 或 /dev/longhorn/xxx,您应该在那里找到一个。
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
$ lsof -w | grep sdb
# imsetting   45256                              root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# imsetting   45256   45257 gmain                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# imsetting   45256   45258 gdbus                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# imsetting   45256   45335 dconf\x20            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# gvfsd-fus   45264                              root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# gvfsd-fus   45264   45290 gvfsd-fus            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# gvfsd-fus   45264   45291 gvfsd-fus            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# gvfsd-fus   45264   45293 gmain                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# gvfsd-fus   45264   45294 gdbus                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# gvfsd-fus   45264   45303 gvfs-fuse            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-sett   45474                              root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-sett   45474   45479 gmain                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-sett   45474   45480 dconf\x20            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-sett   45474   45481 gdbus                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-sett   45474   45486 dconf\x20            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# caja        45487                              root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# caja        45487   45542 gmain                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# caja        45487   45543 dconf\x20            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# caja        45487   45547 gdbus                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-volu   45498                              root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-volu   45498   45532 gmain                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-volu   45498   45533 dconf\x20            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-volu   45498   45536 gdbus                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507                              root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45696 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45698 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45699 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45700 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45701 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45702 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45703 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45704 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45706 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45709 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45710 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45711 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45712 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45714 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45715 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45717 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45721 nm-applet            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45723 nm-applet            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45725 nm-applet            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45727 nm-applet            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45728 nm-applet            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45729 nm-applet            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45730 nm-applet            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45733 nm-applet            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45736 nm-applet            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45738 nm-applet            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45740 nm-applet            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45742 nm-applet            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45743 nm-applet            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45745 nm-applet            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45747 nm-applet            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45749 nm-applet            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45781 gmain                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45785 gdbus                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# nm-applet   45507   45910 dconf\x20            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# gvfs-udis   45511                              root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# gvfs-udis   45511   45515 gmain                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# gvfs-udis   45511   45519 gdbus                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523                              root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45545 QXcbEvent            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45707 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45708 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45713 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45716 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45718 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45719 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45722 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45724 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45726 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45731 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45732 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45734 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45735 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45739 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45741 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45744 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45746 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45748 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45750 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45752 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45753 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45754 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45755 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45756 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45757 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45759 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45761 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45762 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45763 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45764 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45765 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45766 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45788 QDBusConn            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45797 gmain                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   45523   45799 gdbus                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# goa-daemo   45559                              root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# goa-daemo   45559   45790 gmain                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# goa-daemo   45559   45795 gdbus                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# goa-daemo   45559   45802 dconf\x20            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# gvfsd-tra   45998                              root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# gvfsd-tra   45998   46006 gmain                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# gvfsd-tra   45998   46007 gdbus                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-pane   46113                              root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-pane   46113   46114 gmain                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-pane   46113   46115 dconf\x20            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-pane   46113   46116 gdbus                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# python2     46128                              root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# python2     46128   46142 python2              root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# python2     46128   46155 gmain                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# python2     46128   46156 dconf\x20            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# python2     46128   46157 gdbus                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# python2     46128   46166 python2              root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# wnck-appl   46130                              root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# wnck-appl   46130   46133 gmain                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# wnck-appl   46130   46135 gdbus                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# wnck-appl   46130   46136 dconf\x20            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-indi   46132                              root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-indi   46132   46137 gmain                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-indi   46132   46139 gdbus                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-indi   46132   46140 dconf\x20            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-indi   46132   46141 mate-indi            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-indi   46132   46143 mate-indi            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-indi   46132   46144 mate-indi            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-indi   46132   46145 mate-indi            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-indi   46132   46146 mate-indi            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-indi   46132   46147 mate-indi            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-indi   46132   46148 mate-indi            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-indi   46132   46149 mate-indi            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-indi   46132   46150 mate-indi            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# mate-indi   46132   46161 mate-indi            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# bamfdaemo   46301                              root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# bamfdaemo   46301   46302 gmain                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# bamfdaemo   46301   46304 gdbus                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371                              root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46372 QXcbEvent            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46373 QDBusConn            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46374 gmain                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46375 gdbus                root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46376 dconf\x20            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46377 XEventMon            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46378 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46379 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46380 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46381 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46382 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46383 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46384 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46385 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46386 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46387 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46388 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46389 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46390 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46391 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46392 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46393 llvmpipe-            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46394 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46395 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46396 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46397 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46398 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46399 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46400 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46401 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46402 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46403 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46404 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46405 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46406 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46407 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46408 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# ukui-scre   46371   46409 ukui-scre            root  mem       REG              253,0     215296  539058041 /usr/lib64/gio/modules/libgvfsdbus.so
# multipath  916906                              root    9r      BLK               8,16        0t0   29554958 /dev/sdb
# multipath  916906  916907 multipath            root    9r      BLK               8,16        0t0   29554958 /dev/sdb
# multipath  916906  916908 multipath            root    9r      BLK               8,16        0t0   29554958 /dev/sdb
# multipath  916906  916909 multipath            root    9r      BLK               8,16        0t0   29554958 /dev/sdb
# multipath  916906  916910 multipath            root    9r      BLK               8,16        0t0   29554958 /dev/sdb
# multipath  916906  916911 multipath            root    9r      BLK               8,16        0t0   29554958 /dev/sdb
# multipath  916906  916912 multipath            root    9r      BLK               8,16        0t0   29554958 /dev/sdb

解决方案

按照以下步骤防止多路径守护进程(multipath daemon)添加由 Longhorn 创建的额外块设备。首先使用 lsblk 检查 Longhorn 创建的设备:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
$ lsblk
# NAME                                MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
# sda                                   8:0    1 447.1G  0 disk
# ├─sda1                                8:1    1   600M  0 part  /boot/efi
# ├─sda2                                8:2    1     1G  0 part  /boot
# └─sda3                                8:3    1 445.5G  0 part
#   ├─klas-root                       253:0    0 391.5G  0 lvm   /
#   ├─klas-swap                       253:1    0     4G  0 lvm
#   └─klas-backup                     253:2    0    50G  0 lvm
# sdb                                   8:16   0     1G  0 disk
# └─360000000000000000e00000000010001 253:3    0     1G  0 mpath
# nvme0n1                             259:0    0   3.5T  0 disk
# └─nvme0n1p1                         259:1    0   3.5T  0 part  /var/lib/libvirt/images

请注意,Longhorn 设备名称以 /dev/sd[x] 开头

  • 如果不存在,则创建默认配置文件 /etc/multipath.conf

  • 将以下行添加到黑名单部分 devnode "^sd[a-z0-9]+"

    1
    2
    3
    
    blacklist {
        devnode "^sd[a-z0-9]+"
    }
    
  • 重启多路径服务

    1
    
    $ systemctl restart multipathd.service
    
  • 验证是否应用了配置

    1
    
    $ multipath -t
    

多路径黑名单部分的默认配置默认阻止以下设备名称
^(ram|raw|loop|fd|md|dm-|sr|scd|st|dcssblk)[0-9] ^(td|hd|vd)[a-z]