Categories
Linux/Unix Storage

Device Mapper Multipath Configuration

1. Setup Steps

1.1 install and load device mapper (not necessary in RHEL58)

a) install Device Mapper Multipath/DMMP

yum install device-mapper device-mapper-multipath

b) load and check device mapper and multipath modules

modprobe dm-multipath
modprobe dm-round-robin
lsmod | grep md

c) start the multipathd service

Categories
Hardware Storage

bit, nybble, byte, WORD, DWORD, QWORD

It depends on the computer architecture.

For 32bit,

bit = …1 bit…

nybble = 4 bits = 1/2 byte

byte = 8 bits = 2 nybbles

WORD = 2 bytes = 4 nybbles = 16 bits

DWORD = 2 WORDs = 4 bytes = 8 nybbles = 32 bits

QWORD = 2 DWORDs = 4 WORDs = ….. = 64 bits

 

On 64bit system, it will be double.

Categories
Software Storage

Compile pciutils (lspci, setpci) in Windows x86,在 Windows x86 平台下编译 pciutils (lspci, setpci)

pciutils 是 Linux 下查看 PCI/PCIe 设备的利器。可以用来 dump PCI configuration space,可惜在 Windows 平台下类似功能的工具寥寥无几。在 pcituils 的官网(http://mj.ucw.cz/pciutils.html)说明中提到了可以在 Windows 平台下工作。那下面来介绍 Windows 下编译 pciutils 的经验。遗憾的是在 x86_64/amd64 下没有成功,如果各位有成功的经验希望留言来描述下,谢谢。

  1. 下载 pciutils source code。在 ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci/ 可以下载到最新的版本。
  2. 然后需要找到编译环境,这里推荐使用 mingw 来编译。mingw 也有许多版本,我是用的是 mplayer 项目的压缩包。(http://nchc.dl.sourceforge.net/project/mplayer-win32/MinGW/MinGW%20BE%20gcc%204.2.5/MinGW-full-gcc-4.2.5-Dec-2010.7z
  3. 再者由于 pciutils 原生是在 Linux 下运用的,在 Windows 下需要提供能够访问 kernel space 的接口,pciutils 使用了 WinIO 来实现这个。所以还要去下载 WinIO,地址在这里 http://www.internals.com/utilities/WinIo.zip
  4. 好了解压好三个包后,运行 mingw 下的 msys.bat。看到的命令行就是操作的环境。其中已经包含了所要使用的 gcc 编译器。需要提的是,由于 pciutils 中的 configure 在 Windows 是没办法使用的。所以要使用预先编制好的 config.h 和 config.mk。这两个文件存放在 pciutils 目录的 win32目录中。将他们拷贝到 lib 目录下。
  5. 然后修改 lib/i386-io-windows.h 文件,找到 lib = LoadLibrary("WinIo.dll");(3.17版本中在第39行),将 WinIo.dll 替换成 WinIo32.dll(当然 64 位系统应该替换成 WinIo64.dll)。保存下。将 WinIo 压缩包中 Binaries 目录下的 WinIo 相对应的 dll 和 sys 文件拷贝到 pciutils 的更目录下。
  6. 接下来就开始正式编译工作了。非常简单,进入到 pciutils 的根目录下,打入 make 稍等片刻,lspci 和 setpci 就生成好了。

Windows 下的 lspci 和 setpci 的使用方法完全和 Linux 中一摸一样。使用 -t 查看 tree view,使用 -xxx 来 dump configuration space, 使用 -vvv 查看具体功能描述,这些都不再赘述。呵呵。

 

pciutils-3.1.7-x86 下载:Download

Categories
Storage

How to issue SMART command

smartmontools 5.40-1:
For Windows: http://sourceforge.net/projects/smartmontools/files/smartmontools/5.40/smartmontools-5.40-1.win32-setup.exe/download
For Linux: http://sourceforge.net/projects/smartmontools/files/smartmontools/5.40/smartmontools-5.40.tar.gz/download

Table 60 — SMART Feature field values
00h-CFh Reserved  
D0h SMART READ DATA smartctl /dev/sda –a
D1h Obsolete  
D2h SMART ENABLE/DISABLE ATTRIBUTE AUTOSAVE smartctl /dev/sda –S on
D3h Obsolete  
D4h SMART EXECUTE OFF-LINE IMMEDIATE smartctl /dev/sda –t short
D5h SMART READ LOG smartctl /dev/sda –a
D6h SMART WRITE LOG smartctl /dev/sda -t select,10-20
D7h Obsolete  
D8h SMART ENABLE OPERATIONS smartctl /dev/sda -s on
D9h SMART DISABLE OPERATIONS smartctl /dev/sda –s off
DAh SMART RETURN STATUS smartctl /dev/sda -a
DBh Obsolete  
DCh-DFh Reserved  
E0h-FFh vendor specific  
Categories
Storage

MPIO (Multi-Path I/O) 多路径数据传输,冗余链路

MPIO (Multi-Path I/O)  多路径数据传输,是在企业级存储系统中非常常见一种错误挽救的系统配置。优势在于可以在某条传输路径出现故障时,无间断的由另一条路径连接至存储介质继续数据传输。这些都需要软硬件上的支持,需要 2 套或者 2 套以上的硬件系统设备,以及额外的软件解决方案支撑。

最简单的例子是将一颗 SCSI 硬盘连接至同一系统上的 2 块独立 SCSI 控制器上。

对于 SAS 设备,每个设备都有唯一的 2 个 SAS Address (WWN,World Wide Name),一般情况下是连续的 2 组 ID。对应于 2 组 SAS PHY,可以用于配置为 MPIO 冗余链路。在没有安装 MPIO 驱动或者软件的情况下,系统会将一个 SAS 设备侦测为 2 个独立的设备。只有正确配置 MPIO 后,才能发挥 MPIO 的作用。如下图。


SAS 硬盘

MPIO 驱动或者软件能够通过多条路径提供性能上的增强:

  1. 动态负载平衡
  2. 流量控制
  3. 路径管理
  4. 动态重配置

现在主流的系统和厂商都已提供了 MPIO 的支持,如 Windows 2008 的 Microsoft Multi-Path I/O,LSI MegaRAID,可以参考:http://en.wikipedia.org/wiki/Multipath_I/O