linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Setup for RAID1 with LVM
@ 2001-02-08 11:12 Jens Bruckmann
  2001-02-08 13:51 ` James
  2001-02-08 19:15 ` Andreas Dilger
  0 siblings, 2 replies; 10+ messages in thread
From: Jens Bruckmann @ 2001-02-08 11:12 UTC (permalink / raw)
  To: linux-lvm

Dear LVM-Specialists,

I would like to setup a configuration with LVM and RAID1. Poorly you
can't just do a lvextend -m 1 like on HP-UX :-))

I could not find any hints so far for a step by step description, the
part has to be included in the LVM-Howto.

I have two SCSI-Disks of nearly the same size, on Disk 1 I already have
a working installation of Linux.

/usr, /opt and /var reside on LVs. I want these three LVs to be mirrored
online to the second disk as it is possible on HP-UX.

Can someone shortly describe, how to setup such a configuration?


Thanks for help,

	Jens

-- 
-----------------------------------------------------------------------
Jens Bruckmann              .-.       Mail:    jens.bruckmann@suse.de
SuSE Linux Solutions AG     /v\       Phone:   +49 - 40 - 89 69 82 18
Friesenweg 5F              // \\      Fax:     +49 - 40 - 85 40 04 35
D-22763 Hamburg           /(   )\
                           ^^-^^      
-----------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [linux-lvm] Setup for RAID1 with LVM
  2001-02-08 11:12 [linux-lvm] Setup for RAID1 with LVM Jens Bruckmann
@ 2001-02-08 13:51 ` James
  2001-02-08 19:15 ` Andreas Dilger
  1 sibling, 0 replies; 10+ messages in thread
From: James @ 2001-02-08 13:51 UTC (permalink / raw)
  To: linux-lvm

I'm not an expert to say the least and I have only known raid and LVM for
few weeks but
from what I have managed to do myself, it is pretty straigt forward.
I am using Debian kernel 2.4.1 (with Raid, LVM, and reiserfs support)
The lvm tools are lvm_0.9.1_beta3. Unfortunatly what you are attempting to
do, transfer an existing (working) system to a mirrored system. I haven't
tried, and probably won't :-)

2 x 20gb drives hda hdb

On hda do a small install on the first partition of 500mb, and a swap, hdb
partitioned in the same way with the swap active. 
Setup the Raid (kernel etc) reboot on that kernel of course. Install the
lvm stuff. 

Then I do this :-)

hda / 500
    /swap 512
    / (the rest RAID auto)	

hdb /500
    /swap 512
    / (The rest RAID auto)

Setup the raidtab business.
Reboot, and normaly I can create an md device with hda3 and hdb3. 
Then pvcreate /dev/md0
Then vgcreate toto /dev/md0
Then lvcreate my /dev/toto/usr /var /home etc...
Format them or reiser them as in my case.
copy everything from /xxx /dev/toto/xxx using the super command
find . |cpio -pm /mnt

Then I have something like this.

Filesystem            Size  Used Avail Use% Mounted on
/dev/hda1             656M  421M  202M  68% /
/dev/lvdev/home       484M   23k  459M   0% /home
/dev/lvdev/var        484M   22M  437M   5% /var
/dev/lvdev/usr        484M  422M   37M  92% /usr

At the moment I am trying to decide if this is any use to me :-) I would
also like to be able to mirror the / but I haven't been able to yet(any
help gratefully recieved). And I don't know if this is how others are
doing it.

Comments more than welcome, I would like to perfect thsi :-)

James


On Thu, 8 Feb 2001, Jens Bruckmann wrote:

