RHEL 5 How to set mount location of multipath device?

14,126

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.

Share:
14,126

Related videos on Youtube

Fabrice Kyams
Author by

Fabrice Kyams

Updated on September 18, 2022

Comments

  • Fabrice Kyams
    Fabrice Kyams almost 2 years

    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
    ################################################
    
    • Zachw6
      Zachw6 over 11 years
      your fstab should refer to the device node created with kpartx, i.e. /dev/mapper/350002ac001b40031p1
  • Fabrice Kyams
    Fabrice Kyams over 11 years
    Thanks for the response. I have an existing server that I didn't setup that has /dev/maapper/dm-1 mounted to /data on RHEL5. There isn't any entry in /etc/multipath.conf for this mapping name and no fstab entry (i understand multipdathd devices can't be automounted vi fstab). I don't understand how this is setup. On my oracle RAC/ASM servers I wouldn't care about this, but on application servers we will want to present storage as a standard mount of an existing path ex: present lun to server and mount as /opt/apps/
  • Andrey Brindeyev
    Andrey Brindeyev over 11 years
    it should work out of the box. Your /dev/mapper/dm-1 device name might change on SAN reconfiguration (LUN # change / adding another LUN). Multipath devices are usually discovered and obtain names in initrd so it's safe to mount them from /etc/fstab