Linux

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • LVM and Device Mapper

    6 answers - 1337 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hello,
    I've setup multipath with multipath-tools and I guess everything is K
    there. However, I can't get lvm to recognize the multipath'ed devices:
    # dmsetup ls
    (253, 4)
    system-lv03 (253, 2)
    system-lv01 (253, 1)
    system-lv00 (253, 0)
    dm-3p2 (253, 7)
    dm-3p1 (253, 6)
    cabtagdb01:~ # fdisk -l /dev/dm-3
    Disk /dev/dm-3: 53.6 GB, 53687091200 bytes
    64 heads, 32 sectors/track, 51200 cylinders
    Units = cylinders of 2048 * 512 = 1048576 bytes
    Device Boot Start End Blocks Id System
    /dev/dm-3p1 1 1 1008 83 Linux
    /dev/dm-3p2 2 51200 52427776 8e Linux LVM
    cabtagdb01:~ # fdisk -l /
    Disk / 53.6 GB, 53687091200 bytes
    64 heads, 32 sectors/track, 51200 cylinders
    Units = cylinders of 2048 * 512 = 1048576 bytes
    Device Boot Start
    End Blocks Id System
    / 1
    1 1008 83 Linux
    / 2
    51200 52427776 8e Linux LVM
    # pvcreate /dev/dm-3p2
    Device /dev/dm-3p2 not found.
    # pvcreate /
    Device / not found.
    Does anyone have any guess on what the problem might be? I seem to be
    one-step from getting this solved and I am going through these
    hassles.
    Thank you,
    Pierre
    linux-lvm mailing list
    linux-lvm (AT) redhat (DOT) com
    read the LVM HW-T at http://tldp.org/HWT/LVM-HWT/
  • No.1 | | 3887 bytes | |

    6/16/06, Kelly Sauke <ksauke (AT) fastenal (DOT) comwrote:
    Add "a|/dev/mapper/mpath.*|" to the filter= line of your lvm.conf as such.

    filter = [ "a|/dev/sda2|", "a|/dev/mapper/mpath.*|", "r/.*/" ]

    Then make sure your types= variable has device-mapper in it.

    types = [ "device-mapper", 1 ]

    That should be all you need.

    Hello Kelly,

    That kinda worked out. I tried your example as-is, and it still shows
    'Found duplicate PV' messages and additionally it said "vg sucessfully
    created" but in fact, when I issue a vgdisplay, it doesn't show the vg
    created.

    As soon as I changed from types = [ "device-mapper", 1 ] to types = [
    "device-mapper", 16 ] as stated on lvm.conf's man page, the vgdisplay
    command recognized the VG clusterfs. Soon after I tried to create a LV
    on the VG clusterfs and it doesn't create the /dev/clusterfs/.* but it
    does create /dev/mapper/clusterfs-ora1, however, I looked around and
    found the util 'vgmknodes' and that seemed to create, however, I am
    not still able to create a filesystem on it and the "Found duplicate
    PV" messages still appear. Here's the output:
    # vgdisplay
    Found duplicate PV using /dev/dm-5
    not /dev/sda2
    Found duplicate PV using
    /dev/dm-3p2 not /dev/sda2
    Found duplicate PV using /dev/sdb2
    not /dev/sda2
    (erased the other VG)
    Volume group
    VG Name clusterfs
    System ID
    Format lvm2
    Metadata Areas 1
    Metadata Sequence No 2
    VG Access read/write
    VG Status resizable
    MAX LV 0
    Cur LV 1
    LV 0
    Max PV 0
    Cur PV 1
    Act PV 1
    VG Size 50.00 GB
    PE Size 4.00 MB
    Total PE 12799
    Alloc PE / Size 25 / 100.00 MB
    Free PE / Size 12774 / 49.90 GB
    VG UUID

    # lvdisplay
    (skipped the others)
    Logical volume
    LV Name /dev/clusterfs/ora1
    VG Name clusterfs
    LV UUID
    LV Write Access read/write
    LV Status available
    # open 0
    LV Size 100.00 MB
    Current LE 25
    Segments 1
    Allocation inherit
    Read ahead sectors 0
    Block device 253:8

    # mkfs.ext3 /dev/clusterfs/ora1
    mke2fs 1.38 (30-Jun-2005)
    mkfs.ext3: Device size reported to be zero. Invalid partition specified, or
    partition table wasn't reread after running fdisk, due to
    a modified partition being busy and in use. You may need to reboot
    to re-read your partition table.

    Any more sugestions?

    Thank you very much Kelly/Luca

    C'est Pierre wrote:
    Hello,

    I've setup multipath with multipath-tools and I guess everything is K
    there. However, I can't get lvm to recognize the multipath'ed devices:

    # dmsetup ls
    (253, 4)
    system-lv03 (253, 2)
    system-lv01 (253, 1)
    system-lv00 (253, 0)
    dm-3p2 (253, 7)
    dm-3p1 (253, 6)

    cabtagdb01:~ # fdisk -l /dev/dm-3

    Disk /dev/dm-3: 53.6 GB, 53687091200 bytes
    64 heads, 32 sectors/track, 51200 cylinders
    Units = cylinders of 2048 * 512 = 1048576 bytes

    Device Boot Start End Blocks Id System
    /dev/dm-3p1 1 1 1008 83 Linux
    /dev/dm-3p2 2 51200 52427776 8e Linux LVM
    cabtagdb01:~ # fdisk -l /

    Disk / 53.6 GB, 53687091200
    bytes
    64 heads, 32 sectors/track, 51200 cylinders
    Units = cylinders of 2048 * 512 = 1048576 bytes

    Device Boot Start
    End Blocks Id System
    / 1
    1 1008 83 Linux
    / 2
    51200 52427776 8e Linux LVM
    --
    # pvcreate /dev/dm-3p2
    Device /dev/dm-3p2 not found.

    # pvcreate /
    Device / not found.

    Does anyone have any guess on what the problem might be? I seem to be
    one-step from getting this solved and I am going through these
    hassles.

    Thank you,
    Pierre

    linux-lvm mailing list
    linux-lvm (AT) redhat (DOT) com

    read the LVM HW-T at http://tldp.org/HWT/LVM-HWT/
  • No.2 | | 5256 bytes | |

    C'est Pierre wrote:
    6/16/06, Kelly Sauke <ksauke (AT) fastenal (DOT) comwrote:
    >Add "a|/dev/mapper/mpath.*|" to the filter= line of your lvm.conf as
    >such.
    >>

    >filter = [ "a|/dev/sda2|", "a|/dev/mapper/mpath.*|", "r/.*/" ]
    >>

    >Then make sure your types= variable has device-mapper in it.
    >>

    >types = [ "device-mapper", 1 ]
    >>

    >That should be all you need.
    >>


    Hello Kelly,

    That kinda worked out. I tried your example as-is, and it still shows
    'Found duplicate PV' messages and additionally it said "vg sucessfully
    created" but in fact, when I issue a vgdisplay, it doesn't show the vg
    created.

    Try excluding all of your sd paths in the filter line. If you look at my
    example, it seems my local disk /dev/sda2, my mpath devices and then it hides
    everything else. Thats how I got the 'Found duplicate PV' errors to go away.

    After setting that, run an lvmdiskscan to verify that its seeing your multipath
    devices and excuding the sd devices.

    As soon as I changed from types = [ "device-mapper", 1 ] to types = [
    "device-mapper", 16 ] as stated on lvm.conf's man page, the vgdisplay
    command recognized the VG clusterfs. Soon after I tried to create a LV
    on the VG clusterfs and it doesn't create the /dev/clusterfs/.* but it
    does create /dev/mapper/clusterfs-ora1, however, I looked around and
    found the util 'vgmknodes' and that seemed to create, however, I am
    not still able to create a filesystem on it and the "Found duplicate
    PV" messages still appear. Here's the output:
    # vgdisplay
    Found duplicate PV using /dev/dm-5
    not /dev/sda2
    Found duplicate PV using
    /dev/dm-3p2 not /dev/sda2
    Found duplicate PV using /dev/sdb2
    not /dev/sda2
    (erased the other VG)
    Volume group
    VG Name clusterfs
    System ID
    Format lvm2
    Metadata Areas 1
    Metadata Sequence No 2
    VG Access read/write
    VG Status resizable
    MAX LV 0
    Cur LV 1
    LV 0
    Max PV 0
    Cur PV 1
    Act PV 1
    VG Size 50.00 GB
    PE Size 4.00 MB
    Total PE 12799
    Alloc PE / Size 25 / 100.00 MB
    Free PE / Size 12774 / 49.90 GB
    VG UUID

    # lvdisplay
    (skipped the others)
    Logical volume
    LV Name /dev/clusterfs/ora1
    VG Name clusterfs
    LV UUID
    LV Write Access read/write
    LV Status available
    # open 0
    LV Size 100.00 MB
    Current LE 25
    Segments 1
    Allocation inherit
    Read ahead sectors 0
    Block device 253:8

    # mkfs.ext3 /dev/clusterfs/ora1
    mke2fs 1.38 (30-Jun-2005)
    mkfs.ext3: Device size reported to be zero. Invalid partition
    specified, or
    partition table wasn't reread after running fdisk, due to
    a modified partition being busy and in use. You may need to reboot
    to re-read your partition table.

    I have no suggestions on this one. I've never encountered this error. It might
    be as easy as just deleting the lv and trying again.

    Any more sugestions?

    Thank you very much Kelly/Luca


    >C'est Pierre wrote:
    >Hello,
    >>

    >I've setup multipath with multipath-tools and I guess everything is K
    >there. However, I can't get lvm to recognize the multipath'ed devices:
    >>

    ># dmsetup ls
    >(253, 4)
    >system-lv03 (253, 2)
    >system-lv01 (253, 1)
    >system-lv00 (253, 0)
    >dm-3p2 (253, 7)
    >dm-3p1 (253, 6)
    >>

    >cabtagdb01:~ # fdisk -l /dev/dm-3
    >>

    >Disk /dev/dm-3: 53.6 GB, 53687091200 bytes
    >64 heads, 32 sectors/track, 51200 cylinders
    >Units = cylinders of 2048 * 512 = 1048576 bytes
    >>

    >Device Boot Start End Blocks Id System
    >/dev/dm-3p1 1 1 1008 83 Linux
    >/dev/dm-3p2 2 51200 52427776 8e Linux LVM
    >cabtagdb01:~ # fdisk -l /
    >>

    >Disk / 53.6 GB,
    >53687091200
    >bytes
    >64 heads, 32 sectors/track, 51200 cylinders
    >Units = cylinders of 2048 * 512 = 1048576 bytes
    >>

    >Device Boot Start
    >End Blocks Id System
    >/ 1
    >1 1008 83 Linux
    >/ 2
    >51200 52427776 8e Linux LVM
    >>
    >>

    ># pvcreate /dev/dm-3p2
    >Device /dev/dm-3p2 not found.
    >>

    ># pvcreate /
    >Device / not found.
    >>

    >Does anyone have any guess on what the problem might be? I seem to be
    >one-step from getting this solved and I am going through these
    >hassles.
    >>

    >Thank you,
    >Pierre
    >>


    linux-lvm mailing list
    linux-lvm (AT) redhat (DOT) com

    read the LVM HW-T at http://tldp.org/HWT/LVM-HWT/
  • No.3 | | 1778 bytes | |

    Add "a|/dev/mapper/mpath.*|" to the filter= line of your lvm.conf as such.

    filter = [ "a|/dev/sda2|", "a|/dev/mapper/mpath.*|", "r/.*/" ]

    Then make sure your types= variable has device-mapper in it.

    types = [ "device-mapper", 1 ]

    That should be all you need.

    C'est Pierre wrote:
    Hello,

    I've setup multipath with multipath-tools and I guess everything is K
    there. However, I can't get lvm to recognize the multipath'ed devices:

    # dmsetup ls
    (253, 4)
    system-lv03 (253, 2)
    system-lv01 (253, 1)
    system-lv00 (253, 0)
    dm-3p2 (253, 7)
    dm-3p1 (253, 6)

    cabtagdb01:~ # fdisk -l /dev/dm-3

    Disk /dev/dm-3: 53.6 GB, 53687091200 bytes
    64 heads, 32 sectors/track, 51200 cylinders
    Units = cylinders of 2048 * 512 = 1048576 bytes

    Device Boot Start End Blocks Id System
    /dev/dm-3p1 1 1 1008 83 Linux
    /dev/dm-3p2 2 51200 52427776 8e Linux LVM
    cabtagdb01:~ # fdisk -l /

    Disk / 53.6 GB, 53687091200
    bytes
    64 heads, 32 sectors/track, 51200 cylinders
    Units = cylinders of 2048 * 512 = 1048576 bytes

    Device Boot Start
    End Blocks Id System
    / 1
    1 1008 83 Linux
    / 2
    51200 52427776 8e Linux LVM

    # pvcreate /dev/dm-3p2
    Device /dev/dm-3p2 not found.

    # pvcreate /
    Device / not found.

    Does anyone have any guess on what the problem might be? I seem to be
    one-step from getting this solved and I am going through these
    hassles.

    Thank you,
    Pierre

    linux-lvm mailing list
    linux-lvm (AT) redhat (DOT) com

    read the LVM HW-T at http://tldp.org/HWT/LVM-HWT/

    linux-lvm mailing list
    linux-lvm (AT) redhat (DOT) com

    read the LVM HW-T at http://tldp.org/HWT/LVM-HWT/
  • No.4 | | 1282 bytes | |

    Thursday 15 June 2006 22:14, C'est Pierre wrote:
    Hello,

    I've setup multipath with multipath-tools and I guess everything is K
    there. However, I can't get lvm to recognize the multipath'ed devices:
    Need to check that your /etc/lvm/lvm.conf file is accepting those devices.

    # dmsetup ls
    (253, 4)
    system-lv03 (253, 2)
    system-lv01 (253, 1)
    system-lv00 (253, 0)
    dm-3p2 (253, 7)
    dm-3p1 (253, 6)

    cabtagdb01:~ # fdisk -l /dev/dm-3

    Disk /dev/dm-3: 53.6 GB, 53687091200 bytes
    64 heads, 32 sectors/track, 51200 cylinders
    Units = cylinders of 2048 * 512 = 1048576 bytes

    Device Boot Start End Blocks Id System
    /dev/dm-3p1 1 1 1008 83 Linux
    /dev/dm-3p2 2 51200 52427776 8e Linux LVM
    cabtagdb01:~ # fdisk -l /

    Disk / 53.6 GB, 53687091200
    bytes 64 heads, 32 sectors/track, 51200 cylinders
    Units = cylinders of 2048 * 512 = 1048576 bytes

    Device Boot Start
    End Blocks Id System
    / 1
    1 1008 83 Linux
    / 2
    51200 52427776 8e Linux LVM
    --
    # pvcreate /dev/dm-3p2
    Device /dev/dm-3p2 not found.
    So you need something like:
    filter = [ "a|dm|", <other rules here]

    In the devices {} section of your /etc/lvm/lvm.conf file so it will accept the
    device.
  • No.5 | | 2344 bytes | |

    Fri, Jun 16, 2006 at 10:20:17AM -0500, Kelly Sauke wrote:
    >C'est Pierre wrote:
    >That kinda worked out. I tried your example as-is, and it still shows
    >'Found duplicate PV' messages and additionally it said "vg sucessfully
    >created" but in fact, when I issue a vgdisplay, it doesn't show the vg
    >created.
    >
    >
    >Try excluding all of your sd paths in the filter line. If you look at my
    >example, it seems my local disk /dev/sda2, my mpath devices and then it hides
    >everything else. Thats how I got the 'Found duplicate PV' errors to go away.
    >
    >After setting that, run an lvmdiskscan to verify that its seeing your multipath
    >devices and excuding the sd devices.


    yes, please edit your filter line, so it will ignore the /dev/sd*
    devices


    >(erased the other VG)
    >Volume group
    >VG Name clusterfs
    >System ID
    >Format lvm2
    >Metadata Areas 1
    >Metadata Sequence No 2
    >VG Access read/write
    >VG Status resizable
    >MAX LV 0
    >Cur LV 1
    >LV 0
    >Max PV 0
    >Cur PV 1
    >Act PV 1
    >VG Size 50.00 GB
    >PE Size 4.00 MB
    >Total PE 12799
    >Alloc PE / Size 25 / 100.00 MB
    >Free PE / Size 12774 / 49.90 GB
    >VG UUID
    >
    >
    ># lvdisplay
    >(skipped the others)
    >Logical volume
    >LV Name /dev/clusterfs/ora1
    >VG Name clusterfs
    >LV UUID
    >LV Write Access read/write
    >LV Status available
    ># open 0
    >LV Size 100.00 MB
    >Current LE 25
    >Segments 1
    >Allocation inherit
    >Read ahead sectors 0
    >Block device 253:8
    >

    seems the lv was not activated, i don't know why, maybe some interaction
    with udev?

    >
    ># mkfs.ext3 /dev/clusterfs/ora1
    >mke2fs 1.38 (30-Jun-2005)
    >mkfs.ext3: Device size reported to be zero. Invalid partition
    >specified, or
    >partition table wasn't reread after running fdisk, due to
    >a modified partition being busy and in use. You may need to reboot
    >to re-read your partition table.
    >

    try vgchange -a y again after fixing your lvm.conf as explained above.

    L.
  • No.6 | | 2701 bytes | |

    Thank all of you for the support! I finally made it (I hope I have no
    more questions to put up here ;-)

    Pierre

    6/17/06, Luca Berra <bluca (AT) comedia (DOT) itwrote:
    Fri, Jun 16, 2006 at 10:20:17AM -0500, Kelly Sauke wrote:
    >C'est Pierre wrote:
    >That kinda worked out. I tried your example as-is, and it still shows
    >'Found duplicate PV' messages and additionally it said "vg sucessfully
    >created" but in fact, when I issue a vgdisplay, it doesn't show the vg
    >created.
    >>

    >
    >Try excluding all of your sd paths in the filter line. If you look at my
    >example, it seems my local disk /dev/sda2, my mpath devices and then it hides
    >everything else. Thats how I got the 'Found duplicate PV' errors to go away.
    >
    >After setting that, run an lvmdiskscan to verify that its seeing your multipath
    >devices and excuding the sd devices.
    >

    yes, please edit your filter line, so it will ignore the /dev/sd*
    devices


    >(erased the other VG)
    >Volume group
    >VG Name clusterfs
    >System ID
    >Format lvm2
    >Metadata Areas 1
    >Metadata Sequence No 2
    >VG Access read/write
    >VG Status resizable
    >MAX LV 0
    >Cur LV 1
    >LV 0
    >Max PV 0
    >Cur PV 1
    >Act PV 1
    >VG Size 50.00 GB
    >PE Size 4.00 MB
    >Total PE 12799
    >Alloc PE / Size 25 / 100.00 MB
    >Free PE / Size 12774 / 49.90 GB
    >VG UUID
    >>
    >>

    ># lvdisplay
    >(skipped the others)
    >Logical volume
    >LV Name /dev/clusterfs/ora1
    >VG Name clusterfs
    >LV UUID
    >LV Write Access read/write
    >LV Status available
    ># open 0
    >LV Size 100.00 MB
    >Current LE 25
    >Segments 1
    >Allocation inherit
    >Read ahead sectors 0
    >Block device 253:8
    >>

    seems the lv was not activated, i don't know why, maybe some interaction
    with udev?
    >
    >>

    ># mkfs.ext3 /dev/clusterfs/ora1
    >mke2fs 1.38 (30-Jun-2005)
    >mkfs.ext3: Device size reported to be zero. Invalid partition
    >specified, or
    >partition table wasn't reread after running fdisk, due to
    >a modified partition being busy and in use. You may need to reboot
    >to re-read your partition table.
    >>

    try vgchange -a y again after fixing your lvm.conf as explained above.

    L.

Re: LVM and Device Mapper


max 4000 letters.
Your nickname that display:
In order to stop the spam: 1 + 0 =
QUESTION ON "Linux"

EMSDN.COM