Skip to contentSkip to conversation

Wisdom of multiple disks in one VG

linux-lvm Ross Boylan 5 participants 8 messages Jul 21, 2008 – Jul 22, 2008

lore
Share & tools
lore
#0 lore raw

If I have a Volume Group with partitions from 2 different physical disks on it, and I confine my logical volumes to particular physical disks, will I be able to recover the logical volumes on disk 1 if disk 2 fails?

I have several disks, but they are all different sizes and so don't seem like good candidates for a scheme with redundancy (e.g., RAID 5). Because of my concern that combining disks into the same volume group would mean a failure of 1 would effectively wipe them all out, I have so far used separate VG's for each disk. However, this is awkward.

So, my general question is what the best approach would be in this situation, multiple disks of much different sizes. The existing disks all have separate VG's on them. The biggest disk is empty so far.

Thanks for any advice.
Ross Boylan

#1 lore raw
Quoted 3 lines · Ross Boylan

If I have a Volume Group with partitions from 2 different physical disks on it, and I confine my logical volumes to particular physical disks, will I be able to recover the logical volumes on disk 1 if disk 2 fails?

What is a disk? If a disk means a LUN off of a hw RAID'd subsystem, then you already have a level of protection. You know what I mean?

In that case, if all of the "disks" in a PV already have some kind of RAID protection, then there isn't too much of an issue.

So.. in my opinion.... LVM on top of RAID'd disks.

Quoted 3 lines

I have several disks, but they are all different sizes and so don't seem like good candidates for a scheme with redundancy (e.g., RAID 5).

Ok.

Quoted 3 lines

Because of my concern that combining disks into the same volume group would mean a failure of 1 would effectively wipe them all out, I have so far used separate VG's for each disk. However, this is awkward.

True. I think you simply have to bite the bullet and decide if getting matched storage (for RAID) or somehow some kind of RAID'd infrastructure is something you just have to pay for... otherwise, you probably just live with the risk... or go with separation like you are now (still risky, but not all eggs in one basket).

Quoted 4 lines

So, my general question is what the best approach would be in this situation, multiple disks of much different sizes. The existing disks all have separate VG's on them. The biggest disk is empty so far.

Since reliability seems important to you... I'd go with the separated scheme you mentioned. Sorry.. there really isn't a silver bullet for this scenario. Even so... you can't really say you have reliability, you've somewhat improved the situation with separation to help mitigate the damage, but without something like RAID, you're ultimately going to lose something (not speaking about the value of backups of course).

#2 lore raw
Quoted 2 lines · Chris Cox
Quoted 2 lines

I have several disks, but they are all different sizes and so don't seem like good candidates for a scheme with redundancy (e.g., RAID 5).

Use software raid 1, and you can mix different disk sizes. It is somewhat tedious when done via md driver, but quite workable.

For instance, if you have disks of 120, 200, 400 Gigs, create 120, 200, 80G partitions on the 400. Mirror the 120 and 200 partitions, and add to a volume group. Mount the 80G as a /work partition, and convert it to a mirror when you get another disk.

In AIX, you just allocated mirrored LVs, and didn't have to think about it. Linux LVM is getting there. If you have 3 or more physical disks, I think the current LV mirror code will do what you want also. (But I confess I am still using LVM over md raid 1.)

Signature · 4 lines
	      Stuart D. Gathman <[email protected]>
    Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.
#3 lore raw
In reply to Chris Cox
Quoted 7 lines · Chris Cox
Quoted 3 lines · Ross Boylan

If I have a Volume Group with partitions from 2 different physical disks on it, and I confine my logical volumes to particular physical disks, will I be able to recover the logical volumes on disk 1 if disk 2 fails?

What is a disk? If a disk means a LUN off of a hw RAID'd subsystem, then you already have a level of protection. You know what I mean?

I think so. That's not what I mean by "physical disks," by which I meant the things you can buy and stick into a slot in the case. My understanding is that a LUN is a virtual drive present to the world by the RAID system.

I'm talking about separate physical disk drives. I'm still not clear after reading your response (including below) whether disk 2 failing will make the LV's on disk 1 unusable (i.e., not relatively straightforward to recover), but it sounds as if that's the case.

Quoted 5 lines

In that case, if all of the "disks" in a PV already have some kind of RAID protection, then there isn't too much of an issue.

So.. in my opinion.... LVM on top of RAID'd disks.

Thanks. I hadn't actually appreciated that RAID needed to be done below LVM (I was somewhat thrown off by experience with EVMS and the fact that one can stripe in LVM).

