Skip to contentSkip to conversation

user defined device name and table

DISCUSSION Pedro Bandim Faustino 4 participants 7 messages Nov 26, 2007 – Nov 28, 2007 Device mapper

lore
Share & tools
lore
#0 lore raw

Hi All,

I have a working multipath on root, but some questions still unanswered. I'm hoping you can help me out ;)

My setup details:
Machine: IBM Blade Server HS21 with two Qlogic HBAs each connected to a FC switch with two active ports Storage IBM DS4700 with two controllers
OS: Fedora 7
DM packages:
- device-mapper-1.02.17-7.fc7
- device-mapper-libs-1.02.17-7.fc7
- device-mapper-multipath-0.4.7-11.fc7
uname -r: 2.6.23.1-21.fc7

At the moment this is what I have:

Output of multipath -ll:
mpath0 () dm-0 IBM,1814 FAStT
[size=4.0G][features=0][hwhandler=0]
\_ round-robin 0 [prio=4][active]

\_ 2:0:0:0 sda 8:0   [active][ready]
\_ 2:0:1:0 sdb 8:16  [active][ready]
\_ 3:0:0:0 sdc 8:32  [active][ready]
\_ 3:0:1:0 sdd 8:48  [active][ready]

Output of df -k:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/dm-2 3960348 1772124 1983800 48% /
/dev/dm-1 101086 17593 78274 19% /boot
tmpfs 1037416 0 1037416 0% /dev/shm

Contents of /dev/mapper/:

crw-------  1 root root  10, 63 2007-11-26 13:58 control
brw-rw----  1 root disk 253,  0 2007-11-26 13:58 mpath0
brw-rw----  1 root disk 253,  1 2007-11-26 13:58 mpath0p1
brw-rw----  1 root disk 253,  2 2007-11-26 13:58 mpath0p2

But this is what I really would like to have:

Output of multipath -ll:
SRV07_BOOT (3600a0b8000295d64000009304742b4c8) dm-0 IBM,1814 FAStT
[size=4.0G][features=1 queue_if_no_path][hwhandler=0] \_ round-robin 0 [prio=0][enabled]
\_ 2:0:0:0 sda 8:0 [active][ready]
\_ 3:0:0:0 sdc 8:32 [active][ready]
\_ round-robin 0 [prio=6][active]
\_ 2:0:1:0 sdb 8:16 [active][ready]
\_ 3:0:1:0 sdd 8:48 [active][ready]

I can modify the table by modifying the init script in the initrd image and then booting with the modified initrd image but I don't know how to change the name from mpath0 to SRV07_BOOT.

Any help will be very appreciated!!

Thank you,
Pedro Faustino

#1 lore raw

2007/11/26, Pedro Bandim Faustino <[email protected]>:

Quoted 53 lines

Hi All,

I have a working multipath on root, but some questions still unanswered. I'm hoping you can help me out ;)

My setup details:
Machine: IBM Blade Server HS21 with two Qlogic HBAs each connected to a FC switch with two active ports
Storage IBM DS4700 with two controllers
OS: Fedora 7
DM packages:
- device-mapper-1.02.17-7.fc7
- device-mapper-libs-1.02.17-7.fc7
- device-mapper-multipath-0.4.7-11.fc7
uname -r: 2.6.23.1-21.fc7

At the moment this is what I have:

Output of multipath -ll:
mpath0 () dm-0 IBM,1814 FAStT
[size=4.0G][features=0][hwhandler=0]
\_ round-robin 0 [prio=4][active]

\_ 2:0:0:0 sda 8:0   [active][ready]
\_ 2:0:1:0 sdb 8:16  [active][ready]
\_ 3:0:0:0 sdc 8:32  [active][ready]
\_ 3:0:1:0 sdd 8:48  [active][ready]

Output of df -k:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/dm-2 3960348 1772124 1983800 48% /
/dev/dm-1 101086 17593 78274 19% /boot
tmpfs 1037416 0 1037416 0% /dev/shm

Contents of /dev/mapper/:

crw-------  1 root root  10, 63 2007-11-26 13:58 control
brw-rw----  1 root disk 253,  0 2007-11-26 13:58 mpath0
brw-rw----  1 root disk 253,  1 2007-11-26 13:58 mpath0p1
brw-rw----  1 root disk 253,  2 2007-11-26 13:58 mpath0p2