> Dear LVM-Specialists,
> 
> I would like to setup a configuration with LVM and RAID1. Poorly you
> can't just do a lvextend -m 1 like on HP-UX :-))
> 
> I could not find any hints so far for a step by step description, the
> part has to be included in the LVM-Howto.
> 
> I have two SCSI-Disks of nearly the same size, on Disk 1 I already have
> a working installation of Linux.
> 
> /usr, /opt and /var reside on LVs. I want these three LVs to be mirrored
> online to the second disk as it is possible on HP-UX.
> 
> Can someone shortly describe, how to setup such a configuration?
> 
> 
> Thanks for help,
> 
> 	Jens
> 
> -- 
> -----------------------------------------------------------------------
> Jens Bruckmann              .-.       Mail:    jens.bruckmann@suse.de
> SuSE Linux Solutions AG     /v\       Phone:   +49 - 40 - 89 69 82 18
> Friesenweg 5F              // \\      Fax:     +49 - 40 - 85 40 04 35
> D-22763 Hamburg           /(   )\
>                            ^^-^^      
> -----------------------------------------------------------------------
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@sistina.com
> http://lists.sistina.com/mailman/listinfo/linux-lvm
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [linux-lvm] Setup for RAID1 with LVM
@ 2001-02-08 13:56 Jean-Eric Cuendet
  2001-02-08 20:51 ` Heinz J. Mauelshagen
  0 siblings, 1 reply; 10+ messages in thread
From: Jean-Eric Cuendet @ 2001-02-08 13:56 UTC (permalink / raw)
  To: 'linux-lvm@sistina.com'

Hi,
To do that:
- create a md0 RAID1 device with your 2 disks (mirror, no use of LVM)
  - set the parttion ID to RAID autodetect (0xfd)
  - edit /etc/raidtab (see RAID Howto)
  - mkraid /dev/md0
- install LVM utilities (0.9.1beta3)
- pvcreate /dev/md0
- vgcreate -n BGNAME /dev/md0
- lvcreate <some logical volume>

> -----Original Message-----
> From: Jens Bruckmann [mailto:jens.bruckmann@suse.de]
> Sent: jeudi, 8. février 2001 12:12
> To: linux-lvm@sistina.com
> Subject: [linux-lvm] Setup for RAID1 with LVM
> 
> 
> Dear LVM-Specialists,
> 
> I would like to setup a configuration with LVM and RAID1. Poorly you
> can't just do a lvextend -m 1 like on HP-UX :-))
> 
> I could not find any hints so far for a step by step description, the
> part has to be included in the LVM-Howto.
> 
> I have two SCSI-Disks of nearly the same size, on Disk 1 I 
> already have
> a working installation of Linux.
> 
> /usr, /opt and /var reside on LVs. I want these three LVs to 
> be mirrored
> online to the second disk as it is possible on HP-UX.
> 
> Can someone shortly describe, how to setup such a configuration?
> 
> 
> Thanks for help,
> 
> 	Jens
> 
> -- 
> --------------------------------------------------------------
> ---------
> Jens Bruckmann              .-.       Mail:    jens.bruckmann@suse.de
> SuSE Linux Solutions AG     /v\       Phone:   +49 - 40 - 89 69 82 18
> Friesenweg 5F              // \\      Fax:     +49 - 40 - 85 40 04 35
> D-22763 Hamburg           /(   )\
>                            ^^-^^      
> --------------------------------------------------------------
> ---------
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@sistina.com
> http://lists.sistina.com/mailman/listinfo/linux-lvm
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [linux-lvm] Setup for RAID1 with LVM
  2001-02-08 11:12 [linux-lvm] Setup for RAID1 with LVM Jens Bruckmann
  2001-02-08 13:51 ` James
