Redhat – RHEL 5 How to set mount location of multipath device

mappeddrivemultipathredhat

I have a RHEL5 + 3Par FC SAN storage environment and am unsure how to setup a multipathed FC device to mount to particular location like /data. I have the 3Par Implementation guide for RHEL and it still doesn't make sense to me. I'm following the guide for my storage vendor, but it would be generic for any storage used.

In RHEL 5, what's the proper way to set a dev mapper mount like /dev/mapper/dm-1 to /data?

Below is what they guide has:

#Partitioning Device-mapper Nodes (pg:71)
NOTE: Do not use the fdisk command with /dev/mapper/XXX devices to create partitions

#Provision and export volumns to host

#excute multipath to create mappings (on my system it has /dev/dm-0)
multipath

#list out mappings
multipath -l

#format the top drive in the map
### multipath -l
##50002ac001b40031
##[size=5 GB][features="1 queue_if_no_path"][hwhandler="0"]
##\_ round-robin 0 [active]
##\_ 0:0:0:0 sda 8:0 [active]
##\_ 1:0:0:0 sdb 8:16 [active]

fdisk /dev/sda -- create a partition

################################################
#this part confuses me...
After the fdisk command completes, use the kpartx command to list and create DM devices
for the partitions on the device.
# kpartx /dev/mapper/350002ac001b40031
350002ac001b40031p1 : 0 10477194 /dev/mapper/350002ac001b40031 62
# kpartx -a /dev/mapper/350002ac001b40031 -- will add a partition mapping
# ls /dev/mapper
350002ac001b40031 350002ac001b40031p1
################################################

Best Answer

Since /dev/mapper/dm-N names are dynamically allocated by Linux kernel, you can't rely on those names in /etc/fstab.

You need to ensure which LUN are you mounting to which partition. The best way to do it is to name your partitions. You can do it by adding following section to /etc/multipath.conf:

multipaths {
    multipath {
            wwid    3600a0b800011a2be00001dfa46cf0620
            alias   mydev1
    }
}

You can get your wwids from multipath -ll output. Do not forget to restart multipathd so it will be able to switch paths in case if link/switch/storage controller failure.

You don't necessarily need to create partitions on SAN devices if you plan to use it as whole piece.