Operating System - HP-UX
1820028 Members
3279 Online
109608 Solutions
New Discussion юеВ

Re: Removing and disk from a mirror set

 
SOLVED
Go to solution
Stefan Saliba
Trusted Contributor

Removing and disk from a mirror set

I installed an additional internal disk on the K class to install mirroring.


I managed sucessfully to do this but now I want to remove mirroring.

I split the mirror then used lvremove to remove the logical volumes on the mirror disk
and all went fine.

Now I am trying to include the ex-mirror disk in a new volume group but is failing since the entry of this physical volume is still bound to the old volume group in the /etc/lvmtab.

I tried vgremove but reported the error that there is still some data in use on the PV I am trying to remove. I can't figure out what is this data cos I removed all mirrored LV including the swap partition

Can anyone help me remove this PV from the etc/lvmtab ?
9 REPLIES 9
Steffi Jones_1
Esteemed Contributor

Re: Removing and disk from a mirror set

Hi,

you can try to do the following steps:

1) mv /etc/lvmtab /etc/lvmtab.backup
2) vgscan -v

That will create a new lvmtab file.

Then you can run pvcreate -F /dev/rdsk/.... on the disk to clean it up.

But I only recommend those steps if you know for sure that the data on the disk won't be used in the future.

Steffi Jones

Re: Removing and disk from a mirror set

Did you remove the disk from the original volumegroup by running "vgreduce"? (vgreduce - remove physical volumes from an LVM volume group)

Laszlo
Dan Hetzel
Honored Contributor
Solution

Re: Removing and disk from a mirror set

Hi Stefan,

To remove a mirror disk you should run, in sequence:

1. lvreduce -m1 lv_path
2. vgreduce gg_name pv_path

Best regards,

Dan


Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Dan Hetzel
Honored Contributor

Re: Removing and disk from a mirror set

Hi Stefan,

If the disk was a mirror of the root volume group, don't forget to use lvreduce for the primary swap mirror as well.

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Stefan Saliba
Trusted Contributor

Re: Removing and disk from a mirror set

I tried what you suggested steffi, but what happened is that it did remove the PV from the lvmtab but vgdisplay still claims to have 2 Cur Pv and only 1 Act Pv

I physically removed the mirror disk but vgdisplay still claims to have 2 Cur PV....

How can I update the volume group

Dan yes I did remove the primary swap mirror


Dan Hetzel
Honored Contributor

Re: Removing and disk from a mirror set

Hi Stefan,

As you have physically removed the disk, 'vgscan -a' should fix the problem.

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Stefan Saliba
Trusted Contributor

Re: Removing and disk from a mirror set

I tried vgscan and it created a new lvmtab.

the lvmtab correctly interprets which disk belongs to the volume group but vgdisplay still claims to have 2 Cur PV and 1 Act PV

it's like there is a phantom drive
unixdaddy
Trusted Contributor

Re: Removing and disk from a mirror set

You probably want to run the vgreduce command with the -f option this "removes all missing physical volume from the volume group". You will then probably have to run vgscan again to update your lvmtab and do a vgcfgbackup to backup your configuration. This has worked for me in the past.
Stefan Saliba
Trusted Contributor

Re: Removing and disk from a mirror set

Thanks darren I tried vgreduce with the -f option. It reported the lvol's which had the data in the missing phsical volumes.

It reported lvol9 to have data but lvol9 did not exists and NEVER existed. I manually created the block and character device files for lvol9 and did lvremove on the LV.

After that i tried vgreduce again and it was sucessfull. VGdisplay FINALLY displayed Cur PV 1 Act PV 1.

Still from were did lvol9 come ?? Anyway thanks all of you guys for the help