Unable to create lvm1 configurations
Hi all:
I have LVM2 installed, and I tried to create lvm1 configurations using the following command:
[root@DAP-RHLNX1 tools]# vgcreate -v --metadatatype 1 vg1-lvm2 /dev/hda6 /dev/hda7
Invalid argument 1
Error during parsing of command line.
[root@DAP-RHLNX1 tools]#
However, passing into "2" as the metadatatype would succeed.
[root@DAP-RHLNX1 tools]# vgcreate -v --metadatatype 2 vg1-lvm2 /dev/hda6 /dev/hda7
Adding physical volume '/dev/hda6' to volume group 'vg1-lvm2' Adding physical volume '/dev/hda7' to volume group 'vg1-lvm2' Archiving volume group "vg1-lvm2" metadata. Creating volume group backup "/etc/lvm/backup/vg1-lvm2"
Volume group "vg1-lvm2" successfully created
[root@DAP-RHLNX1 tools]#
Does anyone what the problem is?
What is the best way to create LVM1 configurations?
Stanley
Quoted 4 lines · Stanley Yue
[root@DAP-RHLNX1 tools]# vgcreate -v --metadatatype 1 vg1-lvm2
/dev/hda6/dev/hda7
Invalid argument 1
Error during parsing of command line.
Works for me.
Perhaps support for 'lvm1' metadata was not compiled in, or not loaded from lvm.conf if you configured it shared?
Alasdair
Signature · 1 line
[email protected]
Thanks Alasdair, it turns out that have to explicitly enable lvm1 support by:
./configure --with-lvm1=internal
However, now, I'm seeing the following problem.
I have installed both lvm1 and lvm2 utilities onto the same system, with the lvm-mod and device-mapper from lvm2. I want to test out whether lvm2 utilities can detect configurations created from lvm1 utilities.
+ pvcreate fails when I'm using the lvm1 utilities.
[root@DAP-RHLNX1 sbin]# ./vgscan -v
vgscan -- removing "/etc/lvmtab" and "/etc/lvmtab.d"
vgscan -- creating empty "/etc/lvmtab" and "/etc/lvmtab.d"
vgscan -- reading all physical volumes (this may take a while...) vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully created vgscan -- WARNING: This program does not do a VGDA backup of your volume group
[root@DAP-RHLNX1 sbin]# ./pvcreate /dev/hda7
pvcreate -- ERROR: VGDA in kernel and lvmtab are NOT consistent; please run vgscan
+ However, pvcreate succeed when I'm using the lvm2's pvcreate
[root@DAP-RHLNX1 sbin]# pvcreate /dev/hda7
Physical volume "/dev/hda7" successfully created
Is there anything wrong with my setup here? Does lvm1 utilities work with lvm-mod from lvm2?
How can I resync the state between the VGDA in kernel and lvmtab? Do anyone know how I can get it to work with lvm1's pvcreate?
Thanks,
Stanley
Quoted 15 lines · Alasdair G Kergon
Quoted 4 lines · Stanley Yue
[root@DAP-RHLNX1 tools]# vgcreate -v --metadatatype 1 vg1-lvm2
/dev/hda6/dev/hda7
Invalid argument 1
Error during parsing of command line.Works for me.
Perhaps support for 'lvm1' metadata was not compiled in, or not loaded from lvm.conf if you configured it shared?
Alasdair
--
[email protected]
Quoted 6 lines · Stanley Yue
with the lvm-mod and device-mapper from lvm2. I want to test out whether lvm2 utilities can detect configurations created from lvm1 utilities.
pvcreate -- ERROR: VGDA in kernel and lvmtab are NOT consistent; please run vgscan
Never run LVM2 utilities while you have LVs active under LVM1. Never run LVM1 tools while you have LVs active under LVM2.
i.e. Never mix use of the two, and always vgchange -an before switching between LVM1 and LVM2.
Also, if switching back from LVM2 to LVM1 you must first reset the LVM1 driver with lvmchange -R followed by vgscan -f.
Alasdair
Signature · 1 line
[email protected]
Thanks Alasdair, your suggestion work.
However, I'm encountering yet another problem....;p Looks like device-mapper always return an error on "cmd 13" when I tried to create a lv:
[root@DAP-RHLNX1 2.4.21]# lvcreate -v -L 32 -n syueVol vg00-lvm1
device-mapper ioctl cmd 13 failed: Invalid argument device-mapper ioctl cmd 13 failed: Invalid argument
Finding volume group "vg00-lvm1"
Creating logical volume syueVol
Archiving volume group "vg00-lvm1" metadata. Creating volume group backup "/etc/lvm/backup/vg00-lvm1" Found volume group "vg00-lvm1"
Loading vg00--lvm1-syueVol
Zeroing start of logical volume "syueVol"
Creating volume group backup "/etc/lvm/backup/vg00-lvm1"
Logical volume "syueVol" created
[root@DAP-RHLNX1 2.4.21]#
Here are the version information:
=========================
LVM version 2.2.00.22
Device Mapper version 1.00.18
Does anyone know what the problem is?
Thanks,
Stanley
Quoted 20 lines · Alasdair G Kergon
Quoted 6 lines · Stanley Yue
with the lvm-mod and device-mapper from lvm2. I want to test out whether lvm2 utilities can detect configurations created from lvm1 utilities.
pvcreate -- ERROR: VGDA in kernel and lvmtab are NOT consistent; please run vgscan
Never run LVM2 utilities while you have LVs active under LVM1. Never run LVM1 tools while you have LVs active under LVM2.
i.e. Never mix use of the two, and always vgchange -an before switching between LVM1 and LVM2.
Also, if switching back from LVM2 to LVM1 you must first reset the LVM1 driver with lvmchange -R followed by vgscan -f.Alasdair
--
[email protected]
Quoted 1 line · Stanley Yue
device-mapper ioctl cmd 13 failed: Invalid argument
13 is DM_LIST_VERSIONS_CMD
Newer versions of device-mapper support this, but the tools cope fine without it.
But it is an indication you're not running the latest kernel and you ought to update it:-)
Alasdair
Signature · 1 line
[email protected]