linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] vgs result code error
@ 2009-07-21  7:16 Masanari Iida
  2009-07-21  8:27 ` Ron Johnson
  0 siblings, 1 reply; 9+ messages in thread
From: Masanari Iida @ 2009-07-21  7:16 UTC (permalink / raw)
  To: linux-lvm

Hello List,

I have encountered an error with vgs command.

How to reproduce.

(1) Initialize the PV.
# pvcreate /dev/cciss/c0d3p3

(2) Create VG
#  vgcreate vg01 /dev/cciss/c0d3p3

(3)  Use vgs command and see result code.

# vgs /dev/cciss/c0d3p3
  Invalid volume group name: cciss/c0d3p3

# echo $?
0

The result code should be none zero value.
One of a script rely on this result code, and it failed to work
because of this bug.

I have found this bug on RHEL5 (which uses lvm2.02.40-6) and
I have checked out WHATS_NEW between 2.02-40 to 49,
so far no similar symptom.

/dev/cciss is pointed HP Smart Array, FYI.

Regards,

Masanari

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [linux-lvm] vgs result code error
  2009-07-21  7:16 [linux-lvm] vgs result code error Masanari Iida
@ 2009-07-21  8:27 ` Ron Johnson
  2009-07-21  9:08   ` Masanari Iida
  0 siblings, 1 reply; 9+ messages in thread
From: Ron Johnson @ 2009-07-21  8:27 UTC (permalink / raw)
  To: linux-lvm

On 2009-07-21 02:16, Masanari Iida wrote:
> Hello List,
> 
> I have encountered an error with vgs command.
> 
> How to reproduce.
> 
> (1) Initialize the PV.
> # pvcreate /dev/cciss/c0d3p3
> 
> (2) Create VG
> #  vgcreate vg01 /dev/cciss/c0d3p3
> 
> (3)  Use vgs command and see result code.
> 
> # vgs /dev/cciss/c0d3p3
>   Invalid volume group name: cciss/c0d3p3

You specified a PV, not a VG.  Try:
# vgs vg01


Here's what it does on my system:

# vgs
   WARNING: Ignoring duplicate config node: filter (seeking filter)
   VG           #PV #LV #SN Attr   VSize VFree
   main_huge_vg   9   1   0 wz--n- 2.69T    0

# vgs main_huge_vg
   WARNING: Ignoring duplicate config node: filter (seeking filter)
   VG           #PV #LV #SN Attr   VSize VFree
   main_huge_vg   9   1   0 wz--n- 2.69T    0

# pvs
   WARNING: Ignoring duplicate config node: filter (seeking filter)
   PV         VG           Fmt  Attr PSize   PFree
   /dev/sda2  main_huge_vg lvm2 a-   594.25G    0
   /dev/sdb4  main_huge_vg lvm2 a-   529.00G    0
   /dev/sdc1  main_huge_vg lvm2 a-   232.75G    0
   /dev/sdc2  main_huge_vg lvm2 a-   232.75G    0
   /dev/sdc3  main_huge_vg lvm2 a-   232.88G    0
   /dev/sdd1  main_huge_vg lvm2 a-   232.75G    0
   /dev/sdd2  main_huge_vg lvm2 a-   232.75G    0
   /dev/sdd3  main_huge_vg lvm2 a-   232.75G    0
   /dev/sdd4  main_huge_vg lvm2 a-   233.00G    0


> # echo $?
> 0
> 
> The result code should be none zero value.
> One of a script rely on this result code, and it failed to work
> because of this bug.
> 
> I have found this bug on RHEL5 (which uses lvm2.02.40-6) and
> I have checked out WHATS_NEW between 2.02-40 to 49,
> so far no similar symptom.

-- 
Scooty Puff, Sr
The Doom-Bringer

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [linux-lvm] vgs result code error
  2009-07-21  8:27 ` Ron Johnson
@ 2009-07-21  9:08   ` Masanari Iida
  2009-07-21  9:41     ` Ron Johnson
  0 siblings, 1 reply; 9+ messages in thread
