Adding SAN volumes to storage

Jurjen Bokma

August


We had a single SAN volume for storage, soon we will need three or more. We also had a single Host Bus Adapter, but we need multipath. So we read the LVM-HOWTO and some Blog on SCSI, and we go ahead...

Procedure 21.  Detecting the volumes
  1. admin@server:~$ ls /sys/class/fc_host/
    host5  host6

  2. (Maybe not really needed)

    admin@server:~$ sudo apt-get install scsitools

  3. In /etc/multipath.conf:

    defaults {
    polling_interval    30
    failback            immediate
    no_path_retry       5
    rr_min_io           100
    path_checker        tur
    user_friendly_names yes
    }
    
    multipaths {
    multipath {
        wwid 3600<snip>000
        alias HP-EVA-LWP1
    }
    multipath {
        wwid 3600<snip>000
        alias HP-EVA-LWP2
    }
    multipath {
        wwid 3600<snip>000
        alias HP-EVA-LWP3
    }
    multipath {
        wwid 3600<snip>000
        alias HP-EVA-LWP4
    }
    }
    	

  4. admin@server:~$ ls /sys/class/fc_host/
    host5  host6
    admin@server:~$ sudo sh -c "echo 1 >/sys/class/fc_host/host6/issue_lip"
    admin@server:~$ sudo sh -c "echo - - - >/sys/class/scsi_host/host6/scan"
    admin@server:~$ sudo sh -c "echo 1 >/sys/class/fc_host/host5/issue_lip"
    admin@server:~$ sudo sh -c "echo - - - >/sys/class/scsi_host/host5/scan"
    admin@server:~$ find /dev/disk/by-id/
    /dev/disk/by-id/
    /dev/disk/by-id/scsi-3600<snip>000
    /dev/disk/by-id/scsi-3600<snip>000
    /dev/disk/by-id/scsi-3600<snip>000
    /dev/disk/by-id/scsi-HP-EVA-LWP4
    /dev/disk/by-id/dm-uuid-mpath-3600<snip>000
    /dev/disk/by-id/dm-name-HP-EVA-LWP4
    /dev/disk/by-id/scsi-HP-EVA-LWP3
    /dev/disk/by-id/dm-uuid-mpath-3600<snip>000
    /dev/disk/by-id/dm-name-HP-EVA-LWP3
    /dev/disk/by-id/scsi-HP-EVA-LWP2
    /dev/disk/by-id/dm-uuid-mpath-3600<snip>000
    /dev/disk/by-id/dm-name-HP-EVA-LWP2
    /dev/disk/by-id/scsi-3600<snip>000
    <snip>
    /dev/disk/by-id/dm-uuid-mpath-3600<snip>000
    /dev/disk/by-id/dm-name-HP-EVA-LWP1
    /dev/disk/by-id/scsi-3600<snip>901-part1
    /dev/disk/by-id/scsi-3600<snip>901-part2
    /dev/disk/by-id/scsi-3600<snip>901

  5. This gives:

  6. admin@server:~$ sudo pvcreate /dev/disk/by-id/scsi-HP-EVA-LWP2
    Physical volume "/dev/disk/by-id/scsi-HP-EVA-LWP2" successfully created

  7. (Use vgdisplay to figure out which Volume Groups are present

    admin@server:~$ sudo vgextend LwpUserVg /dev/disk/by-id/scsi-HP-EVA-LWP2
    Volume group "LwpUserVg" successfully extended

  8. admin@server:~$ sudo lvextend -l +100%FREE /dev/server/lvsrv
    Extending logical volume lwphomes to 3.50 TB
    Logical volume lwphomes successfully resized

  9. admin@server:~$ sudo xfs_growfs /lwphome/
    meta-data=/dev/mapper/LwpUserVg-lwphomes isize=256    agcount=4, agsize=100663296 blks
    =                       sectsz=512   attr=2
    data     =                       bsize=4096   blocks=402653184, imaxpct=5
    =                       sunit=0      swidth=0 blks
    naming   =version 2              bsize=4096
    log      =internal               bsize=4096   blocks=32768, version=2
    =                       sectsz=512   sunit=0 blks, lazy-count=0
    realtime =none                   extsz=4096   blocks=0, rtextents=0
    data blocks changed from 402653184 to 939524096