1752790 Members
6020 Online
108789 Solutions
New Discussion юеВ

Re: Uses of vgscan

 
SOLVED
Go to solution
Trenta Angelo
Contributor

Uses of vgscan

Hi all,
I would like to know when it???s useful command ???vgscan???, during system administration, and if possible, an advise about a good book/document which treats of LVM.

Regards, Angelo
I will work harder, HP-UX is always right
8 REPLIES 8

Re: Uses of vgscan

Hi

If you have a corrupt lvmtab, you can use the vgscan command for the re-creation of the lvmtab file.

for documentation, see http://docs.hp.com

Frederic Sevestre
Honored Contributor

Re: Uses of vgscan

Hi,

vgscan is used to update (repare or recreate) the /etc/lvmtab.

Fr??d??ric
Crime doesn't pay...does that mean that my job is a crime ?
Vincent Farrugia
Honored Contributor

Re: Uses of vgscan

Hello,

The LVM commans vgscan recreates the /etc/lvmtab file. You should use this command when this file is corrupted. This file stores the bindings of physical volumes to their corresponsing volume groups. Do a "strings /etc/lvmtab" in order to view this file.

If you do a man lvm, you will find a good introduction to LVM. also, follow this link:

http://docs.hp.com/cgi-bin/otsearch/getfile?id=/hpux/onlinedocs/os/11i/kcparams/KCparam.LVMparmsOverview.html&searchterms=LVM&queryid=20011030-013153

Hope this helps,
Vince
Tape Drives RULE!!!
Santosh Nair_1
Honored Contributor
Solution

Re: Uses of vgscan

Basically vgscan is used to rebuild the /etc/lvmtab file. This file contains a mapping of disks to VGs. Use this command to rebuild the lvmtabs file if it has gotten corrupt or deleted. vgscan will also give you a listing of disks which it cannot match to any VG. You can then use the vgimport command to recreate these VGs.

As for manuals, see "Configuring HPUX for Peripheral" especially the section on Configuring Disk Drives:

http://docs.hp.com/hpux/onlinedocs/B2355-90698/B2355-90698.html

And "Managing Systems and Workgroups", especially the section on Managing Disks and File:

http://docs.hp.com/cgi-bin/onlinedocs.py?mpn=B2355-90742&service=hpux&path=../B2355-90742/00/00/1&title=Managing%20Systems%20and%20Workgroups%3A%20A%20Guide%20for%20HP-UX%20System%20Administrators

Hope this helps.

-Santosh
Life is what's happening while you're busy making other plans
Carlos Fernandez Riera
Honored Contributor

Re: Uses of vgscan

Fisrt thing you have to do before use vgscan is:

cp /etc/lvmtab /etc/lvmtab.OK

now vgscan -p -v -a # preview first

It could be dangerous.

unsupported
James R. Ferguson
Acclaimed Contributor

Re: Uses of vgscan

Hi:

The man pages (1M) for 'vgscan' note some very important information. You should read them *before* you use 'vgscan'. In particular, they note that the "command should be run only in the event of a catastrophic error such as the deletion of the /etc/lvmtab file or the mismatch of names of the physical volumes in the /etc/lvmtab file to the actual physical volume path configuration."

You should also be aware that "The designated primary and alternate link might not be the same as it was configured before...[and]...The boot information might be incorrect due to different order of disks in the new /etc/lvmtab file."

Regards!

...JRF...
Roger Baptiste
Honored Contributor

Re: Uses of vgscan

Hi,

First rule with vgscan : think twice before
running this command! and even when you
run it, first try it with the -p (preview)
option which shows what it does , without
actually doing it.

Now to some theory, Vgscan creates the
/etc/lvmtab file. This can be run, in case
there is a corruption in the existing lvmtab
file. What is the lvmtab file? To use
an analogy, Lvmtab file is to Volumegroups, just like fstab file is to filesystems.
It has the VG <-> Physical disk mapping info.
It contains the VGid(names) existing in
the system and the physical volumes(disks)
paths they contain.

When vgscan is executed, it searches
through all the disks connected to the system
and collects the VG information stored in
the disk (VGDA?) and groups disks with
the same Vg info together. It then looks
at the /dev directory to find the Vg names
corresponding to the VGinfo (major number)
it collected from the disks. It then
builds the lvmtab file with this info.

You can look at the contents of your
exisiting lvmtab file, by doing
strings /etc/lvmtab >/tmp/xyz .

This is a good site for getting to know the anatomy of LVM :
http://tech.sistina.com/lvm/doc/lvm_howto/2864Contents2864.html

cheers
Raj
Take it easy.
Bill Hassell
Honored Contributor

Re: Uses of vgscan

The web site docs.hp.com will allow you to download and print all the LVM documentation. But like a dictionary, these are reference manuals and not very good at providing training.

For good training books, look at Tom Madell's book "Disk and File Management Tasks on HP-UX" published by HP Press (available at most online book sellers), and Marty Poniatowski's books on HP-UX How-To. There are some differences between 10.20 and 11.xx revisions so pick the books that match you operating system(s).


Bill Hassell, sysadmin