如何确保RHEL在重启后会看到多path磁盘?

我们正在使用RHEL,但不幸的是存在多path问题。

似乎不是所有的SAN磁盘在重启后都会自动看到。 为了使操作系统能够看到磁盘,需要执行服务多path重新加载。

root@test-01 ~]# ls -al /dev/mapper/ total 0 drwxr-xr-x. 2 root root 480 May 31 13:17 . drwxr-xr-x. 21 root root 5500 May 31 13:20 .. crw-rw----. 1 root root 10, 58 May 31 13:17 control brw-rw----. 1 root disk 253, 16 May 31 13:17 TS_DATA_DISK000p1 brw-rw----. 1 root disk 253, 14 May 31 13:17 TS_DATA_DISK001p1 brw-rw----. 1 root disk 253, 7 May 31 13:17 TS_DATA_DISK002p1 brw-rw----. 1 root disk 253, 9 May 31 13:17 TS_DATA_DISK003p1 lrwxrwxrwx. 1 root root 8 May 31 13:17 TS_BEL_DISK000p1 -> ../dm-15 lrwxrwxrwx. 1 root root 8 May 31 13:17 TS_BEL_DISK001p1 -> ../dm-17 lrwxrwxrwx. 1 root root 8 May 31 13:17 TS_BEL_DISK002p1 -> ../dm-22 lrwxrwxrwx. 1 root root 7 May 31 13:17 TS_BEL_DISK003 -> ../dm-5 lrwxrwxrwx. 1 root root 8 May 31 13:17 TS_BEL_DISK003p1 -> ../dm-12 brw-rw----. 1 root disk 253, 23 May 31 13:17 TS_JPG_DISK000p1 brw-rw----. 1 root disk 253, 18 May 31 13:17 TS_JPG_DISK001p1 lrwxrwxrwx. 1 root root 8 May 31 13:17 TS_JPG_DISK002 -> ../dm-21 lrwxrwxrwx. 1 root root 8 May 31 13:17 TS_JPG_DISK002p1 -> ../dm-24 lrwxrwxrwx. 1 root root 8 May 31 13:17 mpathb -> ../dm-25 lrwxrwxrwx. 1 root root 8 May 31 13:17 mpathbp1 -> ../dm-26 lrwxrwxrwx. 1 root root 8 May 31 13:17 vg00-lvhome -> ../dm-30 lrwxrwxrwx. 1 root root 7 May 31 13:17 vg00-lvroot -> ../dm-1 lrwxrwxrwx. 1 root root 7 May 31 13:17 vg00-lvswap -> ../dm-0 lrwxrwxrwx. 1 root root 8 May 31 13:17 vg00-lvtmp -> ../dm-29 lrwxrwxrwx. 1 root root 8 May 31 13:17 vg00-lvvar -> ../dm-28 lrwxrwxrwx. 1 root root 8 May 31 13:17 vg_app-lv_d01_app -> ../dm-27 [root@test-01 ~]# service multipathd reload Reloading multipathd: [ OK ] [root@test-01 ~]# ls -al /dev/mapper total 0 drwxr-xr-x. 2 root root 680 May 31 13:22 . drwxr-xr-x. 21 root root 5500 May 31 13:22 .. crw-rw----. 1 root root 10, 58 May 31 13:17 control lrwxrwxrwx. 1 root root 8 May 31 13:22 TS_DATA_DISK000 -> ../dm-10 lrwxrwxrwx. 1 root root 8 May 31 13:22 TS_DATA_DISK000p1 -> ../dm-16 lrwxrwxrwx. 1 root root 7 May 31 13:22 TS_DATA_DISK001 -> ../dm-6 lrwxrwxrwx. 1 root root 8 May 31 13:22 TS_DATA_DISK001p1 -> ../dm-14 lrwxrwxrwx. 1 root root 7 May 31 13:22 TS_DATA_DISK002 -> ../dm-3 lrwxrwxrwx. 1 root root 7 May 31 13:22 TS_DATA_DISK002p1 -> ../dm-7 lrwxrwxrwx. 1 root root 7 May 31 13:22 TS_DATA_DISK003 -> ../dm-4 lrwxrwxrwx. 1 root root 7 May 31 13:22 TS_DATA_DISK003p1 -> ../dm-9 lrwxrwxrwx. 1 root root 7 May 31 13:22 TS_BEL_DISK000 -> ../dm-8 lrwxrwxrwx. 1 root root 8 May 31 13:22 TS_BEL_DISK000p1 -> ../dm-15 lrwxrwxrwx. 1 root root 8 May 31 13:22 TS_BEL_DISK001 -> ../dm-11 lrwxrwxrwx. 1 root root 8 May 31 13:22 TS_BEL_DISK001p1 -> ../dm-17 lrwxrwxrwx. 1 root root 8 May 31 13:22 TS_BEL_DISK002 -> ../dm-19 lrwxrwxrwx. 1 root root 8 May 31 13:22 TS_BEL_DISK002p1 -> ../dm-22 lrwxrwxrwx. 1 root root 7 May 31 13:22 TS_BEL_DISK003 -> ../dm-5 lrwxrwxrwx. 1 root root 8 May 31 13:22 TS_BEL_DISK003p1 -> ../dm-12 lrwxrwxrwx. 1 root root 8 May 31 13:22 TS_JPG_DISK000 -> ../dm-20 lrwxrwxrwx. 1 root root 8 May 31 13:22 TS_JPG_DISK000p1 -> ../dm-23 lrwxrwxrwx. 1 root root 8 May 31 13:22 TS_JPG_DISK001 -> ../dm-13 lrwxrwxrwx. 1 root root 8 May 31 13:22 TS_JPG_DISK001p1 -> ../dm-18 lrwxrwxrwx. 1 root root 8 May 31 13:22 TS_JPG_DISK002 -> ../dm-21 lrwxrwxrwx. 1 root root 8 May 31 13:22 TS_JPG_DISK002p1 -> ../dm-24 lrwxrwxrwx. 1 root root 8 May 31 13:22 mpathb -> ../dm-25 lrwxrwxrwx. 1 root root 8 May 31 13:22 mpathbp1 -> ../dm-26 lrwxrwxrwx. 1 root root 7 May 31 13:22 d01 -> ../dm-2 lrwxrwxrwx. 1 root root 8 May 31 13:17 vg00-lvhome -> ../dm-30 lrwxrwxrwx. 1 root root 7 May 31 13:17 vg00-lvroot -> ../dm-1 lrwxrwxrwx. 1 root root 7 May 31 13:17 vg00-lvswap -> ../dm-0 lrwxrwxrwx. 1 root root 8 May 31 13:17 vg00-lvtmp -> ../dm-29 lrwxrwxrwx. 1 root root 8 May 31 13:17 vg00-lvvar -> ../dm-28 lrwxrwxrwx. 1 root root 8 May 31 13:17 vg_app-lv_d01_app -> ../dm-27 [root@test-01 ~]# 

如何确保RHEL在重新启动后将看到多path磁盘,而无需手动运行服务multipathd重新加载?

如果在不重新创buildinitrd的情况下对/etc/multipath.conf进行了更改,则可以尝试重新创buildinitrd。 这并确保multipathd守护进程正在运行( chkconfig multipathd on )应该足以满足我见过的大多数情况。

我不知道你正在使用什么存储,但是如果在multipathd启动之后存储/ HBA模块被加载,那么这可能也是一个问题。