But this is what I really would like to have:

Output of multipath -ll:
SRV07_BOOT (3600a0b8000295d64000009304742b4c8) dm-0 IBM,1814 FAStT
[size=4.0G][features=1 queue_if_no_path][hwhandler=0] \_ round-robin 0 [prio=0][enabled]
\_ 2:0:0:0 sda 8:0 [active][ready]
\_ 3:0:0:0 sdc 8:32 [active][ready]
\_ round-robin 0 [prio=6][active]
\_ 2:0:1:0 sdb 8:16 [active][ready]
\_ 3:0:1:0 sdd 8:48 [active][ready]

Quoted 3 lines

I can modify the table by modifying the init script in the initrd image and then booting with the modified initrd image but I don't know how to change the name from mpath0 to SRV07_BOOT.

You should be able to change the name by creating a multipaths section like below

multipaths {
    multipath {
        wwid "3600a0b8000295d64000009304742b4c8"
        alias "SRV07_BOOT"
    }
}

If that does not work as expected, you might have to say "no" to the user friendly names option.

Any help will be very appreciated!!

Quoted 10 lines

Thank you,
Pedro Faustino

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

#2 lore raw
Quoted 68 lines · Stefan Bader

2007/11/26, Pedro Bandim Faustino <[email protected] <mailto:[email protected]>>:

    Hi All,

    I have a working multipath on root, but some questions still
    unanswered.
    I'm hoping you can help me out ;)

    My setup details:
    Machine: IBM Blade Server HS21 with two Qlogic HBAs each connected
    to a
    FC switch with two active ports
    Storage IBM DS4700 with two controllers
    OS: Fedora 7
    DM packages:
        - device-mapper-1.02.17-7.fc7
        - device-mapper-libs-1.02.17-7.fc7
        - device-mapper-multipath-0.4.7-11.fc7
    uname -r: 2.6.23.1-21.fc7

    At the moment this is what I have:

    Output of multipath -ll:
    mpath0 () dm-0 IBM,1814      FAStT
    [size=4.0G][features=0][hwhandler=0]
    \_ round-robin 0 [prio=4][active]
    \_ 2:0:0:0 sda 8:0   [active][ready]
    \_ 2:0:1:0 sdb 8:16  [active][ready]
    \_ 3:0:0:0 sdc 8:32  [active][ready]
    \_ 3:0:1:0 sdd 8:48  [active][ready]

    Output of df -k:
    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/dm-2              3960348   1772124   1983800  48% /
    /dev/dm-1               101086     17593     78274  19% /boot
    tmpfs                  1037416         0   1037416   0% /dev/shm

    Contents of /dev/mapper/:
    crw-------  1 root root  10, 63 2007-11-26 13:58 control
    brw-rw----  1 root disk 253,  0 2007-11-26 13:58 mpath0
    brw-rw----  1 root disk 253,  1 2007-11-26 13:58 mpath0p1
    brw-rw----  1 root disk 253,  2 2007-11-26 13:58 mpath0p2

    But this is what I really would like to have:

    Output of multipath -ll:
    SRV07_BOOT (3600a0b8000295d64000009304742b4c8) dm-0
    IBM,1814      FAStT
    [size=4.0G][features=1 queue_if_no_path][hwhandler=0]
    \_ round-robin 0 [prio=0][enabled]
    \_ 2:0:0:0 sda 8:0   [active][ready]
    \_ 3:0:0:0 sdc 8:32  [active][ready]
    \_ round-robin 0 [prio=6][active]
    \_ 2:0:1:0 sdb 8:16  [active][ready]
    \_ 3:0:1:0 sdd 8:48  [active][ready]


    I can modify the table by modifying the init script in the initrd
    image
    and then booting with the modified initrd image but I don't know
    how to
    change the name from mpath0 to SRV07_BOOT.

You should be able to change the name by creating a multipaths section like below

Quoted 8 lines
multipaths {
    multipath {
        wwid "3600a0b8000295d64000009304742b4c8"
        alias "SRV07_BOOT"
    }
}

If that does not work as expected, you might have to say "no" to the user friendly names option.

Hi Stefan,
I've tried that, but what happens is that once the multipathd starts I'll have duplicate multipaths, the one at boot time and this one by multipathd, with different names.