Quoted 11 lines
Quoted 4 lines

I have several disks, but they are all different sizes and so don't seem like good candidates for a scheme with redundancy (e.g., RAID 5).

Ok.

Quoted 3 lines

Because of my concern that combining disks into the same volume group would mean a failure of 1 would effectively wipe them all out, I have so far used separate VG's for each disk. However, this is awkward.

Quoted 5 lines

True. I think you simply have to bite the bullet and decide if getting matched storage (for RAID) or somehow some kind of RAID'd infrastructure is something you just have to pay for... otherwise, you probably just live with the risk... or go with separation like you are now (still risky, but not all eggs in one basket).

Maybe the separate VGs for separate disks doesn't buy me much. Individual disk failures will still take some stuff with them. Either I have backups (I do), in which case I can recover, and could recover even if all my VGs fail, or I don't, in which case I'm sunk anyway.

There are of course issues of recovery speed with the different approaches, but that doesn't mean I'm getting much extra safety by keeping distinct VGs.

Quoted 6 lines
Quoted 5 lines

So, my general question is what the best approach would be in this situation, multiple disks of much different sizes. The existing disks all have separate VG's on them. The biggest disk is empty so far.

Quoted 7 lines

Since reliability seems important to you... I'd go with the separated scheme you mentioned. Sorry.. there really isn't a silver bullet for this scenario. Even so... you can't really say you have reliability, you've somewhat improved the situation with separation to help mitigate the damage, but without something like RAID, you're ultimately going to lose something (not speaking about the value of backups of course).

Real RAID is probably something I should consider, since my backups are on my disks until I burn them to DVD, monthly. The worst case scenario in this setup is pretty bad. I should also keep the on disk backups on separate disks, in multiple copies, etc.

Thanks for your advice.
Ross

#4 lore raw

Perhaps I'm being unfair, but making valuable stuff depend on md raid1 scares me. We've had trouble when an event happens (i.e. primary goes bad) and have had to do stuff by hand. For real peace of mind, I would think of a backup strategy involving another system; snapshot is nice for that. Perhaps your unused big disk could go on that system. Just a practical note.

Larry Dickson
Cutting Edge Networked Storage

Quoted 84 lines · Ross Boylan
Quoted 2 lines · Chris Cox
Quoted 1 line · Ross Boylan

If I have a Volume Group with partitions from 2 different physical

disks

Quoted 2 lines
Quoted 2 lines

on it, and I confine my logical volumes to particular physical disks, will I be able to recover the logical volumes on disk 1 if disk 2

fails?

Quoted 3 lines

What is a disk? If a disk means a LUN off of a hw RAID'd subsystem, then you already have a level of protection. You know what I mean?

I think so. That's not what I mean by "physical disks," by which I meant the things you can buy and stick into a slot in the case. My understanding is that a LUN is a virtual drive present to the world by the RAID system.

I'm talking about separate physical disk drives. I'm still not clear after reading your response (including below) whether disk 2 failing will make the LV's on disk 1 unusable (i.e., not relatively straightforward to recover), but it sounds as if that's the case.

Quoted 5 lines

In that case, if all of the "disks" in a PV already have some kind of RAID protection, then there isn't too much of an issue.

So.. in my opinion.... LVM on top of RAID'd disks.

Thanks. I hadn't actually appreciated that RAID needed to be done below LVM (I was somewhat thrown off by experience with EVMS and the fact that one can stripe in LVM).

Quoted 3 lines
Quoted 3 lines

I have several disks, but they are all different sizes and so don't

seem

Quoted 6 lines
Quoted 1 line

like good candidates for a scheme with redundancy (e.g., RAID 5).

Ok.

Quoted 2 lines

Because of my concern that combining disks into the same volume group would mean a failure of 1 would effectively wipe them all out, I have

so

Quoted 7 lines
Quoted 1 line

far used separate VG's for each disk. However, this is awkward.

True. I think you simply have to bite the bullet and decide if getting matched storage (for RAID) or somehow some kind of RAID'd infrastructure is something you just have to pay for... otherwise, you probably just live with the risk... or go with separation like you are now (still risky, but not all eggs in one basket).

Maybe the separate VGs for separate disks doesn't buy me much. Individual disk failures will still take some stuff with them. Either I have backups (I do), in which case I can recover, and could recover even if all my VGs fail, or I don't, in which case I'm sunk anyway.

There are of course issues of recovery speed with the different approaches, but that doesn't mean I'm getting much extra safety by keeping distinct VGs.

Quoted 6 lines
Quoted 5 lines

So, my general question is what the best approach would be in this situation, multiple disks of much different sizes. The existing disks all have separate VG's on them. The biggest disk is empty so far.

Quoted 7 lines

Since reliability seems important to you... I'd go with the separated scheme you mentioned. Sorry.. there really isn't a silver bullet for this scenario. Even so... you can't really say you have reliability, you've somewhat improved the situation with separation to help mitigate the damage, but without something like RAID, you're ultimately going to lose something (not speaking about the value of backups of course).

Real RAID is probably something I should consider, since my backups are on my disks until I burn them to DVD, monthly. The worst case scenario in this setup is pretty bad. I should also keep the on disk backups on separate disks, in multiple copies, etc.

Thanks for your advice.
Ross

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#5 lore raw
Quoted 3 lines · Larry Dickson

Perhaps I'm being unfair, but making valuable stuff depend on md raid1 scares me. We've had trouble when an event happens (i.e. primary goes bad) and have had to do stuff by hand.

I thought raid 1 handled that kind of situation automatically. Am I under a mistaken impression, or is it just that other things can go wrong easily? I know raid 1 and 5 are both vulnerable until the redundancy is reconstructed.

Quoted 3 lines

For real peace of mind, I would think of a backup strategy involving another system; snapshot is nice for that. Perhaps your unused big disk could go on that system. Just a practical note.

It won't be unused for long, and since some stuff to backup goes there, I think I need to put the on-disk backup somewhere else. Spreading things out across disks should also speed up the backup, which is sometimes very slow.
Ross

#6 lore raw
In reply to Ross Boylan
Quoted 3 lines · Ross Boylan

If I have a Volume Group with partitions from 2 different physical disks on it, and I confine my logical volumes to particular physical disks, will I be able to recover the logical volumes on disk 1 if disk 2 fails?

If you ensure that a LV doesn't span PVs then a failure of one PV would leave the remaining LV intact. You would need to be very careful to ensure that a LV doesn't span multiple PVs thou.

You can recover the LV on the working disk by activating the VG in partial mode (its usually the -P option. iirc "vgchange -ay -P"), or even remove the missing PV (vgchange --removemissing, or something like that). If you activate the VG in partial mode then any read requests to missing extents will return zeros (or errors?). The man pages describe this further. Note that an inconsistent VG will not be activated automatically, you will need to manually activate it with -P.

If your disks are likely to fail and you are concered about this then you are probably better off keeping separate VGs. If you need LVs larger than what a single disk can provide and therefore need to span disks then obviously they need to be in the same VG.

If the root filesystem is on a LV (which is the default for Fedora/RHEL) I wouldn't recommend having two PVs in its VG. This is simply because if one PV dies then your VG will be inconsistent (missing a PV) and your system won't boot correctly (because the VG won't be activated at boot time). Its not a good idea to add SAN and local storage to the same VG for this reason.

Quoted 5 lines

I have several disks, but they are all different sizes and so don't seem like good candidates for a scheme with redundancy (e.g., RAID 5). Because of my concern that combining disks into the same volume group would mean a failure of 1 would effectively wipe them all out, I have so far used separate VG's for each disk. However, this is awkward.

You could add them all into one VG if you wish, but this would be even more awkward - you would need to ensure that each LV resides on a single PV.

Quoted 3 lines

So, my general question is what the best approach would be in this situation, multiple disks of much different sizes. The existing disks all have separate VG's on them. The biggest disk is empty so far.

Do you need a single large filesystem that spans disks? Do you have a proper disaster recovery plan (eg, backups)?

--Dave

#7 lore raw

On Tue, 2008-07-22 at 18:22 +0200, David Robinson wrote:
[lots of good info snipped]

Quoted 6 lines
Quoted 4 lines

So, my general question is what the best approach would be in this situation, multiple disks of much different sizes. The existing disks all have separate VG's on them. The biggest disk is empty so far.

Do you need a single large filesystem that spans disks?

No.

Quoted 2 lines

Do you have a
proper disaster recovery plan (eg, backups)?

Yes. Kind of! I definitely need to move my on disk backups onto a separate physical disk than the one being backed up.

Thanks to everyone for your help.

Signature · 5 lines
Ross Boylan                                      wk:  (415) 514-8146
185 Berry St #5700                               [email protected]
Dept of Epidemiology and Biostatistics           fax: (415) 514-8150
University of California, San Francisco
San Francisco, CA 94107-1739                     hm:  (415) 550-1062