[linux-lvm] vgcreate fails with return value 5

Bryn M. Reeves bmr at redhat.com
Wed Oct 13 10:57:17 UTC 2010


On 10/11/2010 07:21 PM, Riches Jr, RobertX M wrote:
> I’m running into an odd problem in which vgcreate fails with a return value or 
> exit code of 5. It is called from a script that calls pvcreate twice to create 
> two PVs, then immediately calls vgcreate to create the VG.

Exit status 5 just means "command failed":

$ grep -r ECMD_FAILED ~/cvs/LVM2/lib/commands/errors.h
#define ECMD_FAILED		5

> An exit code of 5 appears to indicate excessive numbers of VGs. However, there 
> are no other VGs on the system prior to this call to vgcreate. Search engine 

There are hundreds of possible reasons for this error:

$ grep -r ECMD_FAILED ~/cvs/LVM2/ | wc -l
271

> results indicate the PV might be corrupt. However, the PV was just created a few 
> milliseconds before calling vgcreate.

The tools normally output a more descriptive error indicating what went
wrong. If for some reason you are not getting anything helpful add more
verbosity (e.g. -vvvv) to try to understand where it's failing.

Regards,
Bryn.




More information about the linux-lvm mailing list