You are not logged in.

#1 2010-10-03 15:56:02

delcypher
Member
Registered: 2010-04-17
Posts: 42

A question about redundancy of LVM logical volumes and backup method

Hi I've been looking into backing up one of my LVM logical volumes and I came across this (http://www.novell.com/coolsolutions/appnote/19386.html) article.

I'm a little confused by it as it states that "Nice work, your logical volume is now fault tolerant!".

In the setup described by the article. The mirrored LVM logical volumes do reside on different physical drives but they are part of the same volume group (i.e. multiple physical volumes making up a volume group).

I don't understand how this setup is fault tolerant because if anyone of the drives that make up the volume group fail then I believe the lvm volume group will not be available (complaining about missing physical volumes).

Am I missing something here?

My current setup is

/dev/sda3 -> /boot
/dev/sda4 -> /dev/mapper/volgroupenc (LUKS partition) -> [LVM physical volume]
/dev/sdb1 -> /devmapper/volgroupencextend (LUKS partition) -> [LVM physical volume]

I then have a volumegroup that is made from the two LVM physical volumes. I then have 3 LVM logical volumes

/dev/volgroup/root
/dev/volgroup/home
/dev/volgroup/swap

My concern is that because my volumegroup spans across two drives if anyone of them fails I will loose all may data.

Is there any setup I can do by which I can have a perfect mirror of my volumegroup so that if one of my drives fail I still have a perfectly function volumegroup.

I understand linux supports software raid but would I need two drives identically sized (1TB) or can I just have one drive (i.e. 2TB) that is a mirror of my volumegroup?

Thanks

Offline

#2 2010-10-03 22:18:39

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: A question about redundancy of LVM logical volumes and backup method

delcypher wrote:

Hi I've been looking into backing up one of my LVM logical volumes and I came across this (http://www.novell.com/coolsolutions/appnote/19386.html) article.

I'm a little confused by it as it states that "Nice work, your logical volume is now fault tolerant!".

Are you sure that's the article? I can't find anything on that page about "nice work" or "fault tolerant"...?

delcypher wrote:

My concern is that because my volumegroup spans across two drives if anyone of them fails I will loose all may data.

Correct.

delcypher wrote:

Is there any setup I can do by which I can have a perfect mirror of my volumegroup so that if one of my drives fail I still have a perfectly function volumegroup.

Use 2 disks to create a RAID-1 array, then use that as your PV.
sda1 + sdb1 = md0 => pv

delcypher wrote:

I understand linux supports software raid but would I need two drives identically sized (1TB) or can I just have one drive (i.e. 2TB) that is a mirror of my volumegroup?

You can use 2 partitions on the same disk to create a RAID array, but that defeats the whole purpose of RAID.

It sounds like you're merging the meanings of 'redundant' and 'backup' -- they are distinct things, so you need to decide if you want redundancy or backup. Or both ideally.

Offline

#3 2010-10-03 23:22:37

delcypher
Member
Registered: 2010-04-17
Posts: 42

Re: A question about redundancy of LVM logical volumes and backup method

Thanks for the reply.

I posted the wrong link oops. The correct link is http://www.tcpdump.com/kb/os/linux/lvm- … ng-lv.html

Would the following work? (Three hard drives in total. Adding a 2TB hard drive (sdc) to my setup)

Create a Raid-1 array (sda1 & sdc1) which is used to make md0 which is a PV.

Create another Raid-1 array (sdb1 & sdc2) which is used to make md1 which is another PV.

Then use these two PVs create a single volume group.

So in this setup up the mirror of sda1 & sdb1 are both on the sdc drive. Am I correct in thinking that this would provide redundancy if just one out of the 3 drives failed (as long as I put in a new drive and allowed to replace the one that failed)?

If I can do this then I'd like to use LUKS too. Should I do...

LUKS partition -> RAID -> LVM PV

or...

RAID -> LUKS partition -> LVM PV  (my sneaking suspicion is this way round as this means I'll have two copies of the LUKS headers instead of one as in the other setup).

bearing in mind that the root partition will be in the LVM so the kernel needs to be able to boot.

Yes you're right I was merging the meanings of redundant and backup. From 5 minutes of googling I can see that people have a fair point that RAID does not provide a back up. Thanks for brining that to my attention.

So for me to have a backup as well as redundancy (RAID1) should I have an additional hard drive and just use rsync to make back ups of important files?

Thanks again.

Offline

#4 2010-10-04 09:34:17

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: A question about redundancy of LVM logical volumes and backup method

delcypher wrote:

Would the following work? (Three hard drives in total. Adding a 2TB hard drive (sdc) to my setup)

Create a Raid-1 array (sda1 & sdc1) which is used to make md0 which is a PV.

Create another Raid-1 array (sdb1 & sdc2) which is used to make md1 which is another PV.

Then use these two PVs create a single volume group.

So in this setup up the mirror of sda1 & sdb1 are both on the sdc drive. Am I correct in thinking that this would provide redundancy if just one out of the 3 drives failed (as long as I put in a new drive and allowed to replace the one that failed)?

I understand what you meant now -- yes, that would work. I'm not sure what the performance would be like though.

delcypher wrote:

So for me to have a backup as well as redundancy (RAID1) should I have an additional hard drive and just use rsync to make back ups of important files?

That would be one way to create a backup, yes smile

Offline

Board footer

Powered by FluxBB