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/23 15:29] jslinux:cmd:fclun [2022/07/29 13:05] (current) – [multipath] js
Line 3: Line 3:
 === multipathd === === multipathd ===
      - first install multipathd <code bash>yum install device-mapper-multipath</code>      - first install multipathd <code bash>yum install device-mapper-multipath</code>
-     - copy multipath.conf in /etc+     - copy multipath.conf in /etc or use multipath -t >/etc/multipath.conf
      - restart multipathd <code bash>service multipathd restart</code>      - restart multipathd <code bash>service multipathd restart</code>
      - alias in multipath.conf <code>multipaths {      - alias in multipath.conf <code>multipaths {
Line 18: Line 18:
     - install rescan script <code bash>yum install sg3_utils</code>     - 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     - 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+echo "- - -" > /sys/class/scsi_host/host0/scan</code> for all hosts you find (hba controller)
  
 === multipath === === multipath ===
Line 28: 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>
 +  
 +<WRAP center round box 90%>
 +Example:
 +  
 +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 === === device mapper ===
       - create block device in /dev/mapper with fsilun as name       - create block device in /dev/mapper with fsilun as name
-      - wipe to create new fresh physical volume <code bash>if=/dev/zero of=dev/mapper/fsilun bs=512 count=1</code>+      - wipe to create new fresh physical volume <code bash>dd if=/dev/zero of=/dev/mapper/fsilun bs=512 count=1</code>
 === lvm === === lvm ===
-      - create physical volume <code bash>pvcreate /dev/mapper/fsilun</code>+      - 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>          * show pyhsical volume <code bash>pvdisplay</code>
-      - create volume group <code bash>gcreate fsilun /dev/mapper/fsilun</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>          * 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>+      - 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>          * show logical volume <code bash>lvdisplay</code>
 === format filesystem === === format filesystem ===
-      - create ext4 filesystem <code bash>mkfs.ext4 /dev/fsilun/lvfsilun</code>+      - 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 === === mount ===
       - create mount dir <code bash>mkdir /mnt/fsilun</code>       - create mount dir <code bash>mkdir /mnt/fsilun</code>
       - mount <code bash>mount -t ext4 /dev/fsilun/lvfsilun /mnt/fsilun/</code>       - mount <code bash>mount -t ext4 /dev/fsilun/lvfsilun /mnt/fsilun/</code>