Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
################################################
share|improve this question
    
your fstab should refer to the device node created with kpartx, i.e. /dev/mapper/350002ac001b40031p1 –  Dmitri Chubarov Jan 17 '13 at 9:48
add comment

1 Answer 1

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|improve this answer
    
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/ –  Chad Jan 16 '13 at 20:49
1  
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 –  Andrey Brindeyev Jan 16 '13 at 21:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.