[linux-lvm] LVM can't detect raid-1 mirrors?

Hadmut Danisch hadmut at danisch.de
Mon Jul 18 09:02:26 UTC 2005


Hi,

I need some help with a strange lvm problem:

I want to put LVM on a Linux Raid-1 device. I already did this several
times successfully. But this time I have a strange problem:

The raid device is /dev/md3, and it should consist of the two partitions
/dev/hda3 and /dev/hdc3.

I created the raid device with just /dev/hdc3, second missing,
then pvcreate /dev/md3 and created the volume group 'raid'. 
Works well. 

pvscan correctly shows the raid device instead of /dev/hdc3:

sodom# pvscan
  PV /dev/hdc4   VG nord   lvm2 [58,59 GB / 33,59 GB free]
  PV /dev/md3    VG raid   lvm2 [54,35 GB / 21,35 GB free]
  Total: 2 [112,94 GB] / in use: 2 [112,94 GB] / in no VG: 0 [0   ]




(ignore hdc4, it is just another lvm because hdc is larger than 
hda, there is no problem with hdc4)



But as soon as I add /dev/hda3 to the raid system (mdad /dev/md3 -a
/dev/hda3), lvm confuses the partitions. It does not detect /dev/md3
anymore and complains that there are two different partitions with the
same ID:

sodom# pvscan
  Found duplicate PV 39jeBxsxpKtJrwP6FN3Yvq6zB7khU6Pa: using /dev/hdc3
  not /dev/hda3
  PV /dev/hdc4   VG nord   lvm2 [58,59 GB / 33,59 GB free]
  PV /dev/hda3   VG raid   lvm2 [54,35 GB / 21,35 GB free]
  Total: 2 [112,94 GB] / in use: 2 [112,94 GB] / in no VG: 0 [0   ]


The volume group can't then be used. As soon as I take out /dev/hda3
and wipe the first sectors, everything is ok again.



Any idea what's going wrong here?



Just in case it matters, the partition tables:

sodom# sfdisk -l /dev/hda

Disk /dev/hda: 116301 cylinders, 16 heads, 63 sectors/track
Warning: The partition table looks like it was made
  for C/H/S=*/255/63 (instead of 116301/16/63).
For this listing I'll assume that geometry.
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting
from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/hda1          0+    100     101-    811251   fd  Linux raid autodetect
/dev/hda2        101     201     101     811282+  fd  Linux raid autodetect
/dev/hda3        202    7296    7095   56990587+  fd  Linux raid autodetect
/dev/hda4          0       -       0          0    0  Empty






sodom# sfdisk -l /dev/hdc

Disk /dev/hdc: 238216 cylinders, 16 heads, 63 sectors/track
Warning: The partition table looks like it was made
  for C/H/S=*/255/63 (instead of 238216/16/63).
For this listing I'll assume that geometry.
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting
from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/hdc1          0+    100     101-    811251   fd  Linux raid autodetect
/dev/hdc2        101     201     101     811282+  fd  Linux raid autodetect
/dev/hdc3        202    7296    7095   56990587+  fd  Linux raid autodetect
/dev/hdc4       7297   14945    7649   61440592+  8e  Linux LVM

regards
Hadmut






More information about the linux-lvm mailing list