From: Masanari Iida @ 2009-07-21  9:08 UTC (permalink / raw)
  To: LVM general discussion and development

Thanks for reply.

> You specified a PV, not a VG.  Try:
> # vgs vg01

Yes I know it should work.

# vgs vg01
  VG   #PV #LV #SN Attr   VSize VFree
  vg01   1   0   0 wz--n- 3.82G 3.82G


The point I want to say is,  vgs command _should_ return non-zero
exit status value, if vgs command returned an error.

Reference: man lvm(8)

DIAGNOSTICS
       All tools return a status code of zero on success or non-zero on  fail-
       ure.


Masanari

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [linux-lvm] vgs result code error
  2009-07-21  9:08   ` Masanari Iida
@ 2009-07-21  9:41     ` Ron Johnson
  2009-07-21 10:35       ` Alasdair G Kergon
  0 siblings, 1 reply; 9+ messages in thread
From: Ron Johnson @ 2009-07-21  9:41 UTC (permalink / raw)
  To: linux-lvm

On 2009-07-21 04:08, Masanari Iida wrote:
> Thanks for reply.
> 
>> You specified a PV, not a VG.  Try:
>> # vgs vg01
> 
> Yes I know it should work.
> 
> # vgs vg01
>   VG   #PV #LV #SN Attr   VSize VFree
>   vg01   1   0   0 wz--n- 3.82G 3.82G
> 
> 
> The point I want to say is,  vgs command _should_ return non-zero
> exit status value, if vgs command returned an error.

Sorry.

> Reference: man lvm(8)
> 
> DIAGNOSTICS
>        All tools return a status code of zero on success or non-zero on  fail-
>        ure.
[snip]
> I have found this bug on RHEL5 (which uses lvm2.02.40-6) and
> I have checked out WHATS_NEW between 2.02-40 to 49,
> so far no similar symptom.

Debian Sid's 2.02.44-3 returns a non-zero code, so either RH fixed 
it upstream, or Debian patched it...

# vgs --version
   WARNING: Ignoring duplicate config node: filter (seeking filter)
   LVM version:     2.02.44 (2009-01-26)
   Library version: 1.02.30 (2009-01-26)
   Driver version:  4.14.0

# vgs /dev/sdc1
   WARNING: Ignoring duplicate config node: filter (seeking filter)
   Volume group "sdc1" not found

# echo $?
5

-- 
Scooty Puff, Sr
The Doom-Bringer

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [linux-lvm] vgs result code error
  2009-07-21  9:41     ` Ron Johnson
@ 2009-07-21 10:35       ` Alasdair G Kergon
  2009-07-21 10:48         ` Ron Johnson
  0 siblings, 1 reply; 9+ messages in thread
From: Alasdair G Kergon @ 2009-07-21 10:35 UTC (permalink / raw)
  To: LVM general discussion and development

On Tue, Jul 21, 2009 at 04:41:46AM -0500, Ron Johnson wrote:
> Debian Sid's 2.02.44-3 returns a non-zero code, so either RH fixed it 
> upstream, or Debian patched it...

> # vgs /dev/sdc1
>   WARNING: Ignoring duplicate config node: filter (seeking filter)
>   Volume group "sdc1" not found
> # echo $?
> 5

That's a *different* error case that works correctly.

Yes, I agree that the original case mentioned should give EINVALID_CMD_LINE
instead of ECMD_PROCESSED.

