1832346 Members
2293 Online
110041 Solutions
New Discussion

lvcreate error

 
Conal O'Kelly
Advisor

lvcreate error

Hi
I tried to create a new LV in /dev/vg00 with the command:
# lvcreate -L 8000 -m 1 /dev/vg00
I get the following error:
"lvcreate: Logical Vol /dev/vg00/lvol8 already exists."
This is true as lvol8 is /var but why doesn't lvcreate just choose the next avail lvol number.
If I use the -n option & specify the next lvol number everything works fine. Im just curious why this happens.
Any help appreciated.

Cheers
Con
8 REPLIES 8
Sanjay_6
Honored Contributor

Re: lvcreate error

Hi conan,

Can you post these two outputs.

ll /dev/vg00
vgdisplay -v /dev/vg00

Hope this helps.

Regds
Michael Tully
Honored Contributor

Re: lvcreate error

Hi,

I suspect it may have something
to do with the mirroring option.
As suggested, post the vgdisplay
output.

-Michael
Anyone for a Mutiny ?
Animesh Chakraborty
Honored Contributor

Re: lvcreate error

Hi,
As sanjay suggested please let us know those two outputs.I think this is related to minor number of the lvols.
If you specify the -n lv_name option, a new logical volume is created
with that name. Otherwise, a system-generated name of the form lvolN
is created, where N is the decimal equivalent of the two least
significant bytes of the minor number of the new logical volume, in
the range 1 to 255 .
Did you take a backup?
Conal O'Kelly
Advisor

Re: lvcreate error

 
Sanjay_6
Honored Contributor

Re: lvcreate error

Hi Conal,

I don't see any reason why the system should be trying to create lvol8 when it alredy exists. The lvol11 is missing, but that could very well be deleted. This could be a patch issue. Do you have lvm command / cumulative patches on this box that has warning issued against them. You can check if there are any warning for those patches.

Animesh and Michael, can you think of any reason why this problem should be occuring.

Regards
Sanjay
Denver Osborn
Honored Contributor

Re: lvcreate error

don't know if this will help; might spark something for someone. (my test box isn't patched.. yet)

have a vg with 10 lvols, lvol1 - lvol10.

# lvcreate -n lvol12 /dev/vgtmp
--> good

# lvcreate /dev/vgtmp
--> no good "lvol12 exists"


If I create lvol -n 11 (next in order, remove lvol12 1st) then follow it up w/ lvcreate (no -n) it created lvol12, no error. from the output of your vgdisplay and ll I think it might be something like this; since it appears lvols have been removed recreated, etc... I think the 1st place I'd look is at patches and their descriptions on what symptoms are.
Conal O'Kelly
Advisor

Re: lvcreate error

Thanks for the feedback guys. Patch levels are a little behind - up to March 2001 bundle. However I have checked latest lvm cumulative patch (PHCO_24437) & couldn't see any mention of this problem.
There has been a fair amount of adding/removing lv's etc from /dev/vg00 so maybe this accounts for it like Denver suggested. If I find anything more I'll let you know.

Cheers
Con
Michael Tully
Honored Contributor

Re: lvcreate error

Hi,

This is part of the 'lvcreate' man page which tends to indicate what has been written by Denver.

If you specify the -n lv_name option, a new logical volume is created with that name. Otherwise, a system-generated name of the form lvolN is created, where N is the decimal equivalent of the two least significant bytes of the minor number of the new logical volume, in the range 1 to 255 (see lvm(7)). Two device files are created in vg_name: a block device file named lv_name or lvolN, and a character (raw) device file named rlv_name or rlvolN.

Because of the autogeneration of the numbering and what you have written, I would guess that the automatic numbering has got itself screwed up.

-Michael
Anyone for a Mutiny ?