1828387 Members
3106 Online
109977 Solutions
New Discussion

lvm pvreate error

 
rich turner
Occasional Advisor

lvm pvreate error

i am trying to create a physical volume on /dev/hdb using:
pvcreate -ff -y /dev/hdb

it generates the following error:
pvcreate -- device "/dev/hdb" has a partition table

my understanding is that pvcreate examines the /proc/partitions file for partition table. currently my /proc/partitions table has an entry for /dev/hdb as ...target1/disc with no part#s. i have tried:
dd if=/dev/zero of=/dev/hdb bs=1k count=1
blockdev --rereadpt /dev/hdb

nothing i can find indicates that there is a prtition table on /dev/hdb, however pvcreate is still detecting one.

is there something i am missing that pvcreate is finding? is this a lvm-devfs issue?

using lvm 1.0.1 and mandrake8.2 kernel 2.4.18-6.
5 REPLIES 5
Stuart Browne
Honored Contributor

Re: lvm pvreate error

what does 'sfdisk -l /dev/hdb' return?
One long-haired git at your service...
U.SivaKumar_2
Honored Contributor

Re: lvm pvreate error

Hi,

do this

#dd if=/dev/zero of=/dev/hdb bs=1k count=1

#blockdev --rereadpt /dev/hdb

reboot the sysem.


now give pvcreate command.

regards,
U.SivaKumar





Innovations are made when conventions are broken
rich turner
Occasional Advisor

Re: lvm pvreate error

thanks, for the replies and help. i have tried to write zero's to mbr with the same dd and blockdev commands you suggested. still no success.

below are the contents of my /proc/partitions which pvcreate investigates for partition tables.

22 0 15972 hdc
3 0 20066251 /ide/host0/bus0/tartet0/lun0/disc
3 1 313267 /ide/host0/bus0/tartet0/lun0/part1
3 2 265072 /ide/host0/bus0/tartet0/lun0/part2
3 3 1 /ide/host0/bus0/tartet0/lun0/part3
3 5 3076416 /ide/host0/bus0/tartet0/lun0/part5
3 64 20066251 /ide/host0/bus0/tartet1/lun0/disc

as far as i can tell using fdisk -l, sfdisk -l, and looking at /proc/partitions, there is no partition table. what is pvcreate seeing that i am missing?

keep in mind, the kernel 2.4.18-6 that i am using was created with devfs enabled. however, when i am trying to create the physical volume devfs is NOT active. is it the case that pvcreate does not recognize hdb as "disc" because devfs is not active? is there some special fix or patch required for lvm to function correctly with devfs? devfs does not use the traditional /dev/hdb naming convention so that is where i am thinking my problems are. but i just dont know for sure.
John Meissner
Esteemed Contributor

Re: lvm pvreate error

Just an FYI - I was talking to a Red Hat rep and a Red Hat engineer - both of them told me that LVM was know to cause data corruption in Linux - they are working on fixing this bug but to date it still exists. That's why they didn't put it in their professional version.

Just thought you guys would like to know
All paths lead to destiny
Vincent Stedema
Esteemed Contributor

Re: lvm pvreate error

Hi,

I had a problem on a gentoo system in that I could do a pvcreate on /dev/hda, but not use vgcreate to create a vg containing this pv. The issue was resolved by using the devfs name during the vgcreate.

I'm not sure if this will work in your case, as you have devfs tunred off. But you could of course give it a try...

Regards,

Vincent