Centos 5 多路径配置步骤
1、检查系统中是否已安装multipath:
在CentOS 5中,一般情况下安装系统时multipath已经被安装,查看multipath是否安装如下:
[root@localhost vol]# rpm -qa | grep mapper
device-mapper-multipath-0.4.7-34.el5
device-mapper-1.02.39-1.el5
device-mapper-1.02.39-1.el5
device-mapper-event-1.02.39-1.el5
[root@localhost vol]#
如果没有安装,那么要安装下列rpm包(注意使用对应系统内核的rpm包):
# rpm -ivh device-mapper-1.02.32-1.el5.i386.rpm
# rpm -ivh device-mapper-1.02.32-1.el5.x86_64.rpm
# rpm -ivh device-mapper-event-1.02.32-1.el5.x86_64.rpm
# rpm -ivh device-mapper-multipath-0.4.7-30.el5.x86_64.rpm
2、设置成开机自启动multipathd:
[root@localhost vol]# chkconfig --list | grep multipath
multipathd 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
[root@localhost vol]# chkconfig --level 2345 multipathd on
[root@localhost vol]# chkconfig --list | grep multipathd
multipathd 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
[root@localhost vol]#
3、启动multipathd服务:
[root@localhost vol]# service multipathd status
multipathd 已停
[root@localhost vol]# service multipathd start
正在启动守护进程multipathd:[确定]
[root@localhost vol]# lsmod | grep dm_multipath
dm_multipath 56921 0
scsi_dh 42177 1 dm_multipath
dm_mod 101649 4 dm_mirror,dm_multipath,dm_raid45,dm_log
[root@localhost vol]# service multipathd status
multipathd (pid 9035) 正在运行...
[root@localhost vol]#
4、对multipath进行配置:
multipath的配置文件是/etc/multipath.conf
我们要对/dev/sdb 和 /dev/sdd 设置多路径,使用下面的命令检查:
[root@localhost mpath]# fdisk -l
Disk /dev/sda: 299.4 GB, 299439751168 bytes
255 heads, 63 sectors/track, 36404 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 102400 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 13 6375 51096576 82 Linux swap / Solaris
/dev/sda3 6375 36405 241219584 83 Linux
Disk /dev/sdb: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
Disk /dev/sdc (Sun disk label): 255 heads, 189 sectors, 47507 cylinders
Units = cylinders of 48195 * 512 bytes
Device Flag Start End Blocks Id System
/dev/sdc3 u 0 47507 1144799932+ 5 Whole disk
/dev/sdc7 0 47507 1144799932+ 4 SunOS usr
Disk /dev/sdc3 (Sun disk label): 255 heads, 189 sectors, 47507 cylinders
Units = cylinders of 48195 * 512 bytes
Device Flag Start End Blocks Id System
/dev/sdc3p3 u 0 47507 1144799932+ 5 Whole disk
/dev/sdc3p7 0 47507 1144799932+ 4 SunOS usr
Disk /dev/sdc7 (Sun disk label): 255 heads, 189 sectors, 47507 cylinders
Units = cylinders of 48195 * 512 bytes
Device Flag Start End Blocks Id System
/dev/sdc7p3 u 0 47507 1144799932+ 5 Whole disk
/dev/sdc7p7 0 47507 1144799932+ 4 SunOS usr
Disk /dev/sdd: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdd doesn't contain a valid partition table
Disk /dev/sde (Sun disk label): 64 heads, 64 sectors, 8 cylinders
Units = cylinders of 4096 * 512 bytes
Device Flag Start End Blocks Id System
/dev/sde3 u 0 8 16384 5 Whole disk
/dev/sde7 0 8 16384 4 SunOS usr
Disk /dev/sde3 (Sun disk label): 64 heads,
1、检查系统中是否已安装multipath:
在CentOS 5中,一般情况下安装系统时multipath已经被安装,查看multipath是否安装如下:
[root@localhost vol]# rpm -qa | grep mapper
device-mapper-multipath-0.4.7-34.el5
device-mapper-1.02.39-1.el5
device-mapper-1.02.39-1.el5
device-mapper-event-1.02.39-1.el5
[root@localhost vol]#
如果没有安装,那么要安装下列rpm包(注意使用对应系统内核的rpm包):
# rpm -ivh device-mapper-1.02.32-1.el5.i386.rpm
# rpm -ivh device-mapper-1.02.32-1.el5.x86_64.rpm
# rpm -ivh device-mapper-event-1.02.32-1.el5.x86_64.rpm
# rpm -ivh device-mapper-multipath-0.4.7-30.el5.x86_64.rpm
2、设置成开机自启动multipathd:
[root@localhost vol]# chkconfig --list | grep multipath
multipathd 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
[root@localhost vol]# chkconfig --level 2345 multipathd on
[root@localhost vol]# chkconfig --list | grep multipathd
multipathd 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
[root@localhost vol]#
3、启动multipathd服务:
[root@localhost vol]# service multipathd status
multipathd 已停
[root@localhost vol]# service multipathd start
正在启动守护进程multipathd:[确定]
[root@localhost vol]# lsmod | grep dm_multipath
dm_multipath 56921 0
scsi_dh 42177 1 dm_multipath
dm_mod 101649 4 dm_mirror,dm_multipath,dm_raid45,dm_log
[root@localhost vol]# service multipathd status
multipathd (pid 9035) 正在运行...
[root@localhost vol]#
4、对multipath进行配置:
multipath的配置文件是/etc/multipath.conf
我们要对/dev/sdb 和 /dev/sdd 设置多路径,使用下面的命令检查:
[root@localhost mpath]# fdisk -l
Disk /dev/sda: 299.4 GB, 299439751168 bytes
255 heads, 63 sectors/track, 36404 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 102400 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 13 6375 51096576 82 Linux swap / Solaris
/dev/sda3 6375 36405 241219584 83 Linux
Disk /dev/sdb: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
Disk /dev/sdc (Sun disk label): 255 heads, 189 sectors, 47507 cylinders
Units = cylinders of 48195 * 512 bytes
Device Flag Start End Blocks Id System
/dev/sdc3 u 0 47507 1144799932+ 5 Whole disk
/dev/sdc7 0 47507 1144799932+ 4 SunOS usr
Disk /dev/sdc3 (Sun disk label): 255 heads, 189 sectors, 47507 cylinders
Units = cylinders of 48195 * 512 bytes
Device Flag Start End Blocks Id System
/dev/sdc3p3 u 0 47507 1144799932+ 5 Whole disk
/dev/sdc3p7 0 47507 1144799932+ 4 SunOS usr
Disk /dev/sdc7 (Sun disk label): 255 heads, 189 sectors, 47507 cylinders
Units = cylinders of 48195 * 512 bytes
Device Flag Start End Blocks Id System
/dev/sdc7p3 u 0 47507 1144799932+ 5 Whole disk
/dev/sdc7p7 0 47507 1144799932+ 4 SunOS usr
Disk /dev/sdd: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdd doesn't contain a valid partition table
Disk /dev/sde (Sun disk label): 64 heads, 64 sectors, 8 cylinders
Units = cylinders of 4096 * 512 bytes
Device Flag Start End Blocks Id System
/dev/sde3 u 0 8 16384 5 Whole disk
/dev/sde7 0 8 16384 4 SunOS usr
Disk /dev/sde3 (Sun disk label): 64 heads,