Linux SCSI扫描磁盘重新发现大小:

# for i in `find /sys/class/scsi_host/host*`; do echo 1 >> $i/issue_lip; echo "- - -" >> $i/scan; done

1、安装多路径软件包:
device-mapper-1.02.67-2.el5
device-mapper-event-1.02.67.2.el5
device-mapper-multipath-0.4.7-48.el5

[root@RKDB01 Server]# rpm -ivh device-mapper-1.02.67-2.el5.x86_64.rpm
warning: device-mapper-1.02.67-2.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
package device-mapper-1.02.67-2.el5.x86_64 is already installed
[root@RKDB01 Server]# rpm -ivh device-mapper-event-1.02.67-2.el5.x86_64.rpm
warning: device-mapper-event-1.02.67-2.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
package device-mapper-event-1.02.67-2.el5.x86_64 is already installed
[root@RKDB01 Server]# rpm -ivh device-mapper-multipath-0.4.7-48.el5.x86_64.rpm
warning: device-mapper-multipath-0.4.7-48.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
package device-mapper-multipath-0.4.7-48.el5.x86_64 is already installed

2、设置开机启动,并检查安装包是否正常:
# chkconfig --level 345 multipathd on
# lsmod |grep dm_multipath

[root@RKDB01 Server]# chkconfig --level 345 multipathd on
[root@RKDB01 Server]# lsmod |grep dm_multipath
dm_multipath 58969 0
scsi_dh 42561 1 dm_multipath
dm_mod 102417 4 dm_mirror,dm_multipath,dm_raid45,dm_log

3、配置multipathd 使其正常工作,编辑/etc/multipath.conf,开放如下内容:

defaults {
  udev_dir /dev
  polling_interval 10
  selector "round-robin 0"
  path_grouping_policy multibus
  getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
  prio_callout none
  path_checker readsector0
  rr_min_io 100
  max_fds 8192
  rr_weight priorities
  failback immediate
  no_path_retry fail
  user_friendly_names yes
}
blacklist {
  wwid 26353900f02796769
  devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
  devnode "^hd[a-z]"
}

4、并关闭如下内容

#blacklist {
#    devnode "*"
#}
#defaults {
27 #    user_friendly_names yes
28 #}

5、完成之后执行如下命令发现多路径:

[root@RKDB01 Server]# modprobe dm-multipath
[root@RKDB01 Server]# multipath -F
[root@RKDB01 Server]# multipath dm-multipath
[root@RKDB01 Server]# multipath dm-round-robin
[root@RKDB01 Server]# service multipathd restart
正在关闭multipathd 端口监控程序: [确定]
正在启动守护进程multipathd: [确定]

[root@RKDB01 Server]# multipath -v2
[root@RKDB01 Server]# multipath -v2
[root@RKDB01 Server]# multipath -ll
mpath1 (3600d02310000011b16a5d57c6a1bd99a) dm-0 TOYOU,NetStor_iSUM510
[size=3.3T][features=0][hwhandler=0][rw]
\_ round-robin 0 [prio=2][ena bled]
\_ 1:0:0:0 sdb 8:16 [failed][ready]
\_ 1:0:1:0 sdc 8:32 [failed][ready]

6、重启服务器后,我们可以看到多路径信息了:

[root@RKDB01 ~]# ll /dev/mapper/
总计 0
crw------- 1 root root 10, 60 11-05 22:35 control
brw-rw---- 1 root disk 253, 0 11-05 22:35 mpath1
brw-rw---- 1 root disk 253, 1 11-05 22:35 mpath2

[root@RKDB01 ~]# multipath -ll
mpath2 (3600d02310000011b76128b9c63138cf4) dm-1 TOYOU,NetStor_iSUM510
[size=3.2T][features=0][hwhandler=0][rw]
\_ round-robin 0 [prio=2][active]
\_ 1:0:0:1 sdc 8:32 [active][ready]
\_ 1:0:1:1 sde 8:64 [active][ready]
mpath1 (3600d02310000011b16a5d57c6a1bd99a) dm-0 TOYOU,NetStor_iSUM510
[size=20G][features=0][hwhandler=0][rw]
\_ round-robin 0 [prio=2][active]
\_ 1:0:0:0 sdb 8:16 [active][ready]
\_ 1:0:1:0 sdd 8:48 [active][ready]

