vgcreate --> "Command failed with status code 5." what does this mean?

16,893

Solution 1

I was having this same problem with a CentOS recovery disc on a Xen system. Turns out the error code is due to a read-only file system, specifically /etc/lvm is read-only. Quick fix, as suggested by this blog entry, is to create a tmpfs over /etc/lvm to enable writing. This worked for me.

Solution 2

from the comments it looks like your pv is already corrupt: Total PE 0. recreate your pv and try it again.

Solution 3

For future reference, try:

vgcreate -v main /dev/xvda1

To get more idea of what is going wrong. In my case, the error occurred because /etc/lvm wasn't writeable to create backups.

Share:
16,893

Related videos on Youtube

erik
Author by

erik

Updated on September 17, 2022

Comments

  • erik
    erik almost 2 years

    i'm playing around w/ LVM on a centos domU in a xen-based vps. I'm in rescue mode and I've created one physical volume (pvcreate /dev/xvda1) for my entire drive, which is formatted as LVM. i'm now trying to create a volume group using vgcreate main /dev/xvda1, but it's returning "Command failed with status code 5.". I've been unable to find an explanation for this error code. does anyone know what it means?

    for what it's worth, my goal is to create multiple logical volumes on my drive using lvm.

    thanks

    • Matt Simmons
      Matt Simmons over 14 years
      You mean that the partition type is LVM, right?
    • Matt Simmons
      Matt Simmons over 14 years
      What happens when you type "pvdisplay"?
    • erik
      erik over 14 years
      thank for the help, Matt. yes, the partition type is lvm. running pvdisplay outputs (this displays badly, so I'm using | to denote an endline): "/dev/xvda1" is a new physical volume of "6.00 GB" | --- NEW Physical volume --- | PV Name /dev/xvda1 | VG Name | PV Size 6.00 GB | Allocatable NO | PE Size (KByte) 0 | Total PE 0 | Free PE 0 | Allocated PE 0 | PV UUID sMR01N-ZFqb-Us3J-IhMj-FI1V-WjdV-r70yhQ |
    • erik
      erik over 14 years
      found this: pwet.fr/man/linux/administration_systeme/lvm_10/vgcreate it says "5 (denotes) maximum number of volume groups exceeded", but vgscan shows nothing
    • womble
      womble over 14 years
      Poor formatting in comments is why you're supposed to edit your question to add information like that.
    • BuildTheRobots
      BuildTheRobots over 14 years
      vgcreate -d main /dev/bla -the -d flag will give you debugging into.
  • pevik
    pevik over 7 years
    In my case the problem was read only partition with /etc/lvm/. vgcreate failed when it was trying to write /etc/lvm/archive.