Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Hope i am not wasting anyone´s time, so apologies to all should that be the case with this question.

it is the first time i am playing with multipath, manged to setup multipath on a RHL5, the setup comprises of the following:

RHL5 Server has 2 x HBA - HBA1 Port1 connects to Fiber Switch 1 & HBA2 port1 connects to fiber switch 2

NETAPP FAS2040 Storage with one HBA with 2 ports, port 1 connects to Fiber Switch 1 & port 2 connects to Fiber Switch 2.

multipath -ll command show the following:

[root@nonameserver /]# multipath -ll
mpath0 (360a98000323766586b24422f6735626c) dm-2 NETAPP,LUN
[size=149G][features=1 queue_if_no_path][hwhandler=0]
\_ round-robin 0 [prio=2][active]
 \_ 4:0:0:0 sda 8:0   [active][ready]
 \_ 2:0:0:0 sdb 8:16  [active][ready]

My question is why is there two devices /dev/sda & /dev/sdb? on the storage there is only one LUN setup for the host.

Thank you all.

share|improve this question
    
Hi, browsing the site i found a similar question in here serverfault.com/questions/532644/… but i would like to have more opinions. thanks. –  Vlad Oct 11 '13 at 14:54

2 Answers 2

up vote 3 down vote accepted

The /dev/sda device is the target LUN as seen through one HBA, the /dev/sdb device is the same LUN seen through the other HBA. That's how it works - different controllers means different devices. As the other answer you commented about notes, do not use sda or sdb - use the multipath device (/dev/mpath0).

share|improve this answer
    
Hi John, does it mean then that by using the /dev/mpath0 device it would fail over to either /dev/sda or dev/sdb depending on its availability? –  Vlad Oct 11 '13 at 15:39
    
In simple terms and at a high level, yes, that is what multipathing does. –  John Oct 11 '13 at 16:23

I hope I understand your question. This is how I do it:

$ iscsiadm --mode discovery --type sendtargets --portal <IP:PORT>

$ iscsiadm -m node -l (login to all)

multipath -ll -v2 (This will show all devices currently connected)

ls -la /dev/s* (e.g. Look for the iscsi device with latest date and time)

scsi_id -g -u -s /block/sxxxx (e.g. Replace sxxx with the block name)

vim /etc/multipath.conf

multipath {

             wwid      <put the output of scsi_cmd here>
             alias     <your-alias>
             path_selector "round-robin 0"
             path_grouping_policy multibus
             rr_weight  uniform
             no_path_retry 5
             rr_min_io   100
}

service multipath restart

multipath -ll -v2 (alias listed now)

udevcontrol reload_rules

(Now edit your fstab and add /dev/mapper/<alias>p1 /mntpoint ext3 _netdev 0 0

mkdir /mntpoint

parted /dev/mapper/<alias>

parted> mklabel gpt

parted> print

parted> name 1 alias

parted> print

parted> quit

ls /dev/mapper

mkfs.ext3 -m 0 -F /dev/mapper/<alias>p1

tune2fs -c 0 -i 0 /dev/mapper/<alias>p1

e2label /dev/mapper/<alias>p1 mntdir

mount -a

Optional: Add to NFS Server

vim /etc/exports

(add mnt dir to exports if you want to share it on NFS)

share|improve this answer
    
why make partition on dm multipaths? a lun is storage logical partition and you did other partion on the server side, i think do that is waste your time –  c4f4t0r Jun 7 at 10:22
    
@c4f4t0r: this is how it is recommended in the multipath manual –  Brian Jun 7 at 13:31
    
@If you have a redhat network account and you ask to the author of the manual, nobody can't tell you why partitioning a lun is required –  c4f4t0r Jun 7 at 13:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.