1753379 Members
5602 Online
108792 Solutions
New Discussion юеВ

Re: Vgimport problem

 
Peter Day_3
Occasional Contributor

Vgimport problem

Guys,
I have recently had to do a cold O/S install, on a server that had a major problem, and I'm at the stage where I want to import several of the disks.

My problem is, that when I do a -

vgimport -v vg06 /dev/dsk/c4t0d0 /dev/dsk/c4t1d0 /dev/dsk/c4t8d0

This works, except I don't have all the data that should be on these disks. I've got loads of

Anybody got any ideas as to why ?

Regards,
Pete
8 REPLIES 8
Pete Randall
Outstanding Contributor

Re: Vgimport problem

Pete,

First question would have to be "are you sure you included all the physical volumes in your vgimport command?" Have you looked at the logical volume layout within vg06? Does it look normal? How are you determining that not all the data is there?


Pete

Pete
Ravi_8
Honored Contributor

Re: Vgimport problem

Hi Pete

do you have the map file?
never give up
Geoff Wild
Honored Contributor

Re: Vgimport problem

Yes, if you have the map file, then don't worry about the disks:

vgimport -s -v -m /tmp/vg06.map /dev/vg06

You will have to recreate vg06 first -
vgexport vg06
mkdir /dev/vg06
mknod /dev/vg06/group c 64 0x060000

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Pete Randall
Outstanding Contributor

Re: Vgimport problem

Another thought would be are you sure that the device files are the same as they used to be? It's possible that the reinstall has changed the device files.

I would try using the -s option of vgimport and let it scan for the physical volumes it needs (I think you may have to have a mapfile): vgimport -s -m /tmp/vg06.map /dev/vg06


Pete

Pete
Peter Day_3
Occasional Contributor

Re: Vgimport problem

Pete/Ravi,
There isn't any mapfile as this was from a cold OS install.

But according to the vgdisplaay it all looks ok, except the the LV names are different to what there were originally.

Pete
A. Clay Stephenson
Acclaimed Contributor

Re: Vgimport problem

I assume that you did a vgchange -y and that was successful.

I suspect that you have not associated all the LVOL's with a filesystem. A good map file would have helped especially if you had
LVOL's other than the standard lvol1, lvol2 ... . If you have an old /etc/fstab on backup, now would be a good time to restore it to another location so that you can see which filesystem, mountpoint, lvols tuples existed prior to the crash. I also suspect that you will need to fsck each filesystem before mounting. As long as all the disks are good, you really shouldn't have lost anything -- though you may have temporily misplaced it. It's always a good idea to run mirrored disks (or RAID) so that the loss of a disk is not a problem.
If it ain't broke, I can fix that.
Colin Topliss
Esteemed Contributor

Re: Vgimport problem

So your lvols were named differently to the standard lvol1, lvol2, lvol..n etc?

I'm afraid it will be a case of mounting each lvol temporarily and working out which one was mounted where. Then either change fstab to use the standard (lvol) names, or rename the lvols back to what they used to be.

I have a script (runs under cron once per day) that writes this information to a hidden file on the filesystem to make the job much easier (I've included it below - use if you wish). That way, whenever I encountered a problem, I could easily tell what was mounted where by temporarily mounting the lvol and checking the contents of the file.

Col.


#!/bin/ksh
###################################################
# Quick re-hash of the lvolinfo command to remove #
# any gzip .lvolinfo files which may exist. #
###################################################
# Modifications #
# ------------- #
# Init Date Comments #
# ----------------------------------------------- #
# CMT 12/03/01 Added ro exclusion. #
###################################################

HOST=$(hostname)


/sbin/mount -l |grep -v " ro "| awk '{print $1 " " $3}' | while read mount lvol
do
if [ -f "$mount/.lvolinfo.gz" ]
then
rm "$mount/.lvolinfo.gz"
fi
echo $HOST $mount $lvol > $mount/.lvolinfo
done
Gerhard Roets
Esteemed Contributor

Re: Vgimport problem

Peter

One of the uses of the mapfile is to get your lvol names back. I would run a "vgscan -p", copy and paste the output somwhere this will show you which physical devices belong together.

For the lvol names the best is the test mounts / uses. It is garuanteed to be more "fun" though if you have raw volumes on it.

Regards
Gerhard