Alasdair

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [linux-lvm] vgs result code error
  2009-07-21 10:35       ` Alasdair G Kergon
@ 2009-07-21 10:48         ` Ron Johnson
  2009-07-21 11:49           ` Masanari Iida
  0 siblings, 1 reply; 9+ messages in thread
From: Ron Johnson @ 2009-07-21 10:48 UTC (permalink / raw)
  To: linux-lvm

On 2009-07-21 05:35, Alasdair G Kergon wrote:
> On Tue, Jul 21, 2009 at 04:41:46AM -0500, Ron Johnson wrote:
>> Debian Sid's 2.02.44-3 returns a non-zero code, so either RH fixed it 
>> upstream, or Debian patched it...
> 
>> # vgs /dev/sdc1
>>   WARNING: Ignoring duplicate config node: filter (seeking filter)
>>   Volume group "sdc1" not found
>> # echo $?
>> 5
> 
> That's a *different* error case that works correctly.
> 
> Yes, I agree that the original case mentioned should give EINVALID_CMD_LINE
> instead of ECMD_PROCESSED.


 > On 2009-07-21 02:16, Masanari Iida wrote:
 > # vgs /dev/cciss/c0d3p3
 >   Invalid volume group name: cciss/c0d3p3

Hey, you're right!!

But why?  (I tried to mimic his example as best I could.)

Is it because of the multi-level device name, and the parser getting 
confused?

-- 
Scooty Puff, Sr
The Doom-Bringer

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [linux-lvm] vgs result code error
  2009-07-21 10:48         ` Ron Johnson
@ 2009-07-21 11:49           ` Masanari Iida
  2009-07-23  7:44             ` Masanari Iida
  0 siblings, 1 reply; 9+ messages in thread
From: Masanari Iida @ 2009-07-21 11:49 UTC (permalink / raw)
  To: LVM general discussion and development

> Is it because of the multi-level device name, and the parser getting confused?

Maybe, multi-level device file name canfuse vgs.
See my test.

# ls -l /dev/cciss/c0d3p3
brw-r-----  1 root disk 104, 51 Jul 22 05:21 c0d3p3

# mknod /dev/c0d3p3 b 104 51
# ls -l  /dev/c0d3p3
brw-r--r-- 1 root root 104, 51 Jul 22 05:43 /dev/c0d3p3

# vgs /dev/c0d3p3
  Volume group "c0d3p3" not found

# echo $?
5

Regards,

Masanari Iida

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [linux-lvm] vgs result code error
  2009-07-21 11:49           ` Masanari Iida
@ 2009-07-23  7:44             ` Masanari Iida
  2009-07-23  9:28               ` Masanari Iida
  0 siblings, 1 reply; 9+ messages in thread
From: Masanari Iida @ 2009-07-23  7:44 UTC (permalink / raw)
  To: LVM general discussion and development

Download lvm2-2.02.46-8.el5  from RHEL5 beta channel and tested.
I have confirmed this one is fixed.
Thanks
Masanari

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [linux-lvm] vgs result code error
  2009-07-23  7:44             ` Masanari Iida
@ 2009-07-23  9:28               ` Masanari Iida
  0 siblings, 0 replies; 9+ messages in thread
From: Masanari Iida @ 2009-07-23  9:28 UTC (permalink / raw)
  To: LVM general discussion and development

It was my mis-understood that this symptom still exist with
RHEL5.4 beta lvm2.

# rpm -q lvm2
lvm2-2.02.46-8.el5

# vgs /dev/cciss/c0d3p3
  Invalid volume group name: cciss/c0d3p3
#
# echo $?
0              <== should be non-zero

Masanari


On Thu, Jul 23, 2009@4:44 PM, Masanari Iida<standby24x7@gmail.com> wrote:
> Download lvm2-2.02.46-8.el5 �from RHEL5 beta channel and tested.
> I have confirmed this one is fixed.
> Thanks
> Masanari
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-07-23  9:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-21  7:16 [linux-lvm] vgs result code error Masanari Iida
2009-07-21  8:27 ` Ron Johnson
2009-07-21  9:08   ` Masanari Iida
2009-07-21  9:41     ` Ron Johnson
2009-07-21 10:35       ` Alasdair G Kergon
2009-07-21 10:48         ` Ron Johnson
2009-07-21 11:49           ` Masanari Iida
2009-07-23  7:44             ` Masanari Iida
2009-07-23  9:28               ` Masanari Iida

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).