7、通过fdisk 看可以生成了DM-0/DM-1两个盘,正是上面sdc/sde,sdb/sdd多路径后出来的:

[root@RKDB01 ~]# 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 38 305203+ 83 Linux
/dev/sda2 39 13092 104856255 83 Linux
/dev/sda3 13093 19619 52428127+ 83 Linux
/dev/sda4 19620 36404 134825512+ 5 Extended
/dev/sda5 19620 26146 52428096 83 Linux
/dev/sda6 26147 28757 20972826 83 Linux
/dev/sda7 28758 30324 12586896 82 Linux swap / Solaris
/dev/sda8 30325 36404 48837568+ 83 Linux
Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
Disk /dev/sdc: 3568.4 GB, 3568429957120 bytes
255 heads, 63 sectors/track, 433836 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdc doesn't contain a valid partition table
Disk /dev/sdd: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdd doesn't contain a valid partition table
Disk /dev/sde: 3568.4 GB, 3568429957120 bytes
255 heads, 63 sectors/track, 433836 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sde doesn't contain a valid partition table
Disk /dev/dm-0: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-0 doesn't contain a valid partition table
Disk /dev/dm-1: 3568.4 GB, 3568429957120 bytes
255 heads, 63 sectors/track, 433836 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-1 doesn't contain a valid partition table
Disk /dev/sdf: 4009 MB, 4009754624 bytes
255 heads, 63 sectors/track, 487 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdf4 * 1 488 3915744+ b W95 FAT32
Partition 4 has different physical/logical endings:
phys=(486, 254, 63) logical=(487, 125, 22)

8、我们同时也可以在/dev/mapper目录中查看到多路径映射的信息:

[root@RKDB01 ~]# ll /dev/mapper/
总计 0
crw------- 1 root root 10, 60 11-06 00:49 control
brw-rw---- 1 root disk 253, 2 11-06 00:49 data-data001
brw-rw---- 1 root disk 253, 0 11-06 00:49 mpath1
brw-rw---- 1 root disk 253, 1 11-06 00:49 mpath2

9、参考:

Red_Hat_Enterprise_Linux-5-DM_Multipath-en-US.pdf

Red_Hat_Enterprise_Linux-5-DM_Multipath-zh-CN.pdf

Red_Hat_Enterprise_Linux-6-DM_Multipath-en-US.pdf

Red_Hat_Enterprise_Linux-6-DM_Multipath-zh-CN.pdf

