iscsi Discovery of Targets, repeat as many times as you have paths
iscsiadm -m discovery -t st -p <ip>
Log into the Target, repeat as many times as you have paths
iscsiadm -m node -T <iscsi target> -p <ip>:<port> –login
Check that All nodes now set up correctly
iscsiadm -m node
Check Sessions
iscsiadm -m session
Install multipath tools
aptitude install multipath-tools
Edit /etc/multipath.conf - Remember, this is for HITACHI, you may have to check Vendor
defaults {
user_friendly_names yes
pooling_interval 60
}
devices {
device {
vendor "HITACHI"
product "DF600F"
path_grouping_policy multibus
path_checker tur
no_path_retry 1
}
}
blacklist {
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|sda|sdb|st)[0-9]*"
devnode "^hd[a-z]"
devnode "^sda"
}
Start multipath-tools
/etc/init.d/multipath-tools start
Check multipath is running and has correct stuffings
# /etc/init.d/multipath-tools start Starting multipath daemon: multipathd. # multipath -ll mpath0 (360060e80105eecd00570775d00000001) dm-0 HITACHI,DF600F size=8.0T features='1 queue_if_no_path' hwhandler='0' wp=rw |-+- policy='round-robin 0' prio=1 status=active | `- 5:0:0:0 sdc 8:32 active ready running `-+- policy='round-robin 0' prio=0 status=enabled |- 6:0:0:0 sdd 8:48 active ready running `- 7:0:0:0 sde 8:64 active ready running
If you run into “No entry for device-mapper found*
multipath -ll /proc/misc: No entry for device-mapper found Is device-mapper driver missing from kernel? Failure to communicate with kernel device-mapper driver.
This is due to dm-mod not being loaded, so you run
modprobe dm-mod
And then start multipath-tools
If it has been formatted on another platform, skip this section
Partitioning
NOTE : parted cannot be used with /dev/mapper/[dev_name] devices. Use parted on the underlying disks and execute the following command when device-mapper multipath maps the device to create a /dev/mapper/mpath[n] device for the partition.
# parted /dev/sdc GNU Parted 2.3 Using /dev/sdc Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) mklabel gpt Warning: The existing disk label on /dev/mapper/mpath0 will be destroyed and all data on this disk will be lost. Do you want to continue? Yes/No? y (parted) mkpart Partition name? []? mailstorage File system type? [ext2]? ext4 Start? 0 End? 100% Warning: The resulting partition is not properly aligned for best performance. Ignore/Cancel? Ignore (parted) print Model: Linux device-mapper (multipath) (dm) Disk /dev/sdc: 8796GB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 17,4kB 8796GB 8796GB mailstorage
Now remember this part, regardless
kpartx -a /dev/mapper/mpath0
If you haven't formatted yet
mkfs.ext4 /dev/mapper/mpath0p1
Mount it..
mount /dev/mapper/mpath0p1 <mountpoint>
Add it to /etc/fstab
/dev/mapper/mpath0p1 <mountpoint> ext4 rw 0 0
Update multipath configuration in initramfs
update-initramfs -u
.. you're now good to go..