1846284 Members
3598 Online
110256 Solutions
New Discussion

vgscan

 
SOLVED
Go to solution

vgscan

Hi All
We have an N-Class server with two Tachyon fibre channel cards. A while back this sever was connected to a VA storage array. We moved it onto an EMC box but kept all the data intact on the VA, since we might need to use it again.

Stupidly no mapfiles were created of the volume groups on the VA. I now have a requirement to patch the server back into the VA, but obviously I have no mapfiles with which to re-import the volume groups and create the logical volumes. Am I correct in understanding, from the man page, that vgscan will help me out by probing all the PVs and recreating it all for me? Leaving me to just vgchange the VGs once they are back?

If not, is there any other way to bring back those VGs? All the data is intact on the VA - has not changed in any way, the cables were just pulled from it and it's been sitting doing nothing.

Thanks for any help.
8 REPLIES 8
Florian Heigl (new acc)
Honored Contributor

Re: vgscan

vgscan will help You as it collects from the VGRA, which tells You what disks were in the same vg.

a vgscan -v -p is enough

You then need to prepare for a vgimport and vgimport /dev/vgNN /dev/dsk/cztyd0 /dev/dsk/cztyd1 /dev/dsk/cztyd2 ...

afterwards vgchange and see if everything is ok.

For cross-checking I'd recommend You to recover an old /etc/lvmtab and /etc/lvmconf to /tmp and compare the results.
yesterday I stood at the edge. Today I'm one step ahead.
Pete Randall
Outstanding Contributor
Solution

Re: vgscan

The only time you need map files is if the logical volumes used non-standard naming conventions. That is, if the logical volumes were not created with lvol01, lvol02, lvolnn type names. If they did use standard names, you can just vgimport them.


Pete

Pete
Sundar_7
Honored Contributor

Re: vgscan

vgscan will only show which of the PVs belong to the same VG (based on the VGID) and then you will have to import manually.

Did you ever run an ignite on the machine ? -Ignite creates map files in /etc/lvmconf directory.
Learn What to do ,How to do and more importantly When to do ?
A. Clay Stephenson
Acclaimed Contributor

Re: vgscan

Vgscan will do this for you but it can only assign LVOL names lvol1,lvol2, ... so if you had custum LVOL names, those will be lost. If you know the actual PV's then you can simply do a vgimport after creating the /dev/vgxx directory and /dev/vgxx/group node. One option is to do a vgscan -pv to preview the operation and then do the actual operations manually; I actually prefer that method.

Of course, the device nodes for these new devices will need to be in existence before any vgscan can "see" them so after connecting them cables, you will need to do an ioscan -f and an insf.
If it ain't broke, I can fix that.

Re: vgscan

Thanks for the replies.

So vgscan will rebuild the /etc/lvmtab.. then I need to import the VGs manually, which is fine since I have the lvmtab for reference.

The only problem here, if I understand correctly, is that we did use non-standard naming conventions for the LVs. So I will get a bunch of lvol1, lvol2 etc for each VG - and I will then have to mount those volumes in order to ascertain what data they contain and hence at what mountpoints to put them under?
Sundar_7
Honored Contributor

Re: vgscan

# cd /dev/dsk
# for DSK in *
do
VGID=$(echo "0x2008?4D" | adb $DSK | awk '{print $NF}')
echo "$DSK $VGID" >> /tmp/list
done
# sort -bk 2 /tmp/list >> /tmp/PV-VGID.list

remove DVD-ROM and VG00 from the file and import the VGs that have the identical second column (VGID).
Learn What to do ,How to do and more importantly When to do ?
Sundar_7
Honored Contributor

Re: vgscan

sorry a typo

remove DVD-ROM and VG00 from the file and import the PVs that have the identical second column (VGID).
Learn What to do ,How to do and more importantly When to do ?
Florian Heigl (new acc)
Honored Contributor

Re: vgscan

You'll need to look at a backup of /etc/lvmconf or /dev/vgNN (hint: timestamps often show the order in which the lvols were created) for Your old lvol names, it won't get easier than that.

also beware - the maps and backups in the current /etc/lvmconf/ get update by every run of vgcfgbackup, so don't trust them.
yesterday I stood at the edge. Today I'm one step ahead.