@ 2001-02-08 19:15 ` Andreas Dilger
  1 sibling, 0 replies; 10+ messages in thread
From: Andreas Dilger @ 2001-02-08 19:15 UTC (permalink / raw)
  To: linux-lvm

Jens, you write:
> I would like to setup a configuration with LVM and RAID1. Poorly you
> can't just do a lvextend -m 1 like on HP-UX :-))
> 
> I have two SCSI-Disks of nearly the same size, on Disk 1 I already have
> a working installation of Linux.

You need to use MD to do mirroring on Linux, not LVM (as in HP-UX and AIX).

> /usr, /opt and /var reside on LVs. I want these three LVs to be mirrored
> online to the second disk as it is possible on HP-UX.

You _may_ be able to create an MD RAID-0 mirror of your existing disk,
and then run vgscan again to detect the new configuration.  However, this
has probably never been done - normally, you would create the MD mirror
first and then create VG/LV on top of it.  It may NOT work, because I
recall something about MD storing a backup superblock at the end of the
MD device, and this would break LVM I think (LVM aligns the PEs at the
end of the partition as well).

> Can someone shortly describe, how to setup such a configuration?

The safest would be to backup your system, and start with creating an
MD device, and then adding LVM on top of it.  If you have a backup,
you could test to see if mirroring an existing LVM disk works, because
this may be something people want to do in the future.

It is also be possible (if you have extra disk space) to create a mirrored
MD device, make a PV of it, add it into the VG, and pvmove all of your
existing LVs to the mirrored device.  You can then vgreduce the old
(unmirrored) PV out of the VG.

Cheers, Andreas
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [linux-lvm] Setup for RAID1 with LVM
  2001-02-08 13:56 Jean-Eric Cuendet
@ 2001-02-08 20:51 ` Heinz J. Mauelshagen
  0 siblings, 0 replies; 10+ messages in thread
From: Heinz J. Mauelshagen @ 2001-02-08 20:51 UTC (permalink / raw)
  To: linux-lvm

On Thu, Feb 08, 2001 at 02:56:48PM +0100, Jean-Eric Cuendet wrote:
> 
> Hi,
> To do that:
> - create a md0 RAID1 device with your 2 disks (mirror, no use of LVM)
>   - set the parttion ID to RAID autodetect (0xfd)
>   - edit /etc/raidtab (see RAID Howto)
>   - mkraid /dev/md0
> - install LVM utilities (0.9.1beta3)
> - pvcreate /dev/md0
> - vgcreate -n BGNAME /dev/md0
> - lvcreate <some logical volume>
> 
> > -----Original Message-----
> > From: Jens Bruckmann [mailto:jens.bruckmann@suse.de]
> > Sent: jeudi, 8. f�vrier 2001 12:12
> > To: linux-lvm@sistina.com
> > Subject: [linux-lvm] Setup for RAID1 with LVM
> > 
> > 
> > Dear LVM-Specialists,
> > 
> > I would like to setup a configuration with LVM and RAID1. Poorly you
> > can't just do a lvextend -m 1 like on HP-UX :-))

Do you like to volunteer for the -m implementation ;-)

> > 
> > I could not find any hints so far for a step by step description, the
> > part has to be included in the LVM-Howto.
> > 
> > I have two SCSI-Disks of nearly the same size, on Disk 1 I 
> > already have
> > a working installation of Linux.
> > 
> > /usr, /opt and /var reside on LVs. I want these three LVs to 
> > be mirrored
> > online to the second disk as it is possible on HP-UX.
> > 
> > Can someone shortly describe, how to setup such a configuration?
> > 
> > 
> > Thanks for help,
> > 
> > 	Jens
> > 
> > -- 
> > --------------------------------------------------------------
> > ---------
> > Jens Bruckmann              .-.       Mail:    jens.bruckmann@suse.de
> > SuSE Linux Solutions AG     /v\       Phone:   +49 - 40 - 89 69 82 18
> > Friesenweg 5F              // \\      Fax:     +49 - 40 - 85 40 04 35
> > D-22763 Hamburg           /(   )\
> >                            ^^-^^      
> > --------------------------------------------------------------
> > ---------
> > _______________________________________________
> > linux-lvm mailing list
> > linux-lvm@sistina.com
> > http://lists.sistina.com/mailman/listinfo/linux-lvm
> > 
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@sistina.com
> http://lists.sistina.com/mailman/listinfo/linux-lvm

-- 

Regards,
Heinz    -- The LVM Guy --

*** Software bugs are stupid.
    Nevertheless it needs not so stupid people to solve them ***

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Sistina Software Inc.
Senior Consultant/Developer                       Am Sonnenhang 11
                                                  56242 Marienrachdorf
                                                  Germany
Mauelshagen@Sistina.com                           +49 2626 141200
                                                       FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [linux-lvm] Setup for RAID1 with LVM
