Topic
  • 12 replies
  • Latest Post - ‏2013-11-07T08:41:40Z by PrabhanjanG
shargus
shargus
157 Posts

Pinned topic mkvg - strange behavior with major number

‏2009-02-11T21:31:26Z |
Trying to create a new volume group using

mkvg -S -f -s 1024 -y vgoracle hdisk2

we're getting 0516-021 message about the major number is in use.

The mkvg command did not actually create a vgoracle (and thus, no device file), so we can't tell what major number it has a problem with.
So, I tried adding a "-C" to the mkvg command. This time, it created a vgoracle volume group with associated device file. The major number is 37.
As expected, trying to varyonvg vgoracle gives the "major number already in use" error.

The problem is, we cannot find any other device file with major number 37.

We even poked around in the ODM looking for it.

If we do the same mkvg, but this time specified a major number (we picked 41 at random), it works fine.

So, 1) What is mkvg colliding with? 2) If I need to specify a major number, how can I tell (in a script) which ones are available for use? 37 appears to be available here, yet mkvg (and varyonvg) choke on it.
Updated on 2009-02-26T16:01:11Z at 2009-02-26T16:01:11Z by shargus
  • MarkTaylor
    MarkTaylor
    230 Posts

    Re: mkvg - strange behavior with major number

    ‏2009-02-12T12:46:24Z  
    use kdb .. then either "devsw" or "pdt *" and look for your major number in HEX .. it will be there .. I hit this last year when trying to import some VGs with specific major numbers ..

    HTH
    Mark Taylor
  • MarkTaylor
    MarkTaylor
    230 Posts

    Re: mkvg - strange behavior with major number

    ‏2009-02-12T12:48:28Z  
    use kdb .. then either "devsw" or "pdt *" and look for your major number in HEX .. it will be there .. I hit this last year when trying to import some VGs with specific major numbers ..

    HTH
    Mark Taylor
    actually, pdt is the paging device tab .. so it may not be listed there, but it will be in the device switch table "devsw"
  • MarkTaylor
    MarkTaylor
    230 Posts

    Re: mkvg - strange behavior with major number

    ‏2009-02-12T12:50:06Z  
    use kdb .. then either "devsw" or "pdt *" and look for your major number in HEX .. it will be there .. I hit this last year when trying to import some VGs with specific major numbers ..

    HTH
    Mark Taylor
    lvgenmajor command will show you the next major number available to use btw ..
  • cggibbo
    cggibbo
    27 Posts

    Re: mkvg - strange behavior with major number

    ‏2009-02-13T03:43:55Z  
    lvgenmajor command will show you the next major number available to use btw ..
    lvlstmajor - shows a list of device major numbers not currently in use e.g.

    1. lvlstmajor
    34...
  • shargus
    shargus
    157 Posts

    Re: mkvg - strange behavior with major number

    ‏2009-02-18T22:53:25Z  
    lvlstmajor reports that major number 37 is available:

    $ lvlstmajor

    37..40,44...


    yet mkvg says it's already in use:

    # mkvg -S -f -s 1024 -V 37 -y vgtest hdisk1

    vgtest

    0516-021 /usr/sbin/varyonvg: The varyonvg failed because the volume group's

    major number was already used by another device.

    0516-862 mkvg: Unable to create volume group.

  • shargus
    shargus
    157 Posts

    Re: mkvg - strange behavior with major number

    ‏2009-02-18T23:00:45Z  
    lvgenmajor command will show you the next major number available to use btw ..
    lvgenmajor says major number 37 is available:

    .h2 # lvgenmajor vgtest
    .h2 37

    Yet, mkvg says it's not:

    .h2 # mkvg -S -f -s 1024 -V 37 -y vgtest hdisk1
    .h2 vgtest
    .h2 0516-021 /usr/sbin/varyonvg: The varyonvg failed because the volume group's
    .h2 major number was already used by another device.
    .h2 0516-862 mkvg: Unable to create volume group.
  • orphy
    orphy
    480 Posts

    Re: mkvg - strange behavior with major number

    ‏2009-02-18T23:17:16Z  
    • shargus
    • ‏2009-02-18T23:00:45Z
    lvgenmajor says major number 37 is available:

    .h2 # lvgenmajor vgtest
    .h2 37

    Yet, mkvg says it's not:

    .h2 # mkvg -S -f -s 1024 -V 37 -y vgtest hdisk1
    .h2 vgtest
    .h2 0516-021 /usr/sbin/varyonvg: The varyonvg failed because the volume group's
    .h2 major number was already used by another device.
    .h2 0516-862 mkvg: Unable to create volume group.
    I know you mentioned that you tried to locate the device that has the major number 37 but can you show us the output of this command?

    ls -l /dev|grep 37,

    Something else interesting to try would be

    mkvg -S -f -s 1024 -V 40 -y vgtest hdisk1
    varyoffvg vgtest
    exportvg vgtest
    importvg -V 37 -y vgtest hdisk1

    Since it was the varyonvg that failed, I expect importvg -V 37 to fail as well but it would be a good exercise to give it a quick try.

    To fix this, you might just need to open a PMR and send Support a snap so that they can look at the whole picture in order to fix this for you. Please do report back the outcome though.
    Orphy
  • shargus
    shargus
    157 Posts

    Re: mkvg - strange behavior with major number

    ‏2009-02-18T23:37:21Z  
    use kdb .. then either "devsw" or "pdt *" and look for your major number in HEX .. it will be there .. I hit this last year when trying to import some VGs with specific major numbers ..

    HTH
    Mark Taylor
    kdb does say the device file is in use... (37 dec is 25 hex)
    Slot address F1000100101B4280
    MAJOR: 025
    open: 047D26F8
    close: 047D2670
    read: 047D20E0
    write: .nodev (0019A394)
    ioctl: 047D1D98
    strategy: .nodev (0019A394)
    ttys: 00000000
    select: .nodev (0019A394)
    config: .nodev (0019A394)
    print: .nodev (0019A394)
    dump: .nodev (0019A394)
    mpx: .nodev (0019A394)
    revoke: .nodev (0019A394)
    dsdptr: 00000000
    selptr: 00000000
    opts: 0000002A DEV_DEFINED DEV_MPSAFE
    I'm not sure if I'm reading this right, but it appears device 37 has open, close, read, and ioctl handles, but no write handle?
  • shargus
    shargus
    157 Posts

    Re: mkvg - strange behavior with major number

    ‏2009-02-18T23:45:29Z  
    • orphy
    • ‏2009-02-18T23:17:16Z
    I know you mentioned that you tried to locate the device that has the major number 37 but can you show us the output of this command?

    ls -l /dev|grep 37,

    Something else interesting to try would be

    mkvg -S -f -s 1024 -V 40 -y vgtest hdisk1
    varyoffvg vgtest
    exportvg vgtest
    importvg -V 37 -y vgtest hdisk1

    Since it was the varyonvg that failed, I expect importvg -V 37 to fail as well but it would be a good exercise to give it a quick try.

    To fix this, you might just need to open a PMR and send Support a snap so that they can look at the whole picture in order to fix this for you. Please do report back the outcome though.
    Orphy

    ls -l /dev/| grep 37


    no files listed.

    # mkvg -S -f -s 1024 -V 40 -y vgtest hdisk1

    0516-372 mkvg: The chkmajor function failed.

    0516-862 mkvg: Unable to create volume group.


    # lvlstmajor

    38..40,44...


    Interesting...
  • MarkTaylor
    MarkTaylor
    230 Posts

    Re: mkvg - strange behavior with major number

    ‏2009-02-20T09:17:09Z  
    • shargus
    • ‏2009-02-18T23:37:21Z
    kdb does say the device file is in use... (37 dec is 25 hex)
    Slot address F1000100101B4280
    MAJOR: 025
    open: 047D26F8
    close: 047D2670
    read: 047D20E0
    write: .nodev (0019A394)
    ioctl: 047D1D98
    strategy: .nodev (0019A394)
    ttys: 00000000
    select: .nodev (0019A394)
    config: .nodev (0019A394)
    print: .nodev (0019A394)
    dump: .nodev (0019A394)
    mpx: .nodev (0019A394)
    revoke: .nodev (0019A394)
    dsdptr: 00000000
    selptr: 00000000
    opts: 0000002A DEV_DEFINED DEV_MPSAFE
    I'm not sure if I'm reading this right, but it appears device 37 has open, close, read, and ioctl handles, but no write handle?
    I done quite a bit of investigation on this last year as I was migrating LUNs between VIO Servers and importing using the original major numbers and I hit issues as you have ..

    You may ket a clue if you see what the kex is loaded at the open address i.e.

    $ kdb
    (0)> lke -s 047D26F8
  • shargus
    shargus
    157 Posts

    Re: mkvg - strange behavior with major number - FIXED

    ‏2009-02-26T16:01:11Z  
    The problem was with Hitachi's HDLM.

    HDLM creates it's own special devices. The device files were already in /dev and in the ODM, but not in the kernel. At some point, HDLM recreated the kernel device entries with new major numbers, but did not correct the ODM and the device files. At that point, the major numbers got out of sync and things went downhill from there.

    The fix is to remove and re-install HDLM.
  • PrabhanjanG
    PrabhanjanG
    1 Post

    Re: mkvg - strange behavior with major number

    ‏2013-11-07T08:41:40Z  

    A simple reboot the node resolved a similar issue I was facing.