Operating System - Linux
1752783 Members
5788 Online
108789 Solutions
New Discussion юеВ

Re: Maintain device mapper aliases (/dev/mapper/oravolNN) ownership accross reboots

 
SOLVED
Go to solution
Alzhy
Honored Contributor

Maintain device mapper aliases (/dev/mapper/oravolNN) ownership accross reboots

We are comparing various Oracle Storage Schemes on our SAN connected Linux Environments. We currently use ASMlib (which is likely Oracle's prefeernce) but we now want to use device mapper aliases as ASM Disk String paths so ASM can use these devices directly under ASM bypassing ASMlib.

How is this done? if UDEV Rules -- can you give an example pelase? We run RHEL 5.4.

For example, our Device Mapper Alias is as follows:

multipath {
wwid 1HITACHI_D60H67000136
alias oravol01
}

And it immediately creates /dev/mapper/oravol01. After a reboot it also creates /dev/mpath/oravol01.

Hakuna Matata.
4 REPLIES 4
Matti_Kurkela
Honored Contributor
Solution

Re: Maintain device mapper aliases (/dev/mapper/oravolNN) ownership accross reboots

You can define the permissions, UID and GID within your device mapper alias. For example, if you want /dev/mapper/oravol01 owned by user 900, group 800 and with permissions brw-------, then your multipath.conf alias definition should be:

multipath {
wwid 1HITACHI_D60H67000136
alias oravol01
uid 900
gid 800
mode 0600
}

Disclaimer: Not tested, that's just how "man multipath.conf" says it should work.

MK
MK
Alzhy
Honored Contributor

Re: Maintain device mapper aliases (/dev/mapper/oravolNN) ownership accross reboots

Hi Mat,

Yeap... just found out. It appears one *must* be at the latest (circa Feb 2010?) release of devoce-mapper-multipath.

Awesome awesome feature (which I think is just a tweak to the built in udev rulez) so the lowly admin need not write custom UDEV rules.
Hakuna Matata.
Tim Nelson
Honored Contributor

Re: Maintain device mapper aliases (/dev/mapper/oravolNN) ownership accross reboots

Cool.. allowing perms in the multipath config is a better bet than /etc/rc.d/rc.local

I always forget to update when I add a disk for ASM..

The multipath option should fix the absent mindedness.

Tim Nelson
Honored Contributor

Re: Maintain device mapper aliases (/dev/mapper/oravolNN) ownership accross reboots

One last note for this thread..

if you partition the device as oracleasm suggests is needed then the uid and gid in the multipath.conf does no good as you now have /dev/mapper/nice-namep1 after running kpartx

back to using /etc/rc.local for asm ownership