Operating System - Linux
1753870 Members
7317 Online
108809 Solutions
New Discussion юеВ

Re: does the mirroring supported by LVM ( LINUX )

 
SOLVED
Go to solution
skt_skt
Honored Contributor

does the mirroring supported by LVM ( LINUX )

idont see an option for mirroring on the man page for lvextend. is the mirroring not supported on Linux/LVM
11 REPLIES 11
Stuart Browne
Honored Contributor

Re: does the mirroring supported by LVM ( LINUX )

Does this mean you've already created a mirrored LVM?

I quote the man page for 'lvcreate' on my RHEL4 box:

------------------------------------
-m, --mirrors Mirrors
Creates a mirrored logical volume with "Mirrors" copies. For example, specifying "-m 1" would result in a mirror with two-sides; that is, a linear volume plus one copy.
------------------------------------

That being said, this is from the man page for 'lvextend':

------------------------------------
lvextend allows you to extend the size of a logical volume. Extension of snapshot logical volumes (see lvcreate(8) for information to create snapshots) is supported as well. But to change the number of copies in a mirrored logical volume use lvconvert(8).
------------------------------------

'lvconvert' has the exact same '-m' options as 'lvcreate'.

NOTE: As this is RHEL4, this is all LVM2. LVM1 does *NOT* have any Mirroring capabilities (unless using md over LVM).
One long-haired git at your service...
skt_skt
Honored Contributor

Re: does the mirroring supported by LVM ( LINUX )

whihc update version you have with RHEL 4. I am not able to see the -m option for lvcreate too for both RHEL 3 and RHEL 4

Red Hat Enterprise Linux AS release 4 (Nahant Update 4);lvm2-2.02.06-6.0.RHEL4
Red Hat Enterprise Linux AS release 3 (Taroon Update 8);lvm-1.0.8-14
Ivan Ferreira
Honored Contributor

Re: does the mirroring supported by LVM ( LINUX )

I have Red Hat EL 4 U5 and we use LVM mirrors.

cat /etc/redhat-release
Red Hat Enterprise Linux ES release 4 (Nahant Update 5)

rpm -qi lvm2
Name : lvm2
Version : 2.02.21
Release : 5.el4
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Steven E. Protter
Exalted Contributor

Re: does the mirroring supported by LVM ( LINUX )

Shalom,

You still need to use fdisk to set up the partition structure on the second disk.

Its somewhat easier to do the mirroring at install time and do one gigantic partion and use lvm to subdivide it.

This methodology, which you can use to mirror a system after install seems quite possible as well using Stuart's plan.

This thread is so good its going on my permanent bookmark list in ITRC.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
skt_skt
Honored Contributor

Re: does the mirroring supported by LVM ( LINUX )

Its somewhat easier to do the mirroring at install time and do one gigantic partion and use lvm to subdivide it.

I did not undesrtand this point.

This methodology, which you can use to mirror a system after install seems quite possible as well using Stuart's plan

r u talking about lvconvert/lvextend/lvcreate? Even i dont see a man page for lvconvert
Stuart Browne
Honored Contributor

Re: does the mirroring supported by LVM ( LINUX )

under RHEL4 with 'lvm2-2.02.21-5.el4', there most definately is a 'lvconvert' man page.

I personally feel tat using a whole-device for PE's is the easiest and most maintainable method of things.

That being said, after the fact 'lvconvert' into available PE's shouldn't be an issue.
One long-haired git at your service...
Van den Broeck Tijl
Valued Contributor
Solution

Re: does the mirroring supported by LVM ( LINUX )

This "-m" option must have been added very recently or it's RH only.

I'm operating LVM2 v2.02.06 and it does not have a "-m" option.

That said, afaik (until this thread) the only way to mirror volumes is to use device mapper RAID support with a tool called 'mdadm' (which works pretty well, and it too can convert a running system on 1 disk live to a RAID 1 on 2 disks (presuming you already have the second disk installed or you've got hot-swap capabilities).

Off topic:
A difference between mdadm RAID 1 and LVM mirrors (such as in HP-UX) is that the linux device mapper utilises both disks for reading operations, resulting in a pretty good read performance whilst ie. HP-UX uses a single disk for read operations and the other only to write (until disk failure of first disk). I do not know how RH made the behaviour of the "-m" option in LVM, you still might be better using mdadm if you're looking for performance.
Stuart Browne
Honored Contributor

Re: does the mirroring supported by LVM ( LINUX )

Mirroring is one of the things that the Linux LVM developers have been trying to put in since it was first created.

When I initially started using LVM (albiet late, using a 1.0.3 version on FC1, with partial manual upgrads to 1.0.8), the documentation and notes were litted with people saying that it was being worked on, but not ready.

When LVM2 was released using device mapper support (ported back to 2.4 kernels), mirroring was added, but was quite buggy, and not in any of the man pages.

The documentation in the 'man' pages was added in 2.02.10.

If you read through the change log for LVM2 ( ftp://sources.redhat.com/pub/lvm2/WHATS_NEW ), you get quite the fascinating history.
One long-haired git at your service...
Van den Broeck Tijl
Valued Contributor

Re: does the mirroring supported by LVM ( LINUX )

Thanks for the clarification Stuart. As far as I understand, it also uses md internally? Or am I totally wrong and it keeps mirrors in its own way?