Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

LVM: kernel with pseudo-device dm fails to work as expected



Hi,

I'm running into a problem while trying to use lvm. It would appear that whenever I attempt to do so with pseudo-device dm compiled in the kernel, things don't work.


NetBSD 5.99.24 (GENERIC) #1: Thu Feb 4 13:18:12 WET 2010 root@:/usr/obj/sys/arch/amd64/compile/GENERIC amd64


----------------------------------------------------------------------------------------------------------------
# diff /usr/src/sys/arch/amd64/conf/GENERIC /usr/src/sys/arch/amd64/conf/BLAH
1158a1159,1161
>
>
> pseudo-device dm
----------------------------------------------------------------------------------------------------------------


**** BLAH kernel (GENERIC + pseudo-device dm builtin ) ****

# modstat|grep dm
dm driver builtin 0 - -

# lvm vgchange -a y
Found duplicate PV NocTy4YPiwyYjss19YXT0mIEb59EeLTi: using /dev/rwd2f not /dev/rwd0f
0 logical volume(s) in volume group "xenvg0" now active
0 logical volume(s) in volume group "sysvg0" now active

dmesg output:
Unable to attach pseudo device dm/xenvg0-arcturus_sys0
Unable to attach pseudo device dm/xenvg0-procyon_sys0
Unable to attach pseudo device dm/xenvg0-procyon_data0
Unable to attach pseudo device dm/xenvg0-capella_sys0
Unable to attach pseudo device dm/xenvg0-capella_data0
Unable to attach pseudo device dm/xenvg0-sirius_sys0
Unable to attach pseudo device dm/sysvg0-root
Unable to attach pseudo device dm/sysvg0-tmp
Unable to attach pseudo device dm/sysvg0-var
Unable to attach pseudo device dm/sysvg0-usr
Unable to attach pseudo device dm/sysvg0-home
Unable to attach pseudo device dm/sysvg0-swap
Unable to attach pseudo device dm/sysvg0-usrlocal

# head /dev/xenvg0/arcturus_sys0
head: /dev/xenvg0/arcturus_sys0: Device not configured



**** GENERIC kernel (dm dynamically loaded as a module) ****

# lvm vgchange -a y
Found duplicate PV NocTy4YPiwyYjss19YXT0mIEb59EeLTi: using /dev/rwd2f not /dev/rwd0f
6 logical volume(s) in volume group "xenvg0" now active
7 logical volume(s) in volume group "sysvg0" now active

# modstat | grep dm
dm driver filesys 0 20968 -

# head /dev/xenvg0/arcturus_sys0
ï<ïNetBSD401ïïïïRïZïïïïïf1ïfïf;|tpf1ïf1ïïïïEfïf.ï}<ïu
fïïtTf9ïtO<<t<ïufïïïïïïuïgïfïïufïïfïfïï}ïïïïfïïïw}tLf1ïfï6ï}ï7ïïuïMïuïNfï.ï}fïïuARïïEPïïïïïBïïïUïïï?ïïZïï?ïHZ9ïtïïPïP}ïz^ïvïW}ïpïïïïïfï>
ïïïxïd}uïfïïï
`ïï}ïBïaïZ}rïïï`ïïïError
Disk readNot a bootxx imageNo NetBSD partition`ïïïïïïïuïaïUïWEVïXen Virtual ESDWEVïïï $ïïï~ïïïïïxxï%ïïfïïï ïL )ïïï1ïïïïïïVïïRVRïïïïïïufZf[fï



There is one important detail that I must not ommit: These lvms were created / managed by a Linux Xen dom0 - I'm booting NetBSD off the 3rd disk in this machine, for testing. The LVM code picked up the Linux lvms (not surprising).

Thinking this might be part of the problem, I tried:

# lvm pvcreate /dev/rwd1h
Found duplicate PV NocTy4YPiwyYjss19YXT0mIEb59EeLTi: using /dev/rwd2f not /dev/rwd0f
Physical volume "/dev/rwd1h" successfully created

# lvm vgcreate testvg0 /dev/rwd1h

# lvm lvcreate -L10M -n testlv0 testvg0
Found duplicate PV NocTy4YPiwyYjss19YXT0mIEb59EeLTi: using /dev/rwd2f not /dev/rwd0f
Rounding up size to full physical extent 12.00 MiB
Logical volume "testlv0" created

# dd if=/dev/urandom of=/tmp/test bs=1m count=12
# dd if=/tmp/test of=/dev/testvg0/rtestlv0

# md5 /tmp/test
MD5 (/tmp/test) = f4cf289a4ee09959583a800b742add7f

# md5 /dev/testvg0/testlv0
MD5 (/dev/testvg0/testlv0) = f4cf289a4ee09959583a800b742add7f

It worked as expected - using GENERIC.

*** Rebooting back into GENERIC, to be sure:

# md5 /dev/testvg0/testlv0
md5: /dev/testvg0/testlv0: Input/output error

# lvm vgchange -a y
Found duplicate PV NocTy4YPiwyYjss19YXT0mIEb59EeLTi: using /dev/rwd2f not /dev/rwd0f
6 logical volume(s) in volume group "xenvg0" now active
7 logical volume(s) in volume group "sysvg0" now active
1 logical volume(s) in volume group "testvg0" now active

# md5 /dev/testvg0/testlv0
MD5 (/dev/testvg0/testlv0) = f4cf289a4ee09959583a800b742add7f

*** Now with BLAH (GENERIC + dm builtin):

# lvm vgchange -a y
Found duplicate PV NocTy4YPiwyYjss19YXT0mIEb59EeLTi: using /dev/rwd2f not /dev/rwd0f
0 logical volume(s) in volume group "xenvg0" now active
0 logical volume(s) in volume group "sysvg0" now active
0 logical volume(s) in volume group "testvg0" now active

and in dmesg:
Unable to attach pseudo device dm/xenvg0-arcturus_sys0
Unable to attach pseudo device dm/xenvg0-procyon_sys0
Unable to attach pseudo device dm/xenvg0-procyon_data0
Unable to attach pseudo device dm/xenvg0-capella_sys0
Unable to attach pseudo device dm/xenvg0-capella_data0
Unable to attach pseudo device dm/xenvg0-sirius_sys0
Unable to attach pseudo device dm/sysvg0-root
Unable to attach pseudo device dm/sysvg0-tmp
Unable to attach pseudo device dm/sysvg0-var
Unable to attach pseudo device dm/sysvg0-usr
Unable to attach pseudo device dm/sysvg0-home
Unable to attach pseudo device dm/sysvg0-swap
Unable to attach pseudo device dm/sysvg0-usrlocal
Unable to attach pseudo device dm/testvg0-testlv0


Unfortunately, modload'ing dm as a workaround doesn't work in my situation, because of something unrelated: I can't seem to load ANY modules under a Xen dom0 kernel:

# modload dm
modload: Cannot allocate memory

Thoughts?

Best regards,

Hugo



Home | Main Index | Thread Index | Old Index