@ 2001-11-15 10:01 ` Csuk, Ferenc
  2001-11-15 10:09   ` Jason L Tibbitts III
  2001-11-19  3:37   ` yves.alloyer
  0 siblings, 2 replies; 10+ messages in thread
From: Csuk, Ferenc @ 2001-11-15 10:01 UTC (permalink / raw)
  To: 'Mauelshagen@Sistina.com'
  Cc: 'linux-lvm@sistina.com', 'jens.bruckmann@suse.de'

Dear Heinz,

I have read your archive discussion on this topic and your suggested
solution for it, see below. Now we would like to do it as well, but when we
start pvcreate /dev/md0 we get the following error: invalid partition type
0x83 for /dev/md0" (must be 0x8e). Unfortunatelly we can´t change it using
fdisk.

What was the solution for it in your case?

Thank you in advance.

Regards,
Ferenc



> - create a md0 RAID1 device with your 2 disks (mirror, no use of LVM)
>   - set the parttion ID to RAID autodetect (0xfd)
>   - edit /etc/raidtab (see RAID Howto)
>   - mkraid /dev/md0
> - install LVM utilities (0.9.1beta3)
> - pvcreate /dev/md0
> - vgcreate -n BGNAME /dev/md0
> - lvcreate <some logical volume>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [linux-lvm] Setup for RAID1 with LVM
  2001-11-15 10:01 ` Csuk, Ferenc
@ 2001-11-15 10:09   ` Jason L Tibbitts III
  2001-11-15 13:36     ` Brent Harding
  2001-11-19  3:37   ` yves.alloyer
  1 sibling, 1 reply; 10+ messages in thread
From: Jason L Tibbitts III @ 2001-11-15 10:09 UTC (permalink / raw)
  To: linux-lvm

>>>>> "FC" == Ferenc Csuk <Csuk> writes:

FC> [...]  when we start pvcreate /dev/md0 we get the following error:
FC> invalid partition type 0x83 for /dev/md0" (must be
FC> 0x8e). Unfortunatelly we can´t change it using fdisk.

The manual page for pvcreate says:

For whole disk devices only the partition table must be erased, which
will effectively destroy all data on that disk.  This can be done by
zeroing the first sector with:
 
       dd if=/dev/zero of=PhysicalVolume bs=512 count=1

 - J<

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [linux-lvm] Setup for RAID1 with LVM
  2001-11-15 10:09   ` Jason L Tibbitts III
@ 2001-11-15 13:36     ` Brent Harding
  2001-11-17  9:04       ` Wolfgang Weisselberg
  0 siblings, 1 reply; 10+ messages in thread
From: Brent Harding @ 2001-11-15 13:36 UTC (permalink / raw)
  To: linux-lvm

Can it be done to just a partition? I suppose raid devices are considered
whole disks no matter what portion of various partitions they take up.
At 10:10 AM 11/15/01 -0600, you wrote:
>>>>>> "FC" == Ferenc Csuk <Csuk> writes:
>
>FC> [...]  when we start pvcreate /dev/md0 we get the following error:
>FC> invalid partition type 0x83 for /dev/md0" (must be
>FC> 0x8e). Unfortunatelly we can´t change it using fdisk.
>
>The manual page for pvcreate says:
>
>For whole disk devices only the partition table must be erased, which
>will effectively destroy all data on that disk.  This can be done by
>zeroing the first sector with:
> 
>       dd if=/dev/zero of=PhysicalVolume bs=512 count=1
>
> - J<
>
>_______________________________________________
>linux-lvm mailing list
>linux-lvm@sistina.com
>http://lists.sistina.com/mailman/listinfo/linux-lvm
>read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [linux-lvm] Setup for RAID1 with LVM
  2001-11-15 13:36     ` Brent Harding
@ 2001-11-17  9:04       ` Wolfgang Weisselberg
  0 siblings, 0 replies; 10+ messages in thread
From: Wolfgang Weisselberg @ 2001-11-17  9:04 UTC (permalink / raw)
  To: linux-lvm

Hi, Brent!

Brent Harding (bharding@doorpi.net) wrote 34 lines:
> >>>>>> "FC" == Ferenc Csuk <Csuk> writes:

