Operating System - HP-UX
1836604 Members
1963 Online
110102 Solutions
New Discussion

Re: Remove alternate links

 
Fredric Persson
Advisor

Remove alternate links

I tried to move a mirrored LV(mirrored between disk A-B) to other disks (disks C-D) by first add another mirror (disk C) to mirror A-B (lvextend -m 2 /dev/dsk/disk C), reduce disk A from the mirror (lvreduce -m 1 /dev/dsk/disk A). Finally added mirror D and reduced mirror B, i.e. I moved the data physical from disks A-B to C-D. The problem is that every disk have an alternate link and the alternate links for disk A and B is still left (noticed that when I tried to remove the LV). How do I get rid of those ? I created a new LV for this test, but I what to do this on real data.
8 REPLIES 8
James R. Ferguson
Acclaimed Contributor

Re: Remove alternate links

Hi:

To remove an alternate (pv) link, simply 'vgreduce':

# vgreduce /dev/vgXX /dev/dsk/cXtYdZ

...where /dev/dsk/CXtYdZ is the device file listed as the pv-link you want to remove.

If you choose the primary link, then the alternate becomes the primary. If you want to swap primary and alternate links, 'vgreduce' the *primary* and then 'vgextend' the *primary* back in. It will then become the new alternate link.

Regards!

...JRF...
Stefan Farrelly
Honored Contributor

Re: Remove alternate links


Just vgreduce the alternate device, eg;

vgdisplay -v | grep -i alternate

and for each device listed do;

vgreduce VGxx /dev/dsk/cxxxxxxx
Im from Palmerston North, New Zealand, but somehow ended up in London...
Deshpande Prashant
Honored Contributor

Re: Remove alternate links

HI
Take out the disks A and B from the VG.
vgreduce "/dev/vgXX /dev/dsk/disk-A" should remove disk A from the VG. Do same for the disk B.

Thanks.
Prashant.
Take it as it comes.
Fredric Persson
Advisor

Re: Remove alternate links

I don?t think you have understand the question.

When I typed lvremove /dev/vgX/lvolY I got the following respond:
Current path "/dev/dsk/disk A" is an alternate link, skip
Current path "/dev/dsk/disk B" is an alternate link, skip
Current path "/dev/dsk/disk C" is an alternate link, skip
Current path "/dev/dsk/disk D" is an alternate link, skip
Current path "/dev/dsk/disk E" is an alternate link, skip
Current path "/dev/dsk/disk F" is an alternate link, skip
(There is 6 disks in the VG, A-F)
The logical volume /dev/vgX/lvolY is not empty;
do you really want to delete the logical volume (y/n) ?


Why do I get all alternate links instead of used those for the disks (C-D) which belong to the current LV?

Fredric Persson
Advisor

Re: Remove alternate links

F.Y.I.

There are still active LV?s on disks A,B so I can?t remove those disks.
Stefan Farrelly
Honored Contributor

Re: Remove alternate links


Youre right, we didnt understand your question, now youve made your question clear;

When you remove a logical volume it has to scan all the devices in a volume group to check which ones will need to have extents removed, and that the disks are available so it can remove the extents, when it comes across alternate links it doesnt do a test on the physical device because it has already done that with the main (non-alternate link). This makes sense - why check the primary and alternate link when they point to the same device ? it will only slowdown the command. Its nothing to worry about, go ahead and remove your logical volume.
Im from Palmerston North, New Zealand, but somehow ended up in London...
James R. Ferguson
Acclaimed Contributor

Re: Remove alternate links

Hi (again) Fredric:

Now I'm confused as to exactly what you want to achieve.

'pvmove' can be ussed to move extents from one physical volume to another.

'lvreduce' can be used to remove mirrored copies of logical volumes.

The message "Current path...is an alternate link, skip" is a general advisory from many LVM operations, and is meant just as that -- for your information.

You could post some verbose 'lvdisplay' output to help us if this offering doesn't.

Regards!

...JRF...



'vgreduce' and 'vgextend' can deal with alternate links as noted.
Fredric Persson
Advisor

Re: Remove alternate links

Oh! I forgot that I could move PE with pvmove, thought I only could move whole disks.

I wanted to move one mirrored LV to new PV?s to distribute the load over more disks.

Case closed!

Thanks!