Skip to contentSkip to conversation

Problem with LVM over RAID-1

linux-lvm Urs Thuermann 5 participants 7 messages Oct 14, 2001 – Oct 15, 2001 Library code

lore
Share & tools
lore
#0 lore raw

This problem has occrued on this mailing list before by another user but I haven't read a solution to it here.

We want to setup LVM over a RAID-1 array, i.e. LVM on /dev/md0. But the pvcreate on /dev/md0 fails:

    oker:~# uname -a
    Linux oker 2.4.7oker #1 SMP Sat Oct 13 18:31:47 CEST 2001 i586 unknown
    oker:~# dmesg|grep -i lvm
    LVM version 0.9.1_beta2  by Heinz Mauelshagen  (18/01/2001)
    lvm -- Driver successfully initialized
    oker:~# pvcreate --version
    pvcreate: Logical Volume Manager 1.0.1-rc3
    Heinz Mauelshagen, Sistina Software  01/10/2001 (IOP 10)
    oker:~# grep md/0 /proc/partitions 
       9     0   17775808 md/0
    oker:~# pvcreate -v /dev/md0
    pvcreate -- locking logical volume manager
    pvcreate -- checking physical volume name "/dev/md0"
    pvcreate -- getting physical volume size
    pvcreate -- device "/dev/md0" has a partition table

pvcreate [-d|--debug] [-f[f]|--force [--force]] [-h|--help] [-y|--yes]
[-v|--verbose] [--version] PhysicalVolume [PhysicalVolume...]

oker:~# dd if=/dev/zero of=/dev/md0 count=256 bs=512 256+0 records in
256+0 records out
oker:~# pvcreate -v /dev/md0
pvcreate -- locking logical volume manager pvcreate -- checking physical volume name "/dev/md0" pvcreate -- getting physical volume size pvcreate -- device "/dev/md0" has a partition table

pvcreate [-d|--debug] [-f[f]|--force [--force]] [-h|--help] [-y|--yes]
[-v|--verbose] [--version] PhysicalVolume [PhysicalVolume...]

However, /dev/md0 seems to be ok. I can dd to/from it, I can mkfs on it. The RAID-array is configured as

    oker:~# cat /etc/raidtab 
    raiddev /dev/md0
    	    raid-level              1
    	    nr-raid-disks           2
    	    nr-spare-disks          0
    	    chunk-size              4
    	    persistent-superblock   1
    	    device                  /dev/sdb3
    	    raid-disk               0
    	    device                  /dev/sda3
    	    failed-disk             1

/dev/sda3 is marked as "failed" currently, since there is now an ext2 FS on sda3 on which the system was installed and is currently running (debain sid, BTW). We plan to install LVM on /dev/md0, copy everything over to it and then mirror sdb3 to sda3.

Can anyone help us with creating a PV on /dev/md0, please?

Another question on Linux-Software RAID-1: We want to use it to get more reliability by mirroring. But I'd like to know if the Linux kernel will also make use of both disks to increase the read performance, i.e. when reading a large file, read some parts from one disk, other parts from the other disk. Or when accessing two files, read one file from one disk and the other file from the second disk. Will the Linux kernel do this?

urs

#1 lore raw
Quoted 10 lines

LVM version 0.9.1_beta2 by Heinz Mauelshagen (18/01/2001)
lvm -- Driver successfully initialized

   oker:~# pvcreate --version
   pvcreate: Logical Volume Manager 1.0.1-rc3
   Heinz Mauelshagen, Sistina Software  01/10/2001 (IOP 10)

pvcreate -- device "/dev/md0" has a partition table

my guess is, try with lvm-1.0.1rc4 but patch the kernel too
i had the same problems and this solved them
if this doesn't help you can try instaling a Mandrake partitioning tool diskdrake, with the older version you could change the partition id of md to 8e (lvm) but sadly the current version doesn't support it

good luck

Quoted 2 lines
#2 lore raw
In reply to Urs Thuermann
Quoted 11 lines · Urs Thuermann

This problem has occrued on this mailing list before by another user but I haven't read a solution to it here.
[...]
Another question on Linux-Software RAID-1: We want to use it to get more reliability by mirroring. But I'd like to know if the Linux kernel will also make use of both disks to increase the read performance, i.e. when reading a large file, read some parts from one disk, other parts from the other disk. Or when accessing two files, read one file from one disk and the other file from the second disk. Will the Linux kernel do this?

As far as I remember, Linux software RAID-1 implementation indeed uses all of the drives in parallel to increase read performance (at least, on 2.2.x an 2.4.x kernels). As read on Software-RAID-HOWTO (2.3. The RAID levels):

* Write performance is the slightly worse than on a single device,
* because identical copies of the data written must be sent to every
* disk in the array. Read performance is usually pretty bad because of
* an oversimplified read-balancing strategy in the RAID code. However,
* there has been implemented a much improved read-balancing strategy,
* which might be available for the Linux-2.2 RAID patches (ask on the
* linux-kernel list), and which will most likely be in the standard
* 2.4 kernel RAID support.

So, to be sure, you should build a RAID-1 array with your current kernel and test read performance, and compare results with those for a single drive (use bonnie, for example). Maybe in the linux-raid mailing list archives is something interesting:
http://www.mail-archive.com/linux-raid%40vger.kernel.org

Signature · 5 lines
Jos� Luis Domingo L�pez
Linux Registered User #189436     Debian Linux Woody (P166 64 MB RAM)
 
jdomingo EN internautas PUNTO org  => � Spam ? Atente a las consecuencias
jdomingo AT internautas DOT   org  => Spam at your own risk
#3 lore raw
In reply to Urs Thuermann