> >FC> [...]  when we start pvcreate /dev/md0 we get the following error:
> >FC> invalid partition type 0x83 for /dev/md0" (must be
> >FC> 0x8e). Unfortunatelly we can´t change it using fdisk.

> >For whole disk devices only the partition table must be erased, which

> Can it be done to just a partition? I suppose raid devices are considered
> whole disks no matter what portion of various partitions they take up.

Yep, to the kernel a RAID looks like a complete HD.

83 is, BTW, the standard partition type for Linux, while fd
is the Linux auto raid (automatically Kernel-mounted RAID)

I guess you can simply erase the beginning of the RAID
(/dev/md0) or even make partitions on the RAID -- but I don't
know why you'd want that when you're going with LVM anyway.

-Wolfgang

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [linux-lvm] Setup for RAID1 with LVM
  2001-11-15 10:01 ` Csuk, Ferenc
  2001-11-15 10:09   ` Jason L Tibbitts III
@ 2001-11-19  3:37   ` yves.alloyer
  1 sibling, 0 replies; 10+ messages in thread
From: yves.alloyer @ 2001-11-19  3:37 UTC (permalink / raw)
  To: linux-lvm; +Cc: Ferenc.Csuk

Sorry for the late answer, I was off line for some time. Sorry if you get
this one twice Ferenc.
I ran into a very similar issue some time ago using stock 1.0.1rc4 (not
CVS).
I tried zeroing the first block of the MD device... it didn't help.
This was discussed and solved in the "[linux-lvm] pvcreate fails on a
software RAID metadisk" thread.
The patch that was generated at that time and which made it into CVS was:
--- tools/lib/lvm_check_partitioned_dev.c.bluca	Thu Aug 23 07:51:53 2001
+++ tools/lib/lvm_check_partitioned_dev.c	Fri Oct  5 21:18:51 2001
@@ -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;
 	}

--

Yves
> -----Original Message-----
> From: linux-lvm-admin@sistina.com [mailto:linux-lvm-admin@sistina.com]On
> Behalf Of Csuk, Ferenc
> Sent: Thursday, November 15, 2001 4:58 PM
> To: 'Mauelshagen@Sistina.com'
> Cc: 'linux-lvm@sistina.com'; 'jens.bruckmann@suse.de'
> Subject: [linux-lvm] Setup for RAID1 with LVM
>
>
> Dear Heinz,
>
> I have read your archive discussion on this topic and your suggested
> solution for it, see below. Now we would like to do it as well,
> but when we
> start pvcreate /dev/md0 we get the following error: invalid partition type
> 0x83 for /dev/md0" (must be 0x8e). Unfortunatelly we can�t change it using
> fdisk.
>
> What was the solution for it in your case?
>
> Thank you in advance.
>
> Regards,
> Ferenc
>
>
>
> > - create a md0 RAID1 device with your 2 disks (mirror, no use of LVM)
> >   - set the parttion ID to RAID autodetect (0xfd)
> >   - edit /etc/raidtab (see RAID Howto)
> >   - mkraid /dev/md0
> > - install LVM utilities (0.9.1beta3)
> > - pvcreate /dev/md0
> > - vgcreate -n BGNAME /dev/md0
> > - lvcreate <some logical volume>
>
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@sistina.com
> http://lists.sistina.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2001-11-19  3:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-08 11:12 [linux-lvm] Setup for RAID1 with LVM Jens Bruckmann
2001-02-08 13:51 ` James
2001-02-08 19:15 ` Andreas Dilger
  -- strict thread matches above, loose matches on Subject: below --
2001-02-08 13:56 Jean-Eric Cuendet
2001-02-08 20:51 ` Heinz J. Mauelshagen
     [not found] <"Csuk, Ferenc"'s message of "Thu, 15 Nov 2001 16:57:44 +0100">
2001-11-15 10:01 ` Csuk, Ferenc
2001-11-15 10:09   ` Jason L Tibbitts III
2001-11-15 13:36     ` Brent Harding
2001-11-17  9:04       ` Wolfgang Weisselberg
2001-11-19  3:37   ` yves.alloyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).