How to Mount an iScsi device.

These steps work with Debian Jessie and a Fibrechannel QLogic ISP2432 card.

  • First at all we have to add “non-free” repository to our /etc/apt/sources.list changing this line (or the repository that you use):
  • Then we need to update:
    • apt-get update
  • And install the multpath package:
    • apt-get install multipath-tools
  • Once we have Multipath installed, we need to rescan looking for any device:
    •   for host in $(ls -1d /sys/class/fc_host/*); do echo “1” > ${host}/issue_lip; done
    •   for host in $(ls -1d /sys/class/scsi_host/*); do echo “- – -” > ${host}/scan ; done
  • After that we could check the devices:
    • multipath -ll
  • That command list all the devices detected.
  • To set the storage for autodetect and automont we have to find the ID with:
    • /lib/udev/scsi_id -g -u -d /dev/sdb
  • This is a simple example of the file /etc/multipath.conf that works for this card. You have to put the ID obtained with the last command.
    defaults {
            polling_interval        2
            path_selector           "round-robin 0"
            path_grouping_policy    multibus
            getuid_callout          "/lib/udev/scsi_id -g -u -d /dev/%n"
            rr_min_io               100
            failback                immediate
            no_path_retry           queue
    }
    blacklist {
            wwid sda
    }
    
    blacklist_exceptions {
            wwid "$ID"
    }
    
    multipaths {
      multipath {
            wwid "$ID"
            alias AX350
      }
    }
  • In “blacklist” quote I put “sda” which is the local Disk. If you have more than one disk you have to put all of it.
  • Once we have configured multipath we need to restart the service:
    • service multipath-tools restart
  • Check again for the device:
    • multipath -ll
    • That should show the device with the Alias we set before (in this case “AX350”).
  • We check that the device is listed:
    • ls -l /dev/mapper/AX350

 

And now we could use the device for LVM or just to mount it.

Print Friendly

Pablo Javier Furnari

Linux System Administrator at La Plata Linux
I'm a Linux Sysadmin with 8 years of experience. I work with several clients as a consulter here in Argentina and oversea (I have clients in the United States, Mexico, Pakistan and Germany).

I know my strengths and weaknesses. I'm a quick learner, I know how to work with small and big teams. I'm hard worker, proactive and I achieve everything I propose.

Leave a Reply

Your email address will not be published. Required fields are marked *


CAPTCHA Image
Reload Image