1833750 Members
2562 Online
110063 Solutions
New Discussion

Re: A mirroring question

 
SOLVED
Go to solution
Mihails Nikitins
Super Advisor

A mirroring question

Hi,

Imagine I have a volume group of 6 physical volumes, only one large logical volume, there are 3 mirrored pairs, mirroring is restricted by pvg.

Question.

When taking one disk away from mirroring for replacement, will the command break mirroring for all disk pairs?

lvreduce -m 0 /dev/vgxx/lvolx /dev/dsk/cxtxdx
vgreduce /dev/vgxx /dev/dsk/cxtxdx

Points in advance for your feedback!

BR,
Mihails



KISS - Keep It Simple Stupid
6 REPLIES 6
Todd McDaniel_1
Honored Contributor

Re: A mirroring question

you dont have to break the mirror to replace a disk...

just replace it then:

pvcreate /dev/dsk/cxtxdx (optional)
vgcfgrestore
vgchange -ay vgXX
vgsync
Unix, the other white meat.
Geoff Wild
Honored Contributor

Re: A mirroring question

We had an issue on an internel disk recently - where EMS was reporting a failure - one of the file systems was gone - but the disk was still "available"....Here's what HP said:

Here is the information regarding disk replacement :

1) If the disk is completely "dead", such as if you run ioscan and status is
"no_hw" then you can hot swap the disk online.

2) However in circumstances where the disk has not fully failed please do one of
the following to avoid data corruption :

a) reduce mirror before replacing the disk
b) deactivate VG before replacing the disk
c) shutdown system to replace the disk

If the disk was not completely dead, I would suggest to deactivate VG if possible. There is a good kmine document on the steps I have mentioned above if you are interested :
KBRC00009115.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Mark Grant
Honored Contributor
Solution

Re: A mirroring question

Good advice above but to specifically answer your question, yes.

You mirror on the logical volume level, not the disk level so you "lvreduce" the logical volume, you remove the mirror from entire logical volume.
Never preceed any demonstration with anything more predictive than "watch this"
Mihails Nikitins
Super Advisor

Re: A mirroring question

Thank you for the replies!

The disk is not dead yet, just generating bad warnings, so I should execute LVM commands before pulling it out. I'm just unsure about handling one big logical volume that is based on more than one pair of physical volumes.

Mark, you've answered my question, thanks. If this is true let me I ask more.

Should I re-create mirror on the whole pvg after disk replacement?

lvextend -m 1 /dev/vgxx/lvolx /dev/dsk/cxt1dx /dev/dsk/cxt2dx /dev/dsk/cxt3dx

If so, should I bring offline all the disks in the "faulty" pvg first?

lvreduce -m 0 /dev/vgxx/lvolx /dev/dsk/cxt1dx /dev/dsk/cxt2dx /dev/dsk/cxt3dx

Points in advance!






KISS - Keep It Simple Stupid
Todd McDaniel_1
Honored Contributor

Re: A mirroring question

If the disk is not dead then yes you should definintely use all caution. You can only pull the disk if it is truly dead.

run diskinfo and pvdisplay on it to be sure as well...

Using LVM commands, lvreduce the mirror on all Lvols that live on that mirror.

Then replace the disk and then add the mirror back again.
Unix, the other white meat.
Mihails Nikitins
Super Advisor

Re: A mirroring question

Hi,

Just a summary.

1. taking one pv from mirroring will break the entire mirror.

lvreduce -m 0 /dev/vgxx/lvolx /dev/dsk/cxtxdx

There's no need to mention other disks in lvreduce command.

2. You need to mention all 'freed' physical when recreating the mirror.

Just identify what pvs are actually not used by commands 'lvdisplay -v' and 'pvdisplay -v'.

Then issue a command like
lvextend -m 1 /dev/vgxx/lvolx /dev/dsk/cxt1dx /dev/dsk/cxt2dx /dev/dsk/cxt3dx

3. I faced the problem described in DocumentID 4000009061.
That is becuase importing volume group removes
/etc/lvmpvg.

Just to keep archives better. :-)

BR,
Mihails

KISS - Keep It Simple Stupid