Home > Linux, UNIX > Linux Multipathing

Linux Multipathing

Physically connect HBA to disk array.

Create LUN on disk array (50 GB in this case).

Reboot server to see new LUN. Note 2 separate device files with same size. This is normal.

Reboot again and interrupt the boot process and enable BIOS on the HBA card by pressing Control-Q.

Find disk device names (select sdc and sde)

[root@chrysek log]# dmesg | grep sectors
SCSI device sda: 142577664 512-byte hdwr sectors (73000 MB)
SCSI device sda: 142577664 512-byte hdwr sectors (73000 MB)
SCSI device sdb: 1 512-byte hdwr sectors (0 MB)
SCSI device sdb: 1 512-byte hdwr sectors (0 MB)
SCSI device sdc: 104857600 512-byte hdwr sectors (53687 MB)
SCSI device sdc: 104857600 512-byte hdwr sectors (53687 MB)
SCSI device sdd: 1 512-byte hdwr sectors (0 MB)
SCSI device sdd: 1 512-byte hdwr sectors (0 MB)
SCSI device sde: 104857600 512-byte hdwr sectors (53687 MB)
SCSI device sde: 104857600 512-byte hdwr sectors (53687 MB)

Create multipath device:

mdadm -C /dev/md0 –level=multipath –raid-devices=2 /dev/sdc /dev/sde

Get UUID of devices:

[root@chrysek /]# mdadm –examine –scan
ARRAY /dev/md0 level=multipath num-devices=2 UUID=387226f0:a1dc9903:0d0176eb:92dcbe74

[root@chrysek init.d]# vi md-assemble
#!/bin/sh
/sbin/mdadm –assemble –uuid=387226f0:a1dc9903:0d0176eb:92dcbe74 /dev/md0
:wq

[root@chrysek rc5.d]# ls -l S76md-assemble
lrwxrwxrwx 1 root root 21 Jul 17 13:13 S76md-assemble -> ../init.d/md-assemble

[root@chrysek log]# vi /etc/mdadm.conf
DEVICE /dev/sdc
DEVICE /dev/sde
ARRAY /dev/md0 devices=/dev/sdc,/dev/sde
MAILADDR krzys@perfekt.net

[root@chrysek ~]# cat /proc/mdstat
Personalities : [multipath]
md0 : active multipath sdc[0] sde[1]
52428736 blocks [2/2] [UU]

unused devices:

[root@chrysek log]# shutdown -r now

Categories: Linux, UNIX Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.
*
Please leave these two fields as-is:

Protected by Invisible Defender. Showed 403 to 3,211 bad guys.

Powered by WP Robot

Stop SOPAPowered by Yahoo! Answers