You may want to look at the "[linux-lvm] pvcreate fails on a software RAID metadisk" thread.
There is something going wrong in lvm_check_partitioned_dev. AFAIK the problem is being investigated. Since you probably don't want to partition any of your MD devices, the following patch should do it. It just tells LVM to use the whole device.
I've got that running... (2.4.10/1.0.1-rc4).
Hope it helps.
Yves
------------------------------------------------------------------------

lib/lvm_check_partitioned_dev.c renamed from lib/lvm_check_partitioned_dev.c.bluca +2 -0
@@ -55,6 +55,8 @@
 	switch (lvm_get_device_type(st_rdev)) {
 	case LVM_DEVICE_TYPE_INVALID:
 	    break;
+	case LVM_DEVICE_TYPE_MD:
+	    break;
 	default:
 	    ret = TRUE;
 	}

------------------------------------------------------------------------

Quoted 89 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of Urs Thuermann
Sent: Sunday, October 14, 2001 11:01 AM
To: [email protected]
Subject: [linux-lvm] Problem with LVM over RAID-1

This problem has occrued on this mailing list before by another user but I haven't read a solution to it here.

We want to setup LVM over a RAID-1 array, i.e. LVM on /dev/md0. But the pvcreate on /dev/md0 fails:

    oker:~# uname -a
    Linux oker 2.4.7oker #1 SMP Sat Oct 13 18:31:47 CEST 2001 i586 unknown
    oker:~# dmesg|grep -i lvm
    LVM version 0.9.1_beta2  by Heinz Mauelshagen  (18/01/2001)
    lvm -- Driver successfully initialized
    oker:~# pvcreate --version
    pvcreate: Logical Volume Manager 1.0.1-rc3
    Heinz Mauelshagen, Sistina Software  01/10/2001 (IOP 10)
    oker:~# grep md/0 /proc/partitions
       9     0   17775808 md/0
    oker:~# pvcreate -v /dev/md0
    pvcreate -- locking logical volume manager
    pvcreate -- checking physical volume name "/dev/md0"
    pvcreate -- getting physical volume size
    pvcreate -- device "/dev/md0" has a partition table

pvcreate [-d|--debug] [-f[f]|--force [--force]] [-h|--help] [-y|--yes]
[-v|--verbose] [--version] PhysicalVolume [PhysicalVolume...]

oker:~# dd if=/dev/zero of=/dev/md0 count=256 bs=512 256+0 records in
256+0 records out
oker:~# pvcreate -v /dev/md0
pvcreate -- locking logical volume manager pvcreate -- checking physical volume name "/dev/md0" pvcreate -- getting physical volume size pvcreate -- device "/dev/md0" has a partition table

pvcreate [-d|--debug] [-f[f]|--force [--force]] [-h|--help] [-y|--yes]
[-v|--verbose] [--version] PhysicalVolume [PhysicalVolume...]

However, /dev/md0 seems to be ok. I can dd to/from it, I can mkfs on it. The RAID-array is configured as

    oker:~# cat /etc/raidtab
    raiddev /dev/md0
    	    raid-level              1
    	    nr-raid-disks           2
    	    nr-spare-disks          0
    	    chunk-size              4
    	    persistent-superblock   1
    	    device                  /dev/sdb3
    	    raid-disk               0
    	    device                  /dev/sda3
    	    failed-disk             1

/dev/sda3 is marked as "failed" currently, since there is now an ext2 FS on sda3 on which the system was installed and is currently running (debain sid, BTW). We plan to install LVM on /dev/md0, copy everything over to it and then mirror sdb3 to sda3.

Can anyone help us with creating a PV on /dev/md0, please?

Another question on Linux-Software RAID-1: We want to use it to get more reliability by mirroring. But I'd like to know if the Linux kernel will also make use of both disks to increase the read performance, i.e. when reading a large file, read some parts from one disk, other parts from the other disk. Or when accessing two files, read one file from one disk and the other file from the second disk. Will the Linux kernel do this?

urs

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html

#4 lore raw
Quoted 2 lines · yves.alloyer

You may want to look at the "[linux-lvm] pvcreate fails on a software RAID metadisk" thread.

the fix mentioned by Yves has been checked into CVS. please check instructions at http://www.sistina.com/products_CVS.htm
to use current CVS version

L.

Signature · 6 lines
Luca Berra -- [email protected]
        Communication Media & Services S.r.l.
 /"\
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL
 / \
#5 lore raw

Sorry, didn't know that.
Yves

Quoted 32 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of Luca Berra
Sent: Monday, October 15, 2001 2:08 PM
To: [email protected]
Subject: Re: [linux-lvm] Problem with LVM over RAID-1

Quoted 1 line · yves.alloyer

You may want to look at the "[linux-lvm] pvcreate fails on a

software RAID

Quoted 1 line

metadisk" thread.

the fix mentioned by Yves has been checked into CVS. please check instructions at http://www.sistina.com/products_CVS.htm
to use current CVS version

L.

Signature · 12 lines
Luca Berra -- [email protected]
        Communication Media & Services S.r.l.
 /"\
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL
 / \

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html
#6 lore raw
In reply to yves.alloyer
Quoted 6 lines · yves.alloyer

There is something going wrong in lvm_check_partitioned_dev. AFAIK the problem is being investigated. Since you probably don't want to partition any of your MD devices, the following patch should do it. It just tells LVM to use the whole device.
I've got that running... (2.4.10/1.0.1-rc4).
Hope it helps.

Thank you (and all others you have replied to my question). We have looked into the source, too, and did a similar but very dirty patch, just to get it to work. We just inserted a return 0. We'll consider upgrading to the CVS version.

Thanks again
urs