Operating System - HP-UX
1837792 Members
12130 Online
110120 Solutions
New Discussion

Problem after deleting logical volumes

 
SOLVED
Go to solution
Jaffar Kazi
Occasional Contributor

Problem after deleting logical volumes

Hi.
I have accidently deleted logical volumes from a volume group using rm instead of lvremove.

Now, I cannot delete the volume group as SAM says that the volume group has logical volumes. But none of them are being shown.

Any solution?
TIA.

Jaffar
6 REPLIES 6
Jaffar Kazi
Occasional Contributor

Re: Problem after deleting logical volumes

Additionally.
After this I did an rm /dev/vg02 also!
Hartmut Lang
Trusted Contributor

Re: Problem after deleting logical volumes

Use vgimport to recreate (import) your vol_group. This should also reimport the logical volumes.

See "man vgimport".

Hardy
Jaffar Kazi
Occasional Contributor

Re: Problem after deleting logical volumes

Hi.
But that would require me to have a previously exported one, right?
I don't have a mapfile that is required for this.
Frederic Sevestre
Honored Contributor
Solution

Re: Problem after deleting logical volumes

Hi,

You don't need any mapfile to imprt your vg :
# mkdir /dev/vg02
# mknod /dev/vg02/group c 64 0x0.....
# vgimport -v vg02 /dev/dsk/cxtydz

where /dev/dsk/cxtydz is the path of the vg02 disk.

As you can't use a mapfile the lv will be named lvol1, lvol2...

Then you will be able to lvremove and vgremove your vg.

Fr??d??ric
Crime doesn't pay...does that mean that my job is a crime ?
Jaffar Kazi
Occasional Contributor

Re: Problem after deleting logical volumes

Thanks!
The import worked and I was able to go ahead.
Jack Daniels_1
Occasional Contributor

Re: Problem after deleting logical volumes

My 2 cents worth now that your problem is fixed.

Since your intention was to remove the VG finally, you could have just done a vgexport $VG_NAME. This would remove all references to the VG and any LVs associated with this VG from your system and also delete the /dev/VG_NAME directory.

To use the same PVs again, do a pvcreate with -f option to overwrite the previous VG information on the disks.