Quoted 12 lines

Any help will be very appreciated!!

Thank you,
Pedro Faustino

--
dm-devel mailing list [email protected] <mailto:[email protected]>
https://www.redhat.com/mailman/listinfo/dm-devel

#3 lore raw
Quoted 13 lines · Pedro Bandim Faustino
Quoted 11 lines · Stefan Bader

You should be able to change the name by creating a multipaths section like below

multipaths {
   multipath {
       wwid "3600a0b8000295d64000009304742b4c8"
       alias "SRV07_BOOT"
   }
}
Quoted 7 lines
Quoted 2 lines

If that does not work as expected, you might have to say "no" to the user friendly names option.

Hi Stefan,
I've tried that, but what happens is that once the multipathd starts I'll have duplicate multipaths, the one at boot time and this one by multipathd, with different names.

If you add aliases to the multipaths section, like Stefan decribed, and then rerun multipath, do the devices change names to given aliases? They should. Then, you should be able to remake the initrd, and reboot and just see the alias. If you try this, and it doesn't work, let me know.

-Ben

#4 lore raw

Hi Ben,

They do change names, the thing is that when the drivers are first loaded at boot time, /dev/dm-0 gets multipathed and mapped to /dev/mpath/mpath0 and /dev/mapper/mpath0 Afterwards when there's a context switch to userspace, /dev/dm-2 gets multipathed and mapped to whatever alias I would have in multipath.conf (I could have blacklisted dm-2).

