Operating System - HP-UX
1830194 Members
15108 Online
109999 Solutions
New Discussion

remove 2 disks from mirror

 
SOLVED
Go to solution
Shawn Miller_2
Frequent Advisor

remove 2 disks from mirror

I extended /opt and lvm utilized 2 other devices in the volume group for the mirror. I wrongly assumed it would just extend onto the one device that was currently being used for the mirror. There are 4 devices in the volume group (2 are mirrors). If I issue the command, lvreduce -m 1 /dev/vg00/lvol4 /dev/dsk/c3t4d0 /dev/dsk/c5t5d0, will lvm remove those two devices from the mirror and just use the original one (not listed) and grab more space on the existing mirror so it is equivalent to the primary device. This is an hfs volume.
5 REPLIES 5
Ken Hubnik_2
Honored Contributor

Re: remove 2 disks from mirror

If possible post the output from
lvdisplay -v /dev/vg00/lvolx
James R. Ferguson
Acclaimed Contributor
Solution

Re: remove 2 disks from mirror

Hi Shawn:

Mirrored extents will be placed whereever there is available space as constrained by the 'strict' allocation policy [see the man pages for 'lvcreate'].

If you issue the command, If I issue the command:

# lvreduce -m 0 /dev/vg00/lvol4 /dev/dsk/c3t4d0 /dev/dsk/c5t5d0

...then LVM will remove mirrored extents from the stated devices. Notice that I specified 0-copies; i.e. one less than what you currently have.

Then, if you want to limit (control) a subsequent mirror operation' to a particular physical device, specify the physical device when you mirror:

# lvextend -m 1 /dev/vgXX/lvolY /dev/dsk/cXtYdZ

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: remove 2 disks from mirror

Hi (again):

I should add that if you have extended the number of "primary" extents of the logical volume (ignoring any mirrored ones), and you find that the new extents were taken from a disk you did not want utilized, you can use the 'pvmove' command to migrate extents from one device to another.

Have a look at the man pages for 'pvmove' for more details.

If you choose to use 'pvmove' do *not* interrupt it while it works. It will take some time -- about the same or more than a mirror synchronization operation.

Regards!

...JRF...

Shawn Miller_2
Frequent Advisor

Re: remove 2 disks from mirror

Here is an attachment showing the output of lvdisplay -v /dev/vg00/lvol4. Also, I am assuming when I do this I will need to be in single user mode. Is that correct or can I do this with the system in init state 3.
Sridhar Bhaskarla
Honored Contributor

Re: remove 2 disks from mirror

Hi,

You can use pvmove. But I would say it is better to reduce the mirrors and extend the mirror.

lvreduce -m 0 /dev/vg00/lvol4 /dev/dsk/c3t5d0 /dev/dsk/c5t5d0 /dev/dsk/c5t6d0

Now extend the mirror using only one device

lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c5t6d0

This should be simple and will take the same time as of pvmove.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try