This is an old revision of the document!


use lun storage

  1. scan luns
    1. look for fc hosts
      ls /sys/class/fc_host

      e.g. you get two: host0 host1

    2. install rescan script
      yum install sg3_utils
    3. to rescan luns
      rescan-scsi-bus.sh

      or

      echo "1" > /sys/class/fc_host/host0/issue_lip
      echo "- - -" > /sys/class/scsi_host/host0/scan

      for all hosts

  2. multipath(d)
    1. alias in multipath.conf
      multipaths {
          multipath {
              wwid 360000970000296800677533030303638
              alias fsilun
          }
      }
    2. show
      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
  1. reload multipathd
    service multipathd reload
  2. multipathd on startup
    chkconfig multipathd on
  3. device mapper
    1. create block device in /dev/mapper with fsilun as name
    2. wipe to create new fresh physical volume
      d if=/dev/zero of=dev/mapper/fsilun bs=512 count=1
  4. lvm
    1. create physical volume
      pvcreate /dev/mapper/fsilun
      • show pyhsical volume
        pvdisplay
    2. create volume group
      gcreate fsilun /dev/mapper/fsilun
      • show volume group
        vgdisplay
    3. create logical volume (-L <size in PE see above)
      lvcreate -L 256000 -n lvfsilun fsilun
      • show logical volume
        lvdisplay
  5. filesystem
    1. create ext4 filesystem
      mkfs.ext4 /dev/fsilun/lvfsilun
  6. mount
    1. create mount dir
      mkdir /mnt/fsilun
    2. mount
      mount -t ext4 /dev/fsilun/lvfsilun /mnt/fsilun/