Operating System - HP-UX
1752689 Members
5408 Online
108789 Solutions
New Discussion

why vg config in /etc/lvmtab is not automatically remove?

 
gobi23
Contributor

why vg config in /etc/lvmtab is not automatically remove?

Hi Guys,

 

need your kind response.  I tried to run pvcreate on a new disk i was prompted that it is already existing and when i check the old configuration of vg in /etc/lvmtab it is still there.

 

can you share explanation on this issue???

 

thanks in advance

2 REPLIES 2
Matti_Kurkela
Honored Contributor

Re: why vg config in /etc/lvmtab is not automatically remove?

When a disk or a group of disks is removed, the system does not know if the removal is intentional or not.

 

If the VG configuration for non-existent devices was automatically removed, the system would automatically remove configuration from lvmtab also if someone accidentally disconnected a SCSI or FibreChannel cable from a running system. This is clearly not the right thing for the system to do.

 

Instead, the system assumes that any devices that are suddenly removed might come back later, until told otherwise. The system administrator has a responsibility to delete old configurations when they are no longer needed i.e. when s/he knows that the device was removed on purpose and is not going to be reconnected.

 

If you are replacing a mirrored system disk, you can use vgcfgrestore instead of removing and rebuilding the LVM mirror configuration. If you use vgcfgrestore, you won't need to use pvcreate. Google for HP whitepaper titled "When Good Disks Go Bad" for step-by-step procedures for all common disk replacement scenarios.

 

If you are removing a VG that is no longer needed, you have two options:

  • use lvremove to remove all LVs from the VG, then vgreduce to remove all but one PV, then vgremove to finally destroy the VG. After this, access to the data on the disks cannot be restored with vgimport. This is a multi-step procedure and requires the VG to be active, so the disks must be physically present.
  • use vgexport to remove the configuration of the entire VG from /etc/lvmtab. The data on the disks is not harmed and can be made accessible again using vgimport and the map file created by the vgexport command. But if you do not care about the data, you can just delete the map file. The vgexport command can be used even if the VG is not active, so it can be used to remove from the lvmtab file even if the actual disks are already gone.

Many sysadmins have noticed that it is simpler to use the vgexport process to get rid of unwanted VG configurations than using the full lvremove/vgreduce/vgremove procedure.

 

If you're re-using some disks that have been used in another HP-UX system, pvcreate will detect that the disks already have the PV header structure on them. It will warn you, and will not perform the operation unless you use the '-f' option. In effect, it's asking you: "This disk seems to be a part of a VG that might belong to some other HP-UX system. Are you really sure the disk is free to use?"

MK
Chirag Parikh
Frequent Advisor

Re: why vg config in /etc/lvmtab is not automatically remove?

Not sure that your VG is still using this disk or not?

 

If not, then do "vgexport VGXXX" and then "pvcreate -f DISK"

 

If yes then do "lvreduce -m 0 LVNAME DISKNAME" then "pvcreate -f DISK"

 

Regards,

Chirag Parikh