如何卸载 SAN 设备 - Ubuntu 上的多路径

如何卸载 SAN 设备 - Ubuntu 上的多路径

我必须断开通过光纤通道连接到 Ubuntu 的 SAN。我该怎么做?

root@fs2:/# umount /srv/media
umount: /srv/media: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
root@fs2:/# fuser /srv/media
root@fs2:/# fuser /dev/mapper/media

多路径输出:

root@fs2:/# multipath -v2 -l
media (360060160c8101f00d25370be50a6df11) dm-0 DGC     ,RAID 5        
[size=2.8T][features=1 queue_if_no_path][hwhandler=1 emc]
\_ round-robin 0 [prio=0][active]
 \_ 3:0:0:0 sda 8:0   [active][undef]
\_ round-robin 0 [prio=0][enabled]
 \_ 2:0:0:0 sdb 8:16  [active][undef]

多路径配置:

root@fs2:/# cat /etc/multipath.conf 
multipaths {
  multipath {
    wwid                    360060160c8101f00c0f618c25c9edf11
    alias                   web
    path_grouping_policy    multibus
    path_checker            directio
    path_selector           "round-robin 0"
    failback                manual
    rr_weight               priorities
    no_path_retry           5
    rr_min_io               100
  }

  multipath {
    wwid                    360060160c8101f00d25370be50a6df11
    alias                   media
    path_grouping_policy    multibus
    path_checker            directio
    path_selector           "round-robin 0"
    failback                manual
    rr_weight               priorities
    no_path_retry           5
    rr_min_io               100
  }
}

我如何禁用该设备并将其从系统中永久卸载?

答案1

我发现 /etc/exports 中正在使用设备与 nfs 客户端共享。运行exportfs -rv、从 中删除设备smbd.conf(重新启动 samba)和从 中删除设备后/etc/fstab,我能够卸载设备umount /srv/media

我也做过:

root@fs2:/# multipath -ll
media (360060160c8101f00d25370be50a6df11) dm-0 DGC     ,RAID 5        
[size=2.8T][features=1 queue_if_no_path][hwhandler=1 emc]
\_ round-robin 0 [prio=1][active]
 \_ 3:0:0:0 sda 8:0   [active][ready]
\_ round-robin 0 [prio=0][enabled]
 \_ 2:0:0:0 sdb 8:16  [active][ready]
root@fs2:/# multipath -F
root@fs2:/# multipath -ll

最后(其中 sda 和 sdb 取自多路径):

root@fs2:/# echo 1 > /sys/block/sda/device/delete
root@fs2:/# echo 1 > /sys/block/sdb/device/delete

这会在 dmesg 中显示这些消息:

[9847487.812391] sd 3:0:0:0: emc: Detached
[9847491.460307] sd 2:0:0:0: emc: Detached

这似乎最终可以卸载设备。希望有人觉得这有用 :-)

相关内容