Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:cmd:fclun [2016/02/19 16:23] jslinux:cmd:fclun [2022/07/29 13:05] (current) – [multipath] js
Line 1: Line 1:
 ====== use lun storage ====== ====== use lun storage ======
  
-  - scan luns +=== multipathd === 
-    - look for fc hosts<code bash>ls /sys/class/fc_host</code> e.g. you get two: host0  host1 +     first install multipathd <code bash>yum install device-mapper-multipath</code> 
-    - install rescan script <code bash>yum install sg3_utils</code> +     copy multipath.conf in /etc or use multipath -t >/etc/multipath.conf 
-    to rescan luns <code bash>rescan-scsi-bus.sh</code>or <code bash>echo "1" > /sys/class/fc_host/host0/issue_lip +     restart multipathd <code bash>service multipathd restart</code>
-echo "- -" /sys/class/scsi_host/host0/scan</code> for all hosts +
-  - multipath(d)+
      - alias in multipath.conf <code>multipaths {      - alias in multipath.conf <code>multipaths {
     multipath {     multipath {
         wwid 360000970000296800677533030303638         wwid 360000970000296800677533030303638
         alias fsilun         alias fsilun
-    }</code>+    
 +}</code> 
 +     - reload multipathd <code bash>service multipathd reload</code>  
 +     - multipathd on startup <code bash>chkconfig multipathd on</code> 
 + 
 +=== scan luns === 
 +    - look for fc hosts<code bash>ls /sys/class/fc_host</code> e.g. you get two: host0  host1 
 +    - install rescan script <code bash>yum install sg3_utils</code> 
 +    - to rescan luns <code bash>rescan-scsi-bus.sh</code>or <code bash>echo "1" > /sys/class/fc_host/host0/issue_lip 
 +echo "- - -" > /sys/class/scsi_host/host0/scan</code> for all hosts you find (hba controller) 
 + 
 +=== multipath ===
     - show <code bash>multipath -ll</code> e.g. you get following output <code>fsilun (360000970000296800677533030303638) dm-1 EMC,SYMMETRIX     - show <code bash>multipath -ll</code> e.g. you get following output <code>fsilun (360000970000296800677533030303638) dm-1 EMC,SYMMETRIX
 size=1000G features='1 queue_if_no_path' hwhandler='0' wp=rw size=1000G features='1 queue_if_no_path' hwhandler='0' wp=rw
Line 19: Line 28:
   |- 1:0:0:1 sdc 8:32 active ready running   |- 1:0:0:1 sdc 8:32 active ready running
   `- 2:0:0:1 sde 8:64 active ready running</code>   `- 2:0:0:1 sde 8:64 active ready running</code>
-}</code> +   
-     reload multipathd <code bash>service multipathd reload</code>  +<WRAP center round box 90%> 
-   device mapper +Example: 
-     - create block device in /dev/mapper with fsilun as name +   
-     +A server node with 2 * fibre channel HBAs attached to a storage controller with 2 ports sees 4 devices:  
 +/dev/sda, /dev/sdb, dev/sdc, and /dev/sdd. 
 +  
 +Device Mapper (DM) Multipath creates a single device with a unique World Wide Identifier (WWID) that reroutes I/O to those four underlying devices according to the multipath configuration. 
 + 
 +</WRAP> 
 + 
 + 
 +=== device mapper === 
 +      - create block device in /dev/mapper with fsilun as name 
 +      - wipe to create new fresh physical volume <code bash>dd if=/dev/zero of=/dev/mapper/fsilun bs=512 count=1</code> 
 +=== lvm === 
 +      create physical volume <code bash>pvcreate /dev/mapper/fsilun</code> <code>File descriptor 7 (pipe:[13154434]) leaked on pvcreate invocation. Parent PID 3865: bash 
 +  Physical volume "/dev/mapper/fsilun" successfully created</code> 
 +         * show pyhsical volume <code bash>pvdisplay</code> 
 +      wipe sector, so the lun is clean <code bash>dd if=/dev/zero of=/dev/mapper/fsilun bs=512 count=1</code><code>1+0 records in 
 +1+0 records out 
 +512 bytes (512 B) copied, 0.000873947 s, 586 kB/s</code> 
 +      - create volume group <code bash>vgcreate fsilun /dev/mapper/fsilun</code><code>File descriptor 7 (pipe:[13154434]) leaked on pvcreate invocation. Parent PID 3865: bash 
 +  Physical volume "/dev/mapper/fsilun" successfully created</code> 
 +         * show volume group <code bash>vgdisplay</code> 
 +      create logical volume (-L <size in PE see above) <code bash>lvcreate -L 256000 -n lvfsilun fsilun</code><code>File descriptor 7 (pipe:[13154434]) leaked on lvcreate invocation. Parent PID 3865: bash 
 +  Logical volume "lvfsilun" created.</code> 
 +         * show logical volume <code bash>lvdisplay</code> 
 +=== format filesystem === 
 +      - create ext4 filesystem <code bash>mkfs.ext4 /dev/fsilun/lvfsilun</code><code>mke2fs 1.41.12 (17-May-2010) 
 +Discarding device blocks: done 
 +Filesystem label= 
 +OS type: Linux 
 +Block size=4096 (log=2) 
 +Fragment size=4096 (log=2) 
 +Stride=0 blocks, Stripe width=0 blocks 
 +16384000 inodes, 65536000 blocks 
 +3276800 blocks (5.00%) reserved for the super user 
 +First data block=0 
 +Maximum filesystem blocks=4294967296 
 +2000 block groups 
 +32768 blocks per group, 32768 fragments per group 
 +8192 inodes per group 
 +Superblock backups stored on blocks: 
 +        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
 +        4096000, 7962624, 11239424, 20480000, 23887872 
 +Writing inode tables: done 
 +Creating journal (32768 blocks): done 
 +Writing superblocks and filesystem accounting information: done 
 +This filesystem will be automatically checked every 34 mounts or 
 +180 days, whichever comes first.  Use tune2fs -c or -i to override.</code> 
 +=== mount === 
 +      - create mount dir <code bash>mkdir /mnt/fsilun</code> 
 +      - mount <code bash>mount -t ext4 /dev/fsilun/lvfsilun /mnt/fsilun/</code>