[root@m07 ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/dm-2             3.8G  1.8G  1.9G  48% /
/dev/dm-1              99M   24M   70M  26% /boot
/dev/sde1              92G  188M   87G   1% /log

tmpfs 1014M 0 1014M 0% /dev/shm

So what I did was first change the table (modifying the init script of the initrd), and booted.
Then I've issued a dmsetup rename and afterwards a mkinitrd. I've also edited the multipath.conf in order to blacklist by WWID the local SAS disk and the boot LUN, and also defined some policies for the FC SAN I'm using (IBM DS4700), and booted.

This is now what I have:

[root@m07 ~]# multipath -ll
SRV07_BOOT () dm-0 IBM,1814 FAStT
[size=4.0G][features=0][hwhandler=0]
\_ round-robin 0 [prio=0][enabled]
\_ 2:0:0:0 sda 8:0 [active][ready]
\_ 3:0:0:0 sdc 8:32 [active][ready]
\_ round-robin 0 [prio=6][active]
\_ 2:0:1:0 sdb 8:16 [active][ready]
\_ 3:0:1:0 sdd 8:48 [active][ready]

[root@m07 ~]# cat /etc/multipath.conf
defaults {

       udev_dir                /dev
       polling_interval        2
       selector                "round-robin 0"
       path_grouping_policy    multibus
       getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
       prio_callout            /bin/true
       path_checker            readsector0
       rr_min_io               100
       rr_weight               priorities
       failback                immediate
       no_path_retry           fail
       user_friendly_name      yes

}

blacklist {
       # Blacklist the local disk
       wwid 35000c500057cd8d3
       # Blacklist the root disk
       wwid 3600a0b8000295d64000009304742b4c8
       devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
       devnode "^hd[a-z]"
       devnode "^cciss!c[0-9]d[0-9]*"
}

devices {
device {
vendor "IBM"
product "1814 FAStT"
path_grouping_policy group_by_serial
path_checker tur
prio_callout "/sbin/mpath_prio_tpc /dev/%n"
no_path_retry queue
}
}

Pedro Bandim Faustino
email/sip: [email protected]
www.fccn.pt

Aviso de Confidencialidade

Esta mensagem é exclusivamente destinada ao seu destinatário, podendo conter informação CONFIDENCIAL, cuja divulgação está expressamente vedada nos termos da lei. Caso tenha recepcionado indevidamente esta mensagem, solicitamos-lhe que nos comunique esse mesmo facto por esta via ou para o telefone +351 218440100 devendo apagar o seu conteúdo de imediato. This message is intended exclusively for its addressee. It may contain CONFIDENTIAL information protected by law. If this message has been received by error, please notify us via e-mail or by telephone +351 218440100 and delete it immediately.

Quoted 27 lines · Benjamin Marzinski
Quoted 11 lines · Pedro Bandim Faustino
Quoted 9 lines · Stefan Bader

You should be able to change the name by creating a multipaths section like below

multipaths {
   multipath {
       wwid "3600a0b8000295d64000009304742b4c8"
       alias "SRV07_BOOT"
   }
}
Quoted 6 lines
Quoted 2 lines

If that does not work as expected, you might have to say "no" to the user friendly names option.

Hi Stefan,
I've tried that, but what happens is that once the multipathd starts I'll have duplicate multipaths, the one at boot time and this one by multipathd, with different names.

If you add aliases to the multipaths section, like Stefan decribed, and then rerun multipath, do the devices change names to given aliases? They should. Then, you should be able to remake the initrd, and reboot and just see the alias. If you try this, and it doesn't work, let me know.

-Ben

#5 lore raw
In reply to Pedro Bandim Faustino
Quoted 18 lines · Pedro Bandim Faustino [[email protected]] wrote:

Hi All,

I have a working multipath on root, but some questions still unanswered. I'm hoping you can help me out ;)

But this is what I really would like to have:

Output of multipath -ll:
SRV07_BOOT (3600a0b8000295d64000009304742b4c8) dm-0 IBM,1814 FAStT
[size=4.0G][features=1 queue_if_no_path][hwhandler=0] \_ round-robin 0 [prio=0][enabled]
\_ 2:0:0:0 sda 8:0 [active][ready]
\_ 3:0:0:0 sdc 8:32 [active][ready]
\_ round-robin 0 [prio=6][active]
\_ 2:0:1:0 sdb 8:16 [active][ready]
\_ 3:0:1:0 sdd 8:48 [active][ready]

Quoted 3 lines

I can modify the table by modifying the init script in the initrd image and then booting with the modified initrd image but I don't know how to change the name from mpath0 to SRV07_BOOT.

I don't know how Fedora Core 7 handles this in the initrd. Old RHEL systems (prior to RHEL5.1) have nash commands to construct hard coded multipath devices. You probably supply the name as part those commands. If Fedora Core 7 uses something similar to RHEL5.2, then you could probably use aliases in the multipath.conf file and rebuild initrd???

#6 lore raw

Re: user defined device name and table - SOLVED

Quoted 20 lines · [email protected] wrote:
Quoted 18 lines · Pedro Bandim Faustino [[email protected]] wrote:

Hi All,

I have a working multipath on root, but some questions still unanswered. I'm hoping you can help me out ;)

But this is what I really would like to have:

Output of multipath -ll:
SRV07_BOOT (3600a0b8000295d64000009304742b4c8) dm-0 IBM,1814 FAStT
[size=4.0G][features=1 queue_if_no_path][hwhandler=0] \_ round-robin 0 [prio=0][enabled]
\_ 2:0:0:0 sda 8:0 [active][ready]
\_ 3:0:0:0 sdc 8:32 [active][ready]
\_ round-robin 0 [prio=6][active]
\_ 2:0:1:0 sdb 8:16 [active][ready]
\_ 3:0:1:0 sdd 8:48 [active][ready]

Quoted 9 lines
Quoted 2 lines

I can modify the table by modifying the init script in the initrd image and then booting with the modified initrd image but I don't know how to change the name from mpath0 to SRV07_BOOT.

I don't know how Fedora Core 7 handles this in the initrd. Old RHEL systems (prior to RHEL5.1) have nash commands to construct hard coded multipath devices. You probably supply the name as part those commands. If Fedora Core 7 uses something similar to RHEL5.2, then you could probably use aliases in the multipath.conf file and rebuild initrd???

Fedora does use nash commands in its mkinitrd script. From what I understood Fedora 7 mkinitrd doesn't fetch multipath settings from the conf file, instead it checks the current, in use, settings.

So, what I've done was change the table (at boot time, modifying the init script of the initrd image) and rebooted with this new image. Then, I've changed the friendly name (using dmsetup rename command), issued a mkinitrd and rebooted with this new image. (You can do the above by modifying the init script just once)

So I finally got the what I wanted and also the desired names at /dev/mapper and /dev/mpath. What I'm going to do now is configure the multipathd and multipath.conf to finish my setup.

Cheers and thanks for your help,
Pedro Bandim Faustino