LVM and VxVM

How can I get rid of a disk from lvmtab

 
Jash_1
Frequent Advisor

How can I get rid of a disk from lvmtab

Hi,

I have had a problem with some disks having their special files change (don't ask), but the lvmtab has a disk registered in it (including 3 alt paths) but the volume group is not there and I want to reuse the disk.
I have tried moving the lvmtab and running:

#vgscan -v

But it put the disk back into the lvmtab.

Has anyone any ideas as to how I can get it out of the lvmtab.

pvcreate -f didn't work.

hpux 11.23
If I can, I will!
10 REPLIES 10
James R. Ferguson
Acclaimed Contributor

Re: How can I get rid of a disk from lvmtab

Hi Jash:

The easy way is to 'vgexport' the volume group. Then, if you are sure that you want to reuse the physical disk, 'pvcreate' them.

Regards!

...JRF...
Jash_1
Frequent Advisor

Re: How can I get rid of a disk from lvmtab

The volume group has disappeared, else I would have tried that.
If I can, I will!
Tim Nelson
Honored Contributor

Re: How can I get rid of a disk from lvmtab

Try first.

vgreduce -f ( check man page for description

Then if neccessary.

mv /etc/lvmtab /etc/lvmtab.old
then vgscan to rebuild the lvmtab

James R. Ferguson
Acclaimed Contributor

Re: How can I get rid of a disk from lvmtab

Hi (again):

> The volume group has disappeared

If you are absolutely sure of the physical devices that you want to obliterate, the LVM signitures on them with 'pvremove' (on 11.23 or later) or write zeros as:

# pvremove /dev/rdsk/cXtYdZ

(or)

# dd if=/dev/zero of=/dev/rdsk/cXtYdZ bs=1024k count=10000

Then:

# mv /etc/lvmtab /etc/lvmtab.old
# vgscan -av
# vgchange -a y
# lvlnboot -R

Regards!

...JRF...
Jash_1
Frequent Advisor

Re: How can I get rid of a disk from lvmtab

Looking at the man pages for pvremove, it will not let you remove a disk if it is assigned to a volume group. Sadly the disk is assigned to a volume group within the lvmtab! This means it will not work, I think?

I will check it tho'.
If I can, I will!
Jash_1
Frequent Advisor

Re: How can I get rid of a disk from lvmtab

pvremove /dev/rdsk/c20t3d0
pvremove: The physical volume "/dev/rdsk/c20t3d0" belongs to volume group "/dev/vg_dboracle".
pvremove: Couldn't remove physical volume "/dev/rdsk/c20t3d0".
If I can, I will!
Anka
Trusted Contributor

Re: How can I get rid of a disk from lvmtab

Jash, can you paste the entries for the disk and the VG from the /etc/lvmtab
and also #vgdisplay -v
Jash_1
Frequent Advisor

Re: How can I get rid of a disk from lvmtab

apgst01 # strings lvmtab
/dev/vg_dboracle
/dev/dsk/c20t3d0
/dev/dsk/c21t3d0
/dev/dsk/c18t3d0
/dev/dsk/c19t3d0

Multi-path san lun.

apgst01 # vgdisplay -v /dev/vg_dboracle
vgdisplay: Volume group not activated.
vgdisplay: Cannot display volume group "/dev/vg_dboracle".
If I can, I will!
Jash_1
Frequent Advisor

Re: How can I get rid of a disk from lvmtab

#vgexport vg_dboracle

Problem solved, came to me on a fag break!!

Thanks for all the help.
If I can, I will!