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

link|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
show 1 more comment
feedback

4 Answers

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

link|improve this answer
feedback


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).

link|improve this answer
feedback

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.

link|improve this answer
feedback

I had the same error and didn't got the clue how to fix it. But when I started aptitude, it said it has no rights to write. So for lvm on the same volume there was the same problem.

Why this happend? I umounted and remounted a filesystem, but it was like unmounted.

After a reboot it was normally mounted by the fstab file. After that the write rights were back again and everything was fine.

Greetings JPee

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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