Linux 下配置多路径及SCSI扫描磁盘重新发现大小的更多相关文章

  1. Linux下multipath多路径配置

    一.什么是多路径 普通的电脑主机都是一个硬盘挂接到一个总线上,这里是一对一的关系.而到了有光纤组成的SAN环境,或者由iSCSI组成的IPSAN环境,由于主机和存 储通过了光纤交换机或者多块网卡及IP ...

  2. Linux下配置Tomcat服务器

    Linux下配置Tomcat服务器和Windows下其实差不多,可以去官网下载安装包释放或者在线下载,只是当时下载的windows.zip文件,现在下载.tar.gz格式的即可,下面使用命令行的方式安 ...

  3. Linux下配置JDK

    下面以CentOS为例,详细说一下Linux下配置JDK的过程 首先按照约定俗成的习惯,将jdk放在/usr/local/java下,首先进入/usr/local然后新建一个目录java 然后我们需要 ...

  4. Linux下配置Node环境变量及问题详解

    这是之前在Linux下配置Node环境变量时踩过的坑,今天又有小伙伴询问这个问题,因此记录下来,不仅是给新童鞋们一些参考,也方便日后查阅 在这之前,相信都已经安装好了,没安装的可以查看博主另一篇文章 ...

  5. Linux下配置多个tomcat多个域名

    Linux下配置多个tomcat多个域名复制tomcat:mkdir /home/server/testcp -rf /home/server/shichuan/* /home/server/test ...

  6. Linux下配置两个或多个Tomcat启动

    Linux下配置两个或多个Tomcat启动 (2012-08-14 11:59:31) 转载▼ 标签: 杂谈 分类: linux_tomcat 步骤如下: (1)修改/etc/profile文件.添加 ...

  7. linux下添加动态链接库路径、动态库加载等方法

    linux下添加动态链接库路径的方法 2017年01月20日 10:08:17 阅读数:5596   Linux共享库路径配置 Linux下找不到共享库文件的典型现象为明明已经安装某个软包(如libn ...

  8. Linux下配置一个VNC服务器

    在Linux下配置一个VNC服务器,并设置2个用户,要求其中一个用户登录时不需要输入密码. 然后在客户端使用ssh+vncview的方式访问. 1确认vnc安装 2配置vncserver 3测试vnc ...

  9. linux下配置mysql默认编码utf8

    linux下配置mysql默认编码utf8 下面是需要在对应地方加入的配置 [client] default-character-set=utf8 [mysqld] character-set-ser ...

随机推荐

  1. nacos集群配置

    一.    环境准备 Nacos 依赖 java环境来运行.如果您是从代码开始构建并运行Nacos,还需要为此配置 Maven环境,请确保是在以下版本环境中安装使用: 64 bit OS,支持 Lin ...

  2. 6(计算机网络) 交换机与VLAN

    拓扑结构是怎么形成的? 我们常见到的办公室大多是一排排的桌子,每个桌子都有网口,一排十几个座位就有十几个网口,一个楼层就会有几十个甚至上百个网口.如果算上所有楼层,这个场景自然比你宿舍里的复杂多了.具 ...

  3. 劫后余生--New Start

    被搁置的计划 It was the best of times,it was the worst of times,it was the age of wisidom,it was the age o ...

  4. SVN提交失败:Changing file 'XXX' is forbidden by the server;Access to 'XXX' forbidden

    解决方案:https://blog.csdn.net/m0_38084243/article/details/81503638 个人分析主要是后者,在SVN服务器上添加上我对本项目的读写权限即可: 添 ...

  5. NSNotFound

    1.在数组或者字典中查找元素时,没有查到系统用NSNotFound表示.比如下面例子,应该养成这种编程习惯,可以减少因为’超标’而闪退的情况. if ([self.departmentNameArra ...

  6. 【快学springboot】3.多种接受参数的方式

    前往掘金查看:https://juejin.im/post/5d05e5f9f265da1b6c5f74b4 前言 在开发中,我们常常会碰到多种传参的方式.这里,我们就来总结下,springboot中 ...

  7. JS实现复制信息到剪贴板

    copy 当用户通过浏览器UI启动复制操作并响应允许的document.execCommand('copy')调用时触发copy事件. copy事件可作用于任何可被选中或可编辑的元素,如body.di ...

  8. 吴裕雄--天生自然HADOOP操作实验学习笔记:Wor的Count程序的编写

    实验目的 理解mapreduce的工作原理 理解Partitioner的书写方法 理解GroupingComparator的书写方法 实验原理 我们已经学习了hadoop的大部分基础知识,剩下的就是利 ...

  9. 视图家族 & 路由组件

    目录 视图家族 & 路由组件 视图集与路由组件 基于 GenericAPIView 的十大接口 基于 generics 包下工具视图类的六大基础接口 视图集 路由组件:必须配合视图集使用 自定 ...

  10. Django:使用django自带的登录模块登录后会默认登录到 /accounts/profile 下的问题

    django settings中LOGIN_REDIRECT_URL默认重定向到/accounts/profile下,可通过配置修改