yum install device-mapper-multipath
service multipathd restart
multipaths { multipath { wwid 360000970000296800677533030303638 alias fsilun } }
service multipathd reload
chkconfig multipathd on
ls /sys/class/fc_host
e.g. you get two: host0 host1
yum install sg3_utils
rescan-scsi-bus.sh
or
echo "1" > /sys/class/fc_host/host0/issue_lip echo "- - -" > /sys/class/scsi_host/host0/scan
for all hosts you find (hba controller)
multipath -ll
e.g. you get following output
fsilun (360000970000296800677533030303638) dm-1 EMC,SYMMETRIX size=1000G features='1 queue_if_no_path' hwhandler='0' wp=rw `-+- policy='round-robin 0' prio=1 status=active |- 1:0:1:1 sdd 8:48 active ready running |- 2:0:1:1 sdf 8:80 active ready running |- 1:0:0:1 sdc 8:32 active ready running `- 2:0:0:1 sde 8:64 active ready running
Example:
A server node with 2 * fibre channel HBAs attached to a storage controller with 2 ports sees 4 devices: /dev/sda, /dev/sdb, dev/sdc, and /dev/sdd.
Device Mapper (DM) Multipath creates a single device with a unique World Wide Identifier (WWID) that reroutes I/O to those four underlying devices according to the multipath configuration.
dd if=/dev/zero of=/dev/mapper/fsilun bs=512 count=1
pvcreate /dev/mapper/fsilun
File descriptor 7 (pipe:[13154434]) leaked on pvcreate invocation. Parent PID 3865: bash Physical volume "/dev/mapper/fsilun" successfully created
pvdisplay
dd if=/dev/zero of=/dev/mapper/fsilun bs=512 count=1
1+0 records in 1+0 records out 512 bytes (512 B) copied, 0.000873947 s, 586 kB/s
vgcreate fsilun /dev/mapper/fsilun
File descriptor 7 (pipe:[13154434]) leaked on pvcreate invocation. Parent PID 3865: bash Physical volume "/dev/mapper/fsilun" successfully created
vgdisplay
lvcreate -L 256000 -n lvfsilun fsilun
File descriptor 7 (pipe:[13154434]) leaked on lvcreate invocation. Parent PID 3865: bash Logical volume "lvfsilun" created.
lvdisplay
mkfs.ext4 /dev/fsilun/lvfsilun
mke2fs 1.41.12 (17-May-2010) Discarding device blocks: done Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 16384000 inodes, 65536000 blocks 3276800 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 2000 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 34 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
mkdir /mnt/fsilun
mount -t ext4 /dev/fsilun/lvfsilun /mnt/fsilun/