1823228 Members
3724 Online
109648 Solutions
New Discussion юеВ

Mirroring

 
SOLVED
Go to solution
Terrence
Regular Advisor

Mirroring

I've got a volume group made up of 4 disks. The disks are mirrored in pairs. The entire volume group is devoted to just one logical volume. I have a fifth disk I want to add to the volume group and logical volume, but I don't have another to disk to pair it with. Is it possible to add it to the vg and lvol without mirroring that single disk? This is in a simple disk enclosure not an array or autorraid.
10 REPLIES 10
Pete Randall
Outstanding Contributor

Re: Mirroring

Terrence,

I'm missing something here, I think. How are these disks mirrored? If you're using MirrorDisk/UX, mirroring is done at the LV level and there is no way that one logical volume could be mirrored to itself. Since you're using a simple disk enclosure, that eliminates RAID 0/1 mirroring from the picture.

Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: Mirroring

Hi:

No (but read on). MirrorDisk/UX for LVM is implemented at the logical volume level. By default, mirrored extents cannot occupy the same physical volume. This is "strict allocation" and is usually observed for very good reasons. If you didn't use this initially, you could use 'lvchange' to transition it from strict to nonstrict, but then you would loose valuable protection against physical disk failure in the first place.

Regards!

...JRF...
Jeff Schussele
Honored Contributor

Re: Mirroring

Hi Terrence,

Mirroring is at the Logical Volume level, not the PV or even VG level.

You'll have to add two disks to the VG / LV to get true mirroring. Then extend the VG with both disks. Then extend the LV with both disks & because you already defined the LV as mirrored, it'll extend & mirror the LV extension simultaneously. I suspect the LV mirror is defined as "strict" (this is default) - which means mirrors MUST occupy seperate PVs. This cannot be changed or overridden. Besides it's pointless to mirror data on the same disk. If it fails you lose BOTH copies.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Terrence
Regular Advisor

Re: Mirroring

It's a SureStore E Disk Sytem HVD 10. I am using mirrordisk. I'm not sure what you're asking. Here is the output from lvdisplay.

#lvdisplay /dev/vgepic/lvepic
--- Logical volumes ---
LV Name /dev/vgepic/lvepic
VG Name /dev/vgepic
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 33000
Current LE 8250
Allocated PE 16500
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation non-strict
IO Timeout (Seconds) default
Pete Randall
Outstanding Contributor

Re: Mirroring

OK, I see where you're going then. As Jeff said, you really should add two disks unless you want to get sneaky and use James' idea.

Pete

Pete
Jeff Schussele
Honored Contributor

Re: Mirroring

Well you do have non-strict allocation. This *would* allow you to add this PV & preserve mirroring - ON THE SAME DISK.
BUT again this is not recommended. The predominate need for mirroring is disk failure. IF that disk fails you WILL lose BOTH copies of the data contained on it.

I strongly suggest you run
lvdisplay -v against that LV & note just WHERE the copies are residing. Hopefully they are on seperate PVs but just might not be. You could be in a precarious posistion & NOT be protected from simple disk falures. That's playing with fire.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Jeff Schussele
Honored Contributor

Re: Mirroring

One last thought....

It should be noted that mirroring does not have to be a one-to-one thing.
For example you could use an 18 Gb disk to mirror TWO seperate 9 Gb disks. Just have to make sure that the total size of the 18 is => the total size of the 2 9s together.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Terrence
Regular Advisor

Re: Mirroring

This is exactly what I thought but I hoped there was a loophole. What if I break the mirrors, add the fifth disk, and then when I get the sixth disk I remirror it with strict allocation? I can live without the mirrors for a few weeks, but I need that extra space the fifth disk gives me.
James R. Ferguson
Acclaimed Contributor
Solution

Re: Mirroring

Hi (again):

With regard to using 'lvchange' to alter the strict allocation policy of a mirrored logical volume, you will note from the man pages that the following are *not allowed*:

> From nonstrict to strict <
> From nonstrict to PVG-strict <
> From strict to PVG-strict <

Regards!

...JRF...
Dave Wherry
Esteemed Contributor

Re: Mirroring

Another thing that can happen when using non-strict is increased I/O on a single disk. If your primary and mirror end up on the same disk, every write will happen twice on one disk. Just another reason you want to stick with strict.
If you added that 5th disk now and did an lvextend, it will try to add the extents to that new disk and mirror to that new disk. You really only get to use half of the disk.
You really do need to break the mirrors, add 2 more disks and then re-mirror with strict allocation.