Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
    
You mean that the partition type is LVM, right? –  Matt Simmons Jan 8 '10 at 7:10
    
What happens when you type "pvdisplay"? –  Matt Simmons Jan 8 '10 at 7:11
    
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 Jan 8 '10 at 7:41
    
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 –  erik Jan 8 '10 at 7:52
    
Poor formatting in comments is why you're supposed to edit your question to add information like that. –  womble Jan 8 '10 at 8:15

4 Answers 4

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.

share|improve this answer

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

share|improve this answer


Christion is certainly right. In addition, you can probably start playing with lvm using system-config-lvm, before going deeper with the command-line (of course, not in rescue mode).

share|improve this answer

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|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.