LUN scan and resize operations with multipath on Ubuntu 12.04

Here are some quick tips to discover newly attached LUNs or to rescan resized LUNs:

Scan to discover a newly attached LUN:

  1. for i in `ls /sys/class/fc_host`; do echo 1 > /sys/class/fc_host/${i}/issue_lip; done

Rescan resized LUN:

  1. Find the path of your LUN:
    multipath -l
  2. Execute following command to rescan your drives. Replace “dm-42” by the path you previously found:
    for i in `ls /sys/block/dm-42/slaves/`; do echo 1 > /sys/block/${i}/device/rescan ; done
  3. Resize multipath device. Replace “dm-42” by the path you previously found:
    multipathd -k'resize map dm-42'
  4. Resize the filesystem according to your needs.

Leave a Reply

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