Operating System - HP-UX
1837800 Members
10292 Online
110120 Solutions
New Discussion

Cleaningup unwanted LVM entries

 
SOLVED
Go to solution
GN_1
Occasional Contributor

Cleaningup unwanted LVM entries

Hi All,

I have 5 internal harddisks on my D-Class server. I rebuilt the server with HP-Ux 11.0 on /dev/dsk/c0t5d0. When I try to add other disks using LVM, SAM tells all other disks have entries in lvmtab that can be activated or imported. Trying Activate/Import also fails with error messages. I dont want any old data.

It would be great if somebody suggests a way to clear all unwanted LVM config entries so that I can free-up and use the remaining 4 disks.

for ex. what are the steps to remove all entries related to VGTEST including logical volumes and config entries. Here please assume tgtest has some errors and we want to get-rid-of it.

Thanks
-GN
6 REPLIES 6
James R. Ferguson
Acclaimed Contributor
Solution

Re: Cleaningup unwanted LVM entries

Hi:

The easiest way to cleanup /etc/lvmtab and /etc/lvmpvg is to 'vgxport' the volume group(s) you don't want.

Afterwards, do a 'pvcreate -f' on the physical disk that were part of the volume group(s). This will erase the VGID from the physical disk so that the next time you do a 'pvcreate' you will not be advised that LVM information exists.

Regards!

...JRF...
Christopher McCray_1
Honored Contributor

Re: Cleaningup unwanted LVM entries

Hello,

First I would rename lvmtab to lvmtab.save and issue the vgscan -a command.

If you really don't want the old data then you could pvcreate -f the old disks and start over.

Hope this helps

Chris
It wasn't me!!!!
Jeff Schussele
Honored Contributor

Re: Cleaningup unwanted LVM entries

Hi GN,

Just run
#vgexport /dev/VGTEST
This will remove all VG info from the OS.

Then when you want to reinitialize them run
pvcreate -f /dev/rdsk/cxtydz
This will *force* the reinit & ignore previous LVM info on the disks.

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

Re: Cleaningup unwanted LVM entries

You do not need to do any thing. Just before creating the VG do a pvcreate -f on the disk. It will allow you to create the new VG on the old disk.

Sandip
Good Luck!!!
Sanjay_6
Honored Contributor

Re: Cleaningup unwanted LVM entries

Hi,

If you have a disk which was configured on an older system, but you don't want to recover the data on this newer system, do a pvcreate on the disk with -f option, this will pvcreate forcibly on the disk in questions. Then you can go ahead and create VG / LV's for use on the new system.

pvcreate -f /dev/rdsk/cxtydz

proceed with VG / LV creation.

Hope this helps.

Regds
GN_1
Occasional Contributor

Re: Cleaningup unwanted LVM entries

Thanks for all who helped me with suggestions and commands.
I am glad that the forum is so active and answers were immediate.

Vgexport /dev/vgtest
pvcreate -f /dev/rdsk/cxtydz Works.

Renaming lvmtab and "vgscan -a" also works good.

A "pvcreate -f" without exporting gave me the following error:

# pvcreate -f /dev/rdsk/c0t8d0
pvcreate: The physical volume "/dev/dsk/c0t8d0" is already recorded in the "/etc
/lvmtab" file. #


